From 1caf662db376296ad512da4f79de62a00cf428ff 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 044d74361..b09d9e49e 160000 --- a/concordium-grpc-api +++ b/concordium-grpc-api @@ -1 +1 @@ -Subproject commit 044d743617e8128203a329e81c77ba129192fd72 +Subproject commit b09d9e49e5e83e670327993f839b43c8f19492a2 diff --git a/rust-src/concordium_base/src/base.rs b/rust-src/concordium_base/src/base.rs index 6e1ea2a4c..cf5605b38 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)]