Skip to content

Commit

Permalink
Add Default instance for UpdateSequenceNumber.
Browse files Browse the repository at this point in the history
  • Loading branch information
td202 committed Jan 16, 2025
1 parent 23f2746 commit 1caf662
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion concordium-grpc-api
6 changes: 5 additions & 1 deletion rust-src/concordium_base/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ impl Nonce {
#[serde(transparent)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, FromStr, Display, From, Into)]
/// Equivalent of a transaction nonce but for update instructions. Update
/// sequence numbers are per update type.
/// sequence numbers are per update type. The minimum sequence number is 1.
pub struct UpdateSequenceNumber {
pub number: u64,
}
Expand All @@ -369,6 +369,10 @@ impl UpdateSequenceNumber {
pub fn next_mut(&mut self) { self.number += 1; }
}

impl Default for UpdateSequenceNumber {
fn default() -> Self { Self { number: 1 } }
}

#[repr(transparent)]
#[derive(SerdeSerialize, SerdeDeserialize, Serialize)]
#[serde(transparent)]
Expand Down

0 comments on commit 1caf662

Please sign in to comment.