Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Default instance for UpdateSequenceNumber. #592

Merged
merged 3 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading