Skip to content

Commit

Permalink
chore: adapt comments
Browse files Browse the repository at this point in the history
  • Loading branch information
grumbach committed Jan 27, 2025
1 parent c8b0155 commit f4c263a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ant-protocol/src/storage/pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ pub enum PointerError {
SerializationError(String),
}

/// Pointer, a mutable address pointing to other data on the Network
/// It is stored at the owner's public key and can only be updated by the owner
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct Pointer {
owner: PublicKey,
Expand Down
8 changes: 4 additions & 4 deletions ant-protocol/src/storage/scratchpad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ use serde::{Deserialize, Serialize};

use xor_name::XorName;

/// Scratchpad, a mutable address for encrypted data
/// Scratchpad, a mutable space for encrypted data on the Network
#[derive(
Hash, Eq, PartialEq, PartialOrd, Ord, Clone, custom_debug::Debug, Serialize, Deserialize,
)]
pub struct Scratchpad {
/// Network address. Omitted when serialising and
/// calculated from the `encrypted_data` when deserialising.
address: ScratchpadAddress,
/// Data encoding: custom apps using scratchpad should use this so they can identify the type of data they are storing in the bytes
/// Data encoding: custom apps using scratchpad should use this so they can identify the type of data they are storing
data_encoding: u64,
/// Contained data. This should be encrypted
/// Encrypted data stored in the scratchpad, it is encrypted automatically by the [`Scratchpad::new`] and [`Scratchpad::update_and_sign`] methods
#[debug(skip)]
encrypted_data: Bytes,
/// Monotonically increasing counter to track the number of times this has been updated.
/// Monotonically increasing counter to track the number of times this has been updated. When pushed to the network, the scratchpad with the highest counter is kept.
counter: u64,
/// Signature over the above fields
signature: Signature,
Expand Down

0 comments on commit f4c263a

Please sign in to comment.