From 2e266ecab2a8cd84788e9571d139bebbb44c649e Mon Sep 17 00:00:00 2001 From: Thomas Dinsdale-Young Date: Thu, 16 Jan 2025 13:15:22 +0100 Subject: [PATCH] Add `Default` instance for `UpdateSequenceNumber`. --- concordium-grpc-api | 2 +- rust-src/concordium_base/src/base.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/concordium-grpc-api b/concordium-grpc-api index 30ebd6231..9f4906ca2 160000 --- a/concordium-grpc-api +++ b/concordium-grpc-api @@ -1 +1 @@ -Subproject commit 30ebd62312470f7dbb93309a4fc58e9082d0fedc +Subproject commit 9f4906ca20d687e79a83de8058d302757aee0e80 diff --git a/rust-src/concordium_base/src/base.rs b/rust-src/concordium_base/src/base.rs index 72ccf98d9..b1a83325c 100644 --- a/rust-src/concordium_base/src/base.rs +++ b/rust-src/concordium_base/src/base.rs @@ -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, } @@ -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)]