Skip to content

Commit

Permalink
Merge pull request #592 from Concordium/default-update-sequence-number
Browse files Browse the repository at this point in the history
Add `Default` instance for `UpdateSequenceNumber`.
  • Loading branch information
td202 authored Jan 16, 2025
2 parents 67227da + 97744bd commit 4da594d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion concordium-grpc-api
1 change: 1 addition & 0 deletions rust-src/concordium_base/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Add constructor `TokenAddress::new` for CIS2 type `TokenAddress`.
- Introduce new chain parameters `ValidatorScoreParameters` that contain the
threshold of maximal missed rounds before a validator gets suspended.
- Add `Default` instance for `UpdateSequenceNumber`.

## 6.0.0

Expand Down
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 4da594d

Please sign in to comment.