From 3be5eedadba0a3c1f3376a58bf679c34887d9746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Zeppelin?= Date: Thu, 3 Oct 2024 12:52:07 +0200 Subject: [PATCH 1/5] Update grpc-api reference to pv7 --- concordium-grpc-api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concordium-grpc-api b/concordium-grpc-api index ffd3be6..88183a8 160000 --- a/concordium-grpc-api +++ b/concordium-grpc-api @@ -1 +1 @@ -Subproject commit ffd3be63c6f799438e6b465389ffc0cef83095b7 +Subproject commit 88183a8f5e0a3208f4da65d46e0c56d7ec5f14f7 From 0cf5810f0d85286cf927573e624b2473a12908c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Zeppelin?= Date: Thu, 3 Oct 2024 13:02:58 +0200 Subject: [PATCH 2/5] Generate p7 types --- README.md | 3 + .../GRPC/v2/concordium/health.pb.swift | 19 +- .../GRPC/v2/concordium/service.pb.swift | 14 +- .../GRPC/v2/concordium/types.pb.swift | 3172 +++++------------ 4 files changed, 905 insertions(+), 2303 deletions(-) diff --git a/README.md b/README.md index f4d50ac..5f757f6 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,9 @@ Features: - Support for decrypting and using accounts created using the legacy wallet. - Utilities for working with amounts in CCD and fungible CIS-2 tokens of arbitrary size. +### Dependencies +- swift-protobuf + grpc-swift: `brew install swift-protobuf grpc-swift` + ### Cryptographic functions Concordium specific cryptographic functions that are implemented in Rust are exposed as a separate Swift library diff --git a/Sources/Concordium/Generated/GRPC/v2/concordium/health.pb.swift b/Sources/Concordium/Generated/GRPC/v2/concordium/health.pb.swift index 979224f..ea7b17b 100644 --- a/Sources/Concordium/Generated/GRPC/v2/concordium/health.pb.swift +++ b/Sources/Concordium/Generated/GRPC/v2/concordium/health.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: v2/concordium/health.proto @@ -7,7 +8,6 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ -import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file @@ -22,7 +22,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP /// Parameters to the node health query. The default message gives a good /// default. -struct Concordium_Health_NodeHealthRequest { +struct Concordium_Health_NodeHealthRequest: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -34,7 +34,7 @@ struct Concordium_Health_NodeHealthRequest { /// Response to the health check. A return code of "OK" is used for success, and /// errors are handled via RPC status codes -struct Concordium_Health_NodeHealthResponse { +struct Concordium_Health_NodeHealthResponse: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -44,11 +44,6 @@ struct Concordium_Health_NodeHealthResponse { init() {} } -#if swift(>=5.5) && canImport(_Concurrency) -extension Concordium_Health_NodeHealthRequest: @unchecked Sendable {} -extension Concordium_Health_NodeHealthResponse: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) - // MARK: - Code below here is support for the SwiftProtobuf runtime. fileprivate let _protobuf_package = "concordium.health" @@ -58,8 +53,8 @@ extension Concordium_Health_NodeHealthRequest: SwiftProtobuf.Message, SwiftProto static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + // Load everything into unknown fields + while try decoder.nextFieldNumber() != nil {} } func traverse(visitor: inout V) throws { @@ -77,8 +72,8 @@ extension Concordium_Health_NodeHealthResponse: SwiftProtobuf.Message, SwiftProt static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + // Load everything into unknown fields + while try decoder.nextFieldNumber() != nil {} } func traverse(visitor: inout V) throws { diff --git a/Sources/Concordium/Generated/GRPC/v2/concordium/service.pb.swift b/Sources/Concordium/Generated/GRPC/v2/concordium/service.pb.swift index 9cfac75..c0eae39 100644 --- a/Sources/Concordium/Generated/GRPC/v2/concordium/service.pb.swift +++ b/Sources/Concordium/Generated/GRPC/v2/concordium/service.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: v2/concordium/service.proto @@ -7,15 +8,4 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} +// This file contained no messages, enums, or extensions. diff --git a/Sources/Concordium/Generated/GRPC/v2/concordium/types.pb.swift b/Sources/Concordium/Generated/GRPC/v2/concordium/types.pb.swift index 8915fb3..51e3eb3 100644 --- a/Sources/Concordium/Generated/GRPC/v2/concordium/types.pb.swift +++ b/Sources/Concordium/Generated/GRPC/v2/concordium/types.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: v2/concordium/types.proto @@ -21,7 +22,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP } /// Information about how open the pool is to new delegators. -enum Concordium_V2_OpenStatus: SwiftProtobuf.Enum { +enum Concordium_V2_OpenStatus: SwiftProtobuf.Enum, Swift.CaseIterable { typealias RawValue = Int case openForAll // = 0 case closedForNew // = 1 @@ -50,23 +51,17 @@ enum Concordium_V2_OpenStatus: SwiftProtobuf.Enum { } } -} - -#if swift(>=4.2) - -extension Concordium_V2_OpenStatus: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. static let allCases: [Concordium_V2_OpenStatus] = [ .openForAll, .closedForNew, .closedForAll, ] -} -#endif // swift(>=4.2) +} /// Version of smart contract. -enum Concordium_V2_ContractVersion: SwiftProtobuf.Enum { +enum Concordium_V2_ContractVersion: SwiftProtobuf.Enum, Swift.CaseIterable { typealias RawValue = Int case v0 // = 0 case v1 // = 1 @@ -92,22 +87,16 @@ enum Concordium_V2_ContractVersion: SwiftProtobuf.Enum { } } -} - -#if swift(>=4.2) - -extension Concordium_V2_ContractVersion: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. static let allCases: [Concordium_V2_ContractVersion] = [ .v0, .v1, ] -} -#endif // swift(>=4.2) +} /// The type of a credential. -enum Concordium_V2_CredentialType: SwiftProtobuf.Enum { +enum Concordium_V2_CredentialType: SwiftProtobuf.Enum, Swift.CaseIterable { typealias RawValue = Int /// An initial credential created by the identity provider. @@ -137,22 +126,16 @@ enum Concordium_V2_CredentialType: SwiftProtobuf.Enum { } } -} - -#if swift(>=4.2) - -extension Concordium_V2_CredentialType: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. static let allCases: [Concordium_V2_CredentialType] = [ .initial, .normal, ] -} -#endif // swift(>=4.2) +} /// The type of chain update. -enum Concordium_V2_UpdateType: SwiftProtobuf.Enum { +enum Concordium_V2_UpdateType: SwiftProtobuf.Enum, Swift.CaseIterable { typealias RawValue = Int case updateProtocol // = 0 case updateElectionDifficulty // = 1 @@ -232,11 +215,6 @@ enum Concordium_V2_UpdateType: SwiftProtobuf.Enum { } } -} - -#if swift(>=4.2) - -extension Concordium_V2_UpdateType: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. static let allCases: [Concordium_V2_UpdateType] = [ .updateProtocol, @@ -260,12 +238,11 @@ extension Concordium_V2_UpdateType: CaseIterable { .updateBlockEnergyLimit, .updateFinalizationCommitteeParameters, ] -} -#endif // swift(>=4.2) +} /// The type of transaction. -enum Concordium_V2_TransactionType: SwiftProtobuf.Enum { +enum Concordium_V2_TransactionType: SwiftProtobuf.Enum, Swift.CaseIterable { typealias RawValue = Int case deployModule // = 0 case initContract // = 1 @@ -348,11 +325,6 @@ enum Concordium_V2_TransactionType: SwiftProtobuf.Enum { } } -} - -#if swift(>=4.2) - -extension Concordium_V2_TransactionType: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. static let allCases: [Concordium_V2_TransactionType] = [ .deployModule, @@ -377,12 +349,11 @@ extension Concordium_V2_TransactionType: CaseIterable { .configureBaker, .configureDelegation, ] -} -#endif // swift(>=4.2) +} /// The different versions of the protocol. -enum Concordium_V2_ProtocolVersion: SwiftProtobuf.Enum { +enum Concordium_V2_ProtocolVersion: SwiftProtobuf.Enum, Swift.CaseIterable { typealias RawValue = Int case protocolVersion1 // = 0 case protocolVersion2 // = 1 @@ -423,11 +394,6 @@ enum Concordium_V2_ProtocolVersion: SwiftProtobuf.Enum { } } -} - -#if swift(>=4.2) - -extension Concordium_V2_ProtocolVersion: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. static let allCases: [Concordium_V2_ProtocolVersion] = [ .protocolVersion1, @@ -438,12 +404,11 @@ extension Concordium_V2_ProtocolVersion: CaseIterable { .protocolVersion6, .protocolVersion7, ] -} -#endif // swift(>=4.2) +} /// A message that contains no information. -struct Concordium_V2_Empty { +struct Concordium_V2_Empty: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -454,7 +419,7 @@ struct Concordium_V2_Empty { } /// Hash of a block. This is always 32 bytes long. -struct Concordium_V2_BlockHash { +struct Concordium_V2_BlockHash: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -467,7 +432,7 @@ struct Concordium_V2_BlockHash { } /// A SHA256 hash. This is always 32 bytes long. -struct Concordium_V2_Sha256Hash { +struct Concordium_V2_Sha256Hash: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -480,7 +445,7 @@ struct Concordium_V2_Sha256Hash { } /// Hash of a transaction. This is always 32 bytes long. -struct Concordium_V2_TransactionHash { +struct Concordium_V2_TransactionHash: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -493,7 +458,7 @@ struct Concordium_V2_TransactionHash { } /// Hash of the state after some block. This is always 32 bytes long. -struct Concordium_V2_StateHash { +struct Concordium_V2_StateHash: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -508,7 +473,7 @@ struct Concordium_V2_StateHash { /// The absolute height of a block. This is the number of ancestors of a block /// since the genesis block. In particular, the chain genesis block has absolute /// height 0. -struct Concordium_V2_AbsoluteBlockHeight { +struct Concordium_V2_AbsoluteBlockHeight: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -522,7 +487,7 @@ struct Concordium_V2_AbsoluteBlockHeight { /// The height of a block relative to the last genesis. This differs from the /// absolute block height in that it counts height from the last protocol update. -struct Concordium_V2_BlockHeight { +struct Concordium_V2_BlockHeight: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -535,7 +500,7 @@ struct Concordium_V2_BlockHeight { } /// The ID of a baker, which is the index of its account. -struct Concordium_V2_BakerId { +struct Concordium_V2_BakerId: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -549,7 +514,7 @@ struct Concordium_V2_BakerId { /// Index of the account in the account table. These are assigned sequentially /// in the order of creation of accounts. The first account has index 0. -struct Concordium_V2_AccountIndex { +struct Concordium_V2_AccountIndex: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -562,7 +527,7 @@ struct Concordium_V2_AccountIndex { } /// A smart contract module reference. This is always 32 bytes long. -struct Concordium_V2_ModuleRef { +struct Concordium_V2_ModuleRef: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -575,7 +540,7 @@ struct Concordium_V2_ModuleRef { } /// Source bytes of a versioned smart contract module. -struct Concordium_V2_VersionedModuleSource { +struct Concordium_V2_VersionedModuleSource: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -600,32 +565,14 @@ struct Concordium_V2_VersionedModuleSource { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Module: Equatable { + enum OneOf_Module: Equatable, Sendable { case v0(Concordium_V2_VersionedModuleSource.ModuleSourceV0) case v1(Concordium_V2_VersionedModuleSource.ModuleSourceV1) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_VersionedModuleSource.OneOf_Module, rhs: Concordium_V2_VersionedModuleSource.OneOf_Module) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.v0, .v0): return { - guard case .v0(let l) = lhs, case .v0(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.v1, .v1): return { - guard case .v1(let l) = lhs, case .v1(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// Source bytes of a smart contract v0 module. - struct ModuleSourceV0 { + struct ModuleSourceV0: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -638,7 +585,7 @@ struct Concordium_V2_VersionedModuleSource { } /// Source bytes of a smart contract v1 module. - struct ModuleSourceV1 { + struct ModuleSourceV1: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -654,7 +601,7 @@ struct Concordium_V2_VersionedModuleSource { } /// Unix timestamp in milliseconds. -struct Concordium_V2_Timestamp { +struct Concordium_V2_Timestamp: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -667,7 +614,7 @@ struct Concordium_V2_Timestamp { } /// An individual release of a locked balance. -struct Concordium_V2_Release { +struct Concordium_V2_Release: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -704,7 +651,7 @@ struct Concordium_V2_Release { } /// A new individual release. Part of a single transfer with schedule transaction. -struct Concordium_V2_NewRelease { +struct Concordium_V2_NewRelease: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -739,7 +686,7 @@ struct Concordium_V2_NewRelease { /// State of the account's release schedule. This is the balance of the account /// that is owned by the account, but cannot be used until the release point. -struct Concordium_V2_ReleaseSchedule { +struct Concordium_V2_ReleaseSchedule: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -769,7 +716,7 @@ struct Concordium_V2_ReleaseSchedule { /// represents the high 32 bits. The chunks are serialized in order and /// represented as a byte array. /// Always 192 bytes. -struct Concordium_V2_EncryptedAmount { +struct Concordium_V2_EncryptedAmount: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -781,7 +728,7 @@ struct Concordium_V2_EncryptedAmount { init() {} } -struct Concordium_V2_EncryptedBalance { +struct Concordium_V2_EncryptedBalance: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -848,7 +795,7 @@ struct Concordium_V2_EncryptedBalance { } /// Entity to which the account delegates a portion of its stake. -struct Concordium_V2_DelegationTarget { +struct Concordium_V2_DelegationTarget: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -875,37 +822,19 @@ struct Concordium_V2_DelegationTarget { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Target: Equatable { + enum OneOf_Target: Equatable, Sendable { /// Delegate passively, i.e., to no specific baker. case passive(Concordium_V2_Empty) /// Delegate to a specific baker. case baker(Concordium_V2_BakerId) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_DelegationTarget.OneOf_Target, rhs: Concordium_V2_DelegationTarget.OneOf_Target) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.passive, .passive): return { - guard case .passive(let l) = lhs, case .passive(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.baker, .baker): return { - guard case .baker(let l) = lhs, case .baker(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} } /// Baker's public key used to check whether they won the lottery or not. -struct Concordium_V2_BakerElectionVerifyKey { +struct Concordium_V2_BakerElectionVerifyKey: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -919,7 +848,7 @@ struct Concordium_V2_BakerElectionVerifyKey { /// Baker's public key used to check that they are indeed the ones who /// produced the block. -struct Concordium_V2_BakerSignatureVerifyKey { +struct Concordium_V2_BakerSignatureVerifyKey: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -934,7 +863,7 @@ struct Concordium_V2_BakerSignatureVerifyKey { /// Baker's public key used to check signatures on finalization records. /// This is only used if the baker has sufficient stake to participate in /// finalization. -struct Concordium_V2_BakerAggregationVerifyKey { +struct Concordium_V2_BakerAggregationVerifyKey: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -947,7 +876,7 @@ struct Concordium_V2_BakerAggregationVerifyKey { } /// Information about a baker. -struct Concordium_V2_BakerInfo { +struct Concordium_V2_BakerInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1007,7 +936,7 @@ struct Concordium_V2_BakerInfo { } /// Pending change to the stake either of a baker or delegator. -struct Concordium_V2_StakePendingChange { +struct Concordium_V2_StakePendingChange: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1034,33 +963,15 @@ struct Concordium_V2_StakePendingChange { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Change: Equatable { + enum OneOf_Change: Equatable, Sendable { case reduce(Concordium_V2_StakePendingChange.Reduce) /// Remove the stake. The value is a Unix timestamp of the effective time in /// milliseconds. case remove(Concordium_V2_Timestamp) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_StakePendingChange.OneOf_Change, rhs: Concordium_V2_StakePendingChange.OneOf_Change) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.reduce, .reduce): return { - guard case .reduce(let l) = lhs, case .reduce(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.remove, .remove): return { - guard case .remove(let l) = lhs, case .remove(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } - struct Reduce { + struct Reduce: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1096,7 +1007,7 @@ struct Concordium_V2_StakePendingChange { } /// A fraction of an amount with a precision of `1/100_000`. -struct Concordium_V2_AmountFraction { +struct Concordium_V2_AmountFraction: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1110,7 +1021,7 @@ struct Concordium_V2_AmountFraction { } /// Distribution of the rewards for the particular pool. -struct Concordium_V2_CommissionRates { +struct Concordium_V2_CommissionRates: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1156,7 +1067,7 @@ struct Concordium_V2_CommissionRates { /// Additional information about a baking pool. /// This information is added with the introduction of delegation. -struct Concordium_V2_BakerPoolInfo { +struct Concordium_V2_BakerPoolInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1186,7 +1097,7 @@ struct Concordium_V2_BakerPoolInfo { /// Information about the account stake, if the account is either a baker or a /// delegator. -struct Concordium_V2_AccountStakingInfo { +struct Concordium_V2_AccountStakingInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1213,33 +1124,15 @@ struct Concordium_V2_AccountStakingInfo { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_StakingInfo: Equatable { + enum OneOf_StakingInfo: Equatable, Sendable { /// The account is a baker. case baker(Concordium_V2_AccountStakingInfo.Baker) /// The account is a delegator. case delegator(Concordium_V2_AccountStakingInfo.Delegator) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_AccountStakingInfo.OneOf_StakingInfo, rhs: Concordium_V2_AccountStakingInfo.OneOf_StakingInfo) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.baker, .baker): return { - guard case .baker(let l) = lhs, case .baker(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.delegator, .delegator): return { - guard case .delegator(let l) = lhs, case .delegator(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } - struct Baker { + struct Baker: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1299,7 +1192,7 @@ struct Concordium_V2_AccountStakingInfo { fileprivate var _poolInfo: Concordium_V2_BakerPoolInfo? = nil } - struct Delegator { + struct Delegator: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1351,7 +1244,7 @@ struct Concordium_V2_AccountStakingInfo { /// A sequence number that determines the ordering of transactions from the /// account. The minimum sequence number is 1. -struct Concordium_V2_SequenceNumber { +struct Concordium_V2_SequenceNumber: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1367,7 +1260,7 @@ struct Concordium_V2_SequenceNumber { /// A sequence number that determines the ordering of update transactions. /// Equivalent to `SequenceNumber` for account transactions. /// Update sequence numbers are per update type and the minimum value is 1. -struct Concordium_V2_UpdateSequenceNumber { +struct Concordium_V2_UpdateSequenceNumber: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1381,7 +1274,7 @@ struct Concordium_V2_UpdateSequenceNumber { } /// An amount of microCCD. -struct Concordium_V2_Amount { +struct Concordium_V2_Amount: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1394,7 +1287,7 @@ struct Concordium_V2_Amount { } /// Index of a credential on an account. -struct Concordium_V2_CredentialIndex { +struct Concordium_V2_CredentialIndex: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1407,7 +1300,7 @@ struct Concordium_V2_CredentialIndex { } /// The number of signatures required to sign. -struct Concordium_V2_SignatureThreshold { +struct Concordium_V2_SignatureThreshold: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1420,7 +1313,7 @@ struct Concordium_V2_SignatureThreshold { } /// The number of credentials required to sign an account transaction. -struct Concordium_V2_AccountThreshold { +struct Concordium_V2_AccountThreshold: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1433,7 +1326,7 @@ struct Concordium_V2_AccountThreshold { } /// An account encryption key. Always 96 bytes. -struct Concordium_V2_EncryptionKey { +struct Concordium_V2_EncryptionKey: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1446,7 +1339,7 @@ struct Concordium_V2_EncryptionKey { } /// An address of an account. Always 32 bytes. -struct Concordium_V2_AccountAddress { +struct Concordium_V2_AccountAddress: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1459,7 +1352,7 @@ struct Concordium_V2_AccountAddress { } /// An address of either a contract or an account. -struct Concordium_V2_Address { +struct Concordium_V2_Address: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1484,35 +1377,17 @@ struct Concordium_V2_Address { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Type: Equatable { + enum OneOf_Type: Equatable, Sendable { case account(Concordium_V2_AccountAddress) case contract(Concordium_V2_ContractAddress) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_Address.OneOf_Type, rhs: Concordium_V2_Address.OneOf_Type) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.account, .account): return { - guard case .account(let l) = lhs, case .account(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.contract, .contract): return { - guard case .contract(let l) = lhs, case .contract(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} } /// A public key used to verify transaction signatures from an account. -struct Concordium_V2_AccountVerifyKey { +struct Concordium_V2_AccountVerifyKey: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1529,29 +1404,16 @@ struct Concordium_V2_AccountVerifyKey { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Key: Equatable { + enum OneOf_Key: Equatable, @unchecked Sendable { case ed25519Key(Data) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_AccountVerifyKey.OneOf_Key, rhs: Concordium_V2_AccountVerifyKey.OneOf_Key) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.ed25519Key, .ed25519Key): return { - guard case .ed25519Key(let l) = lhs, case .ed25519Key(let r) = rhs else { preconditionFailure() } - return l == r - }() - } - } - #endif } init() {} } /// Public keys of a single credential. -struct Concordium_V2_CredentialPublicKeys { +struct Concordium_V2_CredentialPublicKeys: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1576,7 +1438,7 @@ struct Concordium_V2_CredentialPublicKeys { /// A registration ID of a credential, derived from the secret PRF key and a /// nonce. This is always 48 bytes long. -struct Concordium_V2_CredentialRegistrationId { +struct Concordium_V2_CredentialRegistrationId: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1590,7 +1452,7 @@ struct Concordium_V2_CredentialRegistrationId { /// An index of the identity provider that identifies them uniquely in the /// context of a specific chain. -struct Concordium_V2_IdentityProviderIdentity { +struct Concordium_V2_IdentityProviderIdentity: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1603,7 +1465,7 @@ struct Concordium_V2_IdentityProviderIdentity { } /// Representation of the pair of a year and month. -struct Concordium_V2_YearMonth { +struct Concordium_V2_YearMonth: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1618,7 +1480,7 @@ struct Concordium_V2_YearMonth { } /// Policy on a credential. -struct Concordium_V2_Policy { +struct Concordium_V2_Policy: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1659,7 +1521,7 @@ struct Concordium_V2_Policy { } /// Values contained in an initial credential. -struct Concordium_V2_InitialCredentialValues { +struct Concordium_V2_InitialCredentialValues: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1717,7 +1579,7 @@ struct Concordium_V2_InitialCredentialValues { /// Data relating to a single anonymity revoker sent by the account holder to /// the chain. -struct Concordium_V2_ChainArData { +struct Concordium_V2_ChainArData: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1732,7 +1594,7 @@ struct Concordium_V2_ChainArData { /// The number of anonymity revokers needed to revoke anonymity of a credential /// holder. -struct Concordium_V2_ArThreshold { +struct Concordium_V2_ArThreshold: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1746,7 +1608,7 @@ struct Concordium_V2_ArThreshold { /// A single commitment in the G1 group of the BLS curve. This is always 48 bytes /// in length. -struct Concordium_V2_Commitment { +struct Concordium_V2_Commitment: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1759,7 +1621,7 @@ struct Concordium_V2_Commitment { } /// Commitments that are part of a normal credential. -struct Concordium_V2_CredentialCommitments { +struct Concordium_V2_CredentialCommitments: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1813,7 +1675,7 @@ struct Concordium_V2_CredentialCommitments { } /// Values contained in a normal (non-initial) credential. -struct Concordium_V2_NormalCredentialValues { +struct Concordium_V2_NormalCredentialValues: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1896,7 +1758,7 @@ struct Concordium_V2_NormalCredentialValues { } /// Credential that is part of an account. -struct Concordium_V2_AccountCredential { +struct Concordium_V2_AccountCredential: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -1921,35 +1783,111 @@ struct Concordium_V2_AccountCredential { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_CredentialValues: Equatable { + enum OneOf_CredentialValues: Equatable, Sendable { case initial(Concordium_V2_InitialCredentialValues) case normal(Concordium_V2_NormalCredentialValues) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_AccountCredential.OneOf_CredentialValues, rhs: Concordium_V2_AccountCredential.OneOf_CredentialValues) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.initial, .initial): return { - guard case .initial(let l) = lhs, case .initial(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.normal, .normal): return { - guard case .normal(let l) = lhs, case .normal(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false + } + + init() {} +} + +struct Concordium_V2_Cooldown: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The time in milliseconds since the Unix epoch when the cooldown period + /// ends. + var endTime: Concordium_V2_Timestamp { + get {return _endTime ?? Concordium_V2_Timestamp()} + set {_endTime = newValue} + } + /// Returns true if `endTime` has been explicitly set. + var hasEndTime: Bool {return self._endTime != nil} + /// Clears the value of `endTime`. Subsequent reads from it will return its default value. + mutating func clearEndTime() {self._endTime = nil} + + /// The amount that is in cooldown and set to be released at the end of the + /// cooldown period. + var amount: Concordium_V2_Amount { + get {return _amount ?? Concordium_V2_Amount()} + set {_amount = newValue} + } + /// Returns true if `amount` has been explicitly set. + var hasAmount: Bool {return self._amount != nil} + /// Clears the value of `amount`. Subsequent reads from it will return its default value. + mutating func clearAmount() {self._amount = nil} + + /// The status of the cooldown. + var status: Concordium_V2_Cooldown.CooldownStatus = .cooldown + + var unknownFields = SwiftProtobuf.UnknownStorage() + + /// The status of a cooldown. When stake is removed from a baker or delegator + /// (from protocol version 7) it first enters the pre-pre-cooldown state. + /// The next time the stake snaphot is taken (at the epoch transition before + /// a payday) it enters the pre-cooldown state. At the subsequent payday, it + /// enters the cooldown state. At the payday after the end of the cooldown + /// period, the stake is finally released. + enum CooldownStatus: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + + /// The amount is in cooldown and will expire at the specified time, becoming available + /// at the subsequent pay day. + case cooldown // = 0 + + /// The amount will enter cooldown at the next pay day. The specified end time is + /// projected to be the end of the cooldown period, but the actual end time will be + /// determined at the payday, and may be different if the global cooldown period + /// changes. + case preCooldown // = 1 + + /// The amount will enter pre-cooldown at the next snapshot epoch (i.e. the epoch + /// transition before a pay day transition). As with pre-cooldown, the specified + /// end time is projected, but the actual end time will be determined later. + case prePreCooldown // = 2 + case UNRECOGNIZED(Int) + + init() { + self = .cooldown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .cooldown + case 1: self = .preCooldown + case 2: self = .prePreCooldown + default: self = .UNRECOGNIZED(rawValue) } } - #endif + + var rawValue: Int { + switch self { + case .cooldown: return 0 + case .preCooldown: return 1 + case .prePreCooldown: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Concordium_V2_Cooldown.CooldownStatus] = [ + .cooldown, + .preCooldown, + .prePreCooldown, + ] + } init() {} + + fileprivate var _endTime: Concordium_V2_Timestamp? = nil + fileprivate var _amount: Concordium_V2_Amount? = nil } /// Information about the account at a particular point in time. -struct Concordium_V2_AccountInfo { +struct Concordium_V2_AccountInfo: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2061,6 +1999,29 @@ struct Concordium_V2_AccountInfo { /// Clears the value of `address`. Subsequent reads from it will return its default value. mutating func clearAddress() {_uniqueStorage()._address = nil} + /// The stake on the account that is in cooldown. + /// There can be multiple amounts in cooldown that expire at different times. + /// This was introduced in protocol version 7, and so is not present in + /// earlier protocol versions. + var cooldowns: [Concordium_V2_Cooldown] { + get {return _storage._cooldowns} + set {_uniqueStorage()._cooldowns = newValue} + } + + /// The available (unencrypted) balance of the account (i.e. that can be transferred + /// or used to pay for transactions). This is the balance minus the locked amount. + /// The locked amount is the maximum of the amount in the release schedule and + /// the total amount that is actively staked or in cooldown (inactive stake). + /// This was introduced in node version 7.0. + var availableBalance: Concordium_V2_Amount { + get {return _storage._availableBalance ?? Concordium_V2_Amount()} + set {_uniqueStorage()._availableBalance = newValue} + } + /// Returns true if `availableBalance` has been explicitly set. + var hasAvailableBalance: Bool {return _storage._availableBalance != nil} + /// Clears the value of `availableBalance`. Subsequent reads from it will return its default value. + mutating func clearAvailableBalance() {_uniqueStorage()._availableBalance = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} @@ -2069,7 +2030,7 @@ struct Concordium_V2_AccountInfo { } /// Input to queries which take a block as a parameter. -struct Concordium_V2_BlockHashInput { +struct Concordium_V2_BlockHashInput: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2123,7 +2084,7 @@ struct Concordium_V2_BlockHashInput { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_BlockHashInput: Equatable { + enum OneOf_BlockHashInput: Equatable, Sendable { /// Query for the best block. case best(Concordium_V2_Empty) /// Query for the last finalized block. @@ -2135,40 +2096,10 @@ struct Concordium_V2_BlockHashInput { /// Query for a block at height relative to a genesis index. case relativeHeight(Concordium_V2_BlockHashInput.RelativeHeight) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_BlockHashInput.OneOf_BlockHashInput, rhs: Concordium_V2_BlockHashInput.OneOf_BlockHashInput) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.best, .best): return { - guard case .best(let l) = lhs, case .best(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.lastFinal, .lastFinal): return { - guard case .lastFinal(let l) = lhs, case .lastFinal(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.given, .given): return { - guard case .given(let l) = lhs, case .given(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.absoluteHeight, .absoluteHeight): return { - guard case .absoluteHeight(let l) = lhs, case .absoluteHeight(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.relativeHeight, .relativeHeight): return { - guard case .relativeHeight(let l) = lhs, case .relativeHeight(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// Request using a relative block height. - struct RelativeHeight { + struct RelativeHeight: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2209,7 +2140,7 @@ struct Concordium_V2_BlockHashInput { } /// Input to queries which take an epoch as a parameter. -struct Concordium_V2_EpochRequest { +struct Concordium_V2_EpochRequest: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2236,34 +2167,16 @@ struct Concordium_V2_EpochRequest { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_EpochRequestInput: Equatable { + enum OneOf_EpochRequestInput: Equatable, Sendable { /// Query by genesis index and epoch number. case relativeEpoch(Concordium_V2_EpochRequest.RelativeEpoch) /// Query for the epoch of a specified block. case blockHash(Concordium_V2_BlockHashInput) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_EpochRequest.OneOf_EpochRequestInput, rhs: Concordium_V2_EpochRequest.OneOf_EpochRequestInput) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.relativeEpoch, .relativeEpoch): return { - guard case .relativeEpoch(let l) = lhs, case .relativeEpoch(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.blockHash, .blockHash): return { - guard case .blockHash(let l) = lhs, case .blockHash(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// Request an epoch by number at a given genesis index. - struct RelativeEpoch { + struct RelativeEpoch: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2301,7 +2214,7 @@ struct Concordium_V2_EpochRequest { } /// Input to queries which take an account as a parameter. -struct Concordium_V2_AccountIdentifierInput { +struct Concordium_V2_AccountIdentifierInput: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2337,7 +2250,7 @@ struct Concordium_V2_AccountIdentifierInput { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_AccountIdentifierInput: Equatable { + enum OneOf_AccountIdentifierInput: Equatable, Sendable { /// Identify the account by the address of the account. case address(Concordium_V2_AccountAddress) /// Identify the account by the credential that belongs or has belonged to it. @@ -2345,35 +2258,13 @@ struct Concordium_V2_AccountIdentifierInput { /// Identify the account via its index. case accountIndex(Concordium_V2_AccountIndex) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_AccountIdentifierInput.OneOf_AccountIdentifierInput, rhs: Concordium_V2_AccountIdentifierInput.OneOf_AccountIdentifierInput) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.address, .address): return { - guard case .address(let l) = lhs, case .address(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.credID, .credID): return { - guard case .credID(let l) = lhs, case .credID(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.accountIndex, .accountIndex): return { - guard case .accountIndex(let l) = lhs, case .accountIndex(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} } /// Request for account information. -struct Concordium_V2_AccountInfoRequest { +struct Concordium_V2_AccountInfoRequest: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2407,7 +2298,7 @@ struct Concordium_V2_AccountInfoRequest { } /// Information about a finalized block that is part of the streaming response. -struct Concordium_V2_FinalizedBlockInfo { +struct Concordium_V2_FinalizedBlockInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2441,7 +2332,7 @@ struct Concordium_V2_FinalizedBlockInfo { } /// Request the ancestors for the given block. -struct Concordium_V2_AncestorsRequest { +struct Concordium_V2_AncestorsRequest: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2467,7 +2358,7 @@ struct Concordium_V2_AncestorsRequest { } /// Request for getting the source of a smart contract module. -struct Concordium_V2_ModuleSourceRequest { +struct Concordium_V2_ModuleSourceRequest: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2501,7 +2392,7 @@ struct Concordium_V2_ModuleSourceRequest { } /// Address of a smart contract instance. -struct Concordium_V2_ContractAddress { +struct Concordium_V2_ContractAddress: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2519,7 +2410,7 @@ struct Concordium_V2_ContractAddress { } /// Request for getting information about a smart contract instance. -struct Concordium_V2_InstanceInfoRequest { +struct Concordium_V2_InstanceInfoRequest: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2553,7 +2444,7 @@ struct Concordium_V2_InstanceInfoRequest { } /// Information about a smart contract instance. -struct Concordium_V2_InstanceInfo { +struct Concordium_V2_InstanceInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2580,32 +2471,14 @@ struct Concordium_V2_InstanceInfo { var unknownFields = SwiftProtobuf.UnknownStorage() /// The information depends on the smart contract version used by the instance. - enum OneOf_Version: Equatable { + enum OneOf_Version: Equatable, Sendable { case v0(Concordium_V2_InstanceInfo.V0) case v1(Concordium_V2_InstanceInfo.V1) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_InstanceInfo.OneOf_Version, rhs: Concordium_V2_InstanceInfo.OneOf_Version) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.v0, .v0): return { - guard case .v0(let l) = lhs, case .v0(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.v1, .v1): return { - guard case .v1(let l) = lhs, case .v1(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// Version 0 smart contract instance information. - struct V0 { + struct V0: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2675,7 +2548,7 @@ struct Concordium_V2_InstanceInfo { } /// Version 1 smart contract instance information. - struct V1 { + struct V1: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2737,7 +2610,7 @@ struct Concordium_V2_InstanceInfo { } /// A smart contract instance key-value pair. -struct Concordium_V2_InstanceStateKVPair { +struct Concordium_V2_InstanceStateKVPair: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2752,7 +2625,7 @@ struct Concordium_V2_InstanceStateKVPair { } /// Request for a specific key of a smart contract instance state. -struct Concordium_V2_InstanceStateLookupRequest { +struct Concordium_V2_InstanceStateLookupRequest: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2790,7 +2663,7 @@ struct Concordium_V2_InstanceStateLookupRequest { /// Value at the requested key of a smart contract instance state. For V0 /// contracts this will always be the entire state of the contract. -struct Concordium_V2_InstanceStateValueAtKey { +struct Concordium_V2_InstanceStateValueAtKey: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2805,7 +2678,7 @@ struct Concordium_V2_InstanceStateValueAtKey { /// The receive name of a smart contract function. Expected format: /// `.`. It must only consist of atmost 100 ASCII /// alphanumeric or punctuation characters, and must contain a '.'. -struct Concordium_V2_ReceiveName { +struct Concordium_V2_ReceiveName: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2821,7 +2694,7 @@ struct Concordium_V2_ReceiveName { /// `init_`. It must only consist of atmost 100 ASCII alphanumeric /// or punctuation characters, must not contain a '.' and must start with /// 'init_'. -struct Concordium_V2_InitName { +struct Concordium_V2_InitName: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2834,7 +2707,7 @@ struct Concordium_V2_InitName { } /// Parameter to a smart contract initialization or invocation. -struct Concordium_V2_Parameter { +struct Concordium_V2_Parameter: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2847,7 +2720,7 @@ struct Concordium_V2_Parameter { } /// A smart contract v0 state. -struct Concordium_V2_ContractStateV0 { +struct Concordium_V2_ContractStateV0: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2860,7 +2733,7 @@ struct Concordium_V2_ContractStateV0 { } /// Status of a block item known to the node. -struct Concordium_V2_BlockItemStatus { +struct Concordium_V2_BlockItemStatus: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2899,7 +2772,7 @@ struct Concordium_V2_BlockItemStatus { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Status: Equatable { + enum OneOf_Status: Equatable, Sendable { /// Block item is received, but not yet in any blocks. case received(Concordium_V2_Empty) /// Block item is committed to one or more blocks. The outcomes are listed @@ -2910,31 +2783,9 @@ struct Concordium_V2_BlockItemStatus { /// Block item is finalized in the given block, with the given summary. case finalized(Concordium_V2_BlockItemStatus.Finalized) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_BlockItemStatus.OneOf_Status, rhs: Concordium_V2_BlockItemStatus.OneOf_Status) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.received, .received): return { - guard case .received(let l) = lhs, case .received(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.committed, .committed): return { - guard case .committed(let l) = lhs, case .committed(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.finalized, .finalized): return { - guard case .finalized(let l) = lhs, case .finalized(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } - struct Committed { + struct Committed: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2946,7 +2797,7 @@ struct Concordium_V2_BlockItemStatus { init() {} } - struct Finalized { + struct Finalized: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -2971,7 +2822,7 @@ struct Concordium_V2_BlockItemStatus { } /// A block item summary together with a block hash. Used in BlockItemStatus. -struct Concordium_V2_BlockItemSummaryInBlock { +struct Concordium_V2_BlockItemSummaryInBlock: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -3006,7 +2857,7 @@ struct Concordium_V2_BlockItemSummaryInBlock { /// Energy is used to count exact execution cost. /// This cost is then converted to CCD amounts. -struct Concordium_V2_Energy { +struct Concordium_V2_Energy: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -3019,7 +2870,7 @@ struct Concordium_V2_Energy { } /// A number representing a slot for baking a block. -struct Concordium_V2_Slot { +struct Concordium_V2_Slot: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -3032,7 +2883,7 @@ struct Concordium_V2_Slot { } /// The response for getNextAccountSequenceNumber. -struct Concordium_V2_NextAccountSequenceNumber { +struct Concordium_V2_NextAccountSequenceNumber: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -3058,7 +2909,7 @@ struct Concordium_V2_NextAccountSequenceNumber { } /// A duration of milliseconds. -struct Concordium_V2_Duration { +struct Concordium_V2_Duration: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -3073,7 +2924,7 @@ struct Concordium_V2_Duration { /// A reason for why a transaction was rejected. Rejected means included in a /// block, but the desired action was not achieved. The only effect of a /// rejected transaction is payment. -struct Concordium_V2_RejectReason { +struct Concordium_V2_RejectReason: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -3587,7 +3438,7 @@ struct Concordium_V2_RejectReason { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Reason: Equatable { + enum OneOf_Reason: Equatable, Sendable { /// Raised while validating a Wasm module that is not well formed. case moduleNotWf(Concordium_V2_Empty) /// The smart contract module hash already exists. @@ -3716,235 +3567,9 @@ struct Concordium_V2_RejectReason { /// The pool is not open to delegators. case poolClosed(Concordium_V2_Empty) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_RejectReason.OneOf_Reason, rhs: Concordium_V2_RejectReason.OneOf_Reason) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.moduleNotWf, .moduleNotWf): return { - guard case .moduleNotWf(let l) = lhs, case .moduleNotWf(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.moduleHashAlreadyExists, .moduleHashAlreadyExists): return { - guard case .moduleHashAlreadyExists(let l) = lhs, case .moduleHashAlreadyExists(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.invalidAccountReference, .invalidAccountReference): return { - guard case .invalidAccountReference(let l) = lhs, case .invalidAccountReference(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.invalidInitMethod, .invalidInitMethod): return { - guard case .invalidInitMethod(let l) = lhs, case .invalidInitMethod(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.invalidReceiveMethod, .invalidReceiveMethod): return { - guard case .invalidReceiveMethod(let l) = lhs, case .invalidReceiveMethod(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.invalidModuleReference, .invalidModuleReference): return { - guard case .invalidModuleReference(let l) = lhs, case .invalidModuleReference(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.invalidContractAddress, .invalidContractAddress): return { - guard case .invalidContractAddress(let l) = lhs, case .invalidContractAddress(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.runtimeFailure, .runtimeFailure): return { - guard case .runtimeFailure(let l) = lhs, case .runtimeFailure(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.amountTooLarge, .amountTooLarge): return { - guard case .amountTooLarge(let l) = lhs, case .amountTooLarge(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.serializationFailure, .serializationFailure): return { - guard case .serializationFailure(let l) = lhs, case .serializationFailure(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.outOfEnergy, .outOfEnergy): return { - guard case .outOfEnergy(let l) = lhs, case .outOfEnergy(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.rejectedInit, .rejectedInit): return { - guard case .rejectedInit(let l) = lhs, case .rejectedInit(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.rejectedReceive, .rejectedReceive): return { - guard case .rejectedReceive(let l) = lhs, case .rejectedReceive(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.invalidProof, .invalidProof): return { - guard case .invalidProof(let l) = lhs, case .invalidProof(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.alreadyABaker, .alreadyABaker): return { - guard case .alreadyABaker(let l) = lhs, case .alreadyABaker(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.notABaker, .notABaker): return { - guard case .notABaker(let l) = lhs, case .notABaker(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.insufficientBalanceForBakerStake, .insufficientBalanceForBakerStake): return { - guard case .insufficientBalanceForBakerStake(let l) = lhs, case .insufficientBalanceForBakerStake(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.stakeUnderMinimumThresholdForBaking, .stakeUnderMinimumThresholdForBaking): return { - guard case .stakeUnderMinimumThresholdForBaking(let l) = lhs, case .stakeUnderMinimumThresholdForBaking(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerInCooldown, .bakerInCooldown): return { - guard case .bakerInCooldown(let l) = lhs, case .bakerInCooldown(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.duplicateAggregationKey, .duplicateAggregationKey): return { - guard case .duplicateAggregationKey(let l) = lhs, case .duplicateAggregationKey(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.nonExistentCredentialID, .nonExistentCredentialID): return { - guard case .nonExistentCredentialID(let l) = lhs, case .nonExistentCredentialID(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.keyIndexAlreadyInUse, .keyIndexAlreadyInUse): return { - guard case .keyIndexAlreadyInUse(let l) = lhs, case .keyIndexAlreadyInUse(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.invalidAccountThreshold, .invalidAccountThreshold): return { - guard case .invalidAccountThreshold(let l) = lhs, case .invalidAccountThreshold(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.invalidCredentialKeySignThreshold, .invalidCredentialKeySignThreshold): return { - guard case .invalidCredentialKeySignThreshold(let l) = lhs, case .invalidCredentialKeySignThreshold(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.invalidEncryptedAmountTransferProof, .invalidEncryptedAmountTransferProof): return { - guard case .invalidEncryptedAmountTransferProof(let l) = lhs, case .invalidEncryptedAmountTransferProof(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.invalidTransferToPublicProof, .invalidTransferToPublicProof): return { - guard case .invalidTransferToPublicProof(let l) = lhs, case .invalidTransferToPublicProof(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.encryptedAmountSelfTransfer, .encryptedAmountSelfTransfer): return { - guard case .encryptedAmountSelfTransfer(let l) = lhs, case .encryptedAmountSelfTransfer(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.invalidIndexOnEncryptedTransfer, .invalidIndexOnEncryptedTransfer): return { - guard case .invalidIndexOnEncryptedTransfer(let l) = lhs, case .invalidIndexOnEncryptedTransfer(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.zeroScheduledAmount, .zeroScheduledAmount): return { - guard case .zeroScheduledAmount(let l) = lhs, case .zeroScheduledAmount(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.nonIncreasingSchedule, .nonIncreasingSchedule): return { - guard case .nonIncreasingSchedule(let l) = lhs, case .nonIncreasingSchedule(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.firstScheduledReleaseExpired, .firstScheduledReleaseExpired): return { - guard case .firstScheduledReleaseExpired(let l) = lhs, case .firstScheduledReleaseExpired(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.scheduledSelfTransfer, .scheduledSelfTransfer): return { - guard case .scheduledSelfTransfer(let l) = lhs, case .scheduledSelfTransfer(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.invalidCredentials, .invalidCredentials): return { - guard case .invalidCredentials(let l) = lhs, case .invalidCredentials(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.duplicateCredIds, .duplicateCredIds): return { - guard case .duplicateCredIds(let l) = lhs, case .duplicateCredIds(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.nonExistentCredIds, .nonExistentCredIds): return { - guard case .nonExistentCredIds(let l) = lhs, case .nonExistentCredIds(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.removeFirstCredential, .removeFirstCredential): return { - guard case .removeFirstCredential(let l) = lhs, case .removeFirstCredential(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.credentialHolderDidNotSign, .credentialHolderDidNotSign): return { - guard case .credentialHolderDidNotSign(let l) = lhs, case .credentialHolderDidNotSign(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.notAllowedMultipleCredentials, .notAllowedMultipleCredentials): return { - guard case .notAllowedMultipleCredentials(let l) = lhs, case .notAllowedMultipleCredentials(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.notAllowedToReceiveEncrypted, .notAllowedToReceiveEncrypted): return { - guard case .notAllowedToReceiveEncrypted(let l) = lhs, case .notAllowedToReceiveEncrypted(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.notAllowedToHandleEncrypted, .notAllowedToHandleEncrypted): return { - guard case .notAllowedToHandleEncrypted(let l) = lhs, case .notAllowedToHandleEncrypted(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.missingBakerAddParameters, .missingBakerAddParameters): return { - guard case .missingBakerAddParameters(let l) = lhs, case .missingBakerAddParameters(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.finalizationRewardCommissionNotInRange, .finalizationRewardCommissionNotInRange): return { - guard case .finalizationRewardCommissionNotInRange(let l) = lhs, case .finalizationRewardCommissionNotInRange(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakingRewardCommissionNotInRange, .bakingRewardCommissionNotInRange): return { - guard case .bakingRewardCommissionNotInRange(let l) = lhs, case .bakingRewardCommissionNotInRange(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.transactionFeeCommissionNotInRange, .transactionFeeCommissionNotInRange): return { - guard case .transactionFeeCommissionNotInRange(let l) = lhs, case .transactionFeeCommissionNotInRange(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.alreadyADelegator, .alreadyADelegator): return { - guard case .alreadyADelegator(let l) = lhs, case .alreadyADelegator(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.insufficientBalanceForDelegationStake, .insufficientBalanceForDelegationStake): return { - guard case .insufficientBalanceForDelegationStake(let l) = lhs, case .insufficientBalanceForDelegationStake(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.missingDelegationAddParameters, .missingDelegationAddParameters): return { - guard case .missingDelegationAddParameters(let l) = lhs, case .missingDelegationAddParameters(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.insufficientDelegationStake, .insufficientDelegationStake): return { - guard case .insufficientDelegationStake(let l) = lhs, case .insufficientDelegationStake(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.delegatorInCooldown, .delegatorInCooldown): return { - guard case .delegatorInCooldown(let l) = lhs, case .delegatorInCooldown(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.notADelegator, .notADelegator): return { - guard case .notADelegator(let l) = lhs, case .notADelegator(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.delegationTargetNotABaker, .delegationTargetNotABaker): return { - guard case .delegationTargetNotABaker(let l) = lhs, case .delegationTargetNotABaker(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.stakeOverMaximumThresholdForPool, .stakeOverMaximumThresholdForPool): return { - guard case .stakeOverMaximumThresholdForPool(let l) = lhs, case .stakeOverMaximumThresholdForPool(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.poolWouldBecomeOverDelegated, .poolWouldBecomeOverDelegated): return { - guard case .poolWouldBecomeOverDelegated(let l) = lhs, case .poolWouldBecomeOverDelegated(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.poolClosed, .poolClosed): return { - guard case .poolClosed(let l) = lhs, case .poolClosed(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } - struct InvalidInitMethod { + struct InvalidInitMethod: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -3975,7 +3600,7 @@ struct Concordium_V2_RejectReason { fileprivate var _initName: Concordium_V2_InitName? = nil } - struct InvalidReceiveMethod { + struct InvalidReceiveMethod: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4006,7 +3631,7 @@ struct Concordium_V2_RejectReason { fileprivate var _receiveName: Concordium_V2_ReceiveName? = nil } - struct AmountTooLarge { + struct AmountTooLarge: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4037,7 +3662,7 @@ struct Concordium_V2_RejectReason { fileprivate var _amount: Concordium_V2_Amount? = nil } - struct RejectedInit { + struct RejectedInit: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4049,7 +3674,7 @@ struct Concordium_V2_RejectReason { init() {} } - struct RejectedReceive { + struct RejectedReceive: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4092,7 +3717,7 @@ struct Concordium_V2_RejectReason { fileprivate var _parameter: Concordium_V2_Parameter? = nil } - struct DuplicateCredIds { + struct DuplicateCredIds: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4104,7 +3729,7 @@ struct Concordium_V2_RejectReason { init() {} } - struct NonExistentCredIds { + struct NonExistentCredIds: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4120,7 +3745,7 @@ struct Concordium_V2_RejectReason { } /// Data generated as part of initializing a single contract instance. -struct Concordium_V2_ContractInitializedEvent { +struct Concordium_V2_ContractInitializedEvent: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4182,7 +3807,7 @@ struct Concordium_V2_ContractInitializedEvent { } /// An event generated by a smart contract. -struct Concordium_V2_ContractEvent { +struct Concordium_V2_ContractEvent: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4197,7 +3822,7 @@ struct Concordium_V2_ContractEvent { /// Data generated as part of updating a single contract instance. /// In general a single Update transaction will /// generate one or more of these events, together with possibly some transfers. -struct Concordium_V2_InstanceUpdatedEvent { +struct Concordium_V2_InstanceUpdatedEvent: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4272,7 +3897,7 @@ struct Concordium_V2_InstanceUpdatedEvent { /// Effects produced by successful smart contract invocations. /// A single invocation will produce a sequence of these effects. -struct Concordium_V2_ContractTraceElement { +struct Concordium_V2_ContractTraceElement: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4327,7 +3952,7 @@ struct Concordium_V2_ContractTraceElement { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Element: Equatable { + enum OneOf_Element: Equatable, Sendable { /// A contract instance was updated. case updated(Concordium_V2_InstanceUpdatedEvent) /// A contract transferred an amount to an account. @@ -4340,40 +3965,10 @@ struct Concordium_V2_ContractTraceElement { /// A contract was upgraded. case upgraded(Concordium_V2_ContractTraceElement.Upgraded) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_ContractTraceElement.OneOf_Element, rhs: Concordium_V2_ContractTraceElement.OneOf_Element) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.updated, .updated): return { - guard case .updated(let l) = lhs, case .updated(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.transferred, .transferred): return { - guard case .transferred(let l) = lhs, case .transferred(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.interrupted, .interrupted): return { - guard case .interrupted(let l) = lhs, case .interrupted(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.resumed, .resumed): return { - guard case .resumed(let l) = lhs, case .resumed(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.upgraded, .upgraded): return { - guard case .upgraded(let l) = lhs, case .upgraded(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// A contract transferred an amount to an account. - struct Transferred { + struct Transferred: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4419,7 +4014,7 @@ struct Concordium_V2_ContractTraceElement { /// A contract was interrupted. /// This occurs when a contract invokes another contract or makes a transfer to an account. - struct Interrupted { + struct Interrupted: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4445,7 +4040,7 @@ struct Concordium_V2_ContractTraceElement { } /// A previously interrupted contract was resumed. - struct Resumed { + struct Resumed: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4471,7 +4066,7 @@ struct Concordium_V2_ContractTraceElement { } /// A previously interrupted contract was resumed. - struct Upgraded { + struct Upgraded: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4519,7 +4114,7 @@ struct Concordium_V2_ContractTraceElement { } /// Result of a successful change of baker keys. -struct Concordium_V2_BakerKeysEvent { +struct Concordium_V2_BakerKeysEvent: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4587,7 +4182,7 @@ struct Concordium_V2_BakerKeysEvent { } /// A memo which can be included as part of a transfer. Max size is 256 bytes. -struct Concordium_V2_Memo { +struct Concordium_V2_Memo: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4599,7 +4194,7 @@ struct Concordium_V2_Memo { init() {} } -struct Concordium_V2_BakerStakeUpdatedData { +struct Concordium_V2_BakerStakeUpdatedData: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4637,7 +4232,7 @@ struct Concordium_V2_BakerStakeUpdatedData { } /// Event generated when one or more encrypted amounts are consumed from the account. -struct Concordium_V2_EncryptedAmountRemovedEvent { +struct Concordium_V2_EncryptedAmountRemovedEvent: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4685,7 +4280,7 @@ struct Concordium_V2_EncryptedAmountRemovedEvent { } /// Event generated when an account receives a new encrypted amount. -struct Concordium_V2_NewEncryptedAmountEvent { +struct Concordium_V2_NewEncryptedAmountEvent: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4721,7 +4316,7 @@ struct Concordium_V2_NewEncryptedAmountEvent { fileprivate var _encryptedAmount: Concordium_V2_EncryptedAmount? = nil } -struct Concordium_V2_EncryptedSelfAmountAddedEvent { +struct Concordium_V2_EncryptedSelfAmountAddedEvent: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4766,7 +4361,7 @@ struct Concordium_V2_EncryptedSelfAmountAddedEvent { } /// Data registered on the chain with a register data transaction. -struct Concordium_V2_RegisteredData { +struct Concordium_V2_RegisteredData: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4779,7 +4374,7 @@ struct Concordium_V2_RegisteredData { } /// Events that may result from the ConfigureBaker transaction. -struct Concordium_V2_BakerEvent { +struct Concordium_V2_BakerEvent: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -4885,9 +4480,18 @@ struct Concordium_V2_BakerEvent { set {event = .bakerSetFinalizationRewardCommission(newValue)} } + /// An existing delegator was removed. + var delegationRemoved: Concordium_V2_BakerEvent.DelegationRemoved { + get { + if case .delegationRemoved(let v)? = event {return v} + return Concordium_V2_BakerEvent.DelegationRemoved() + } + set {event = .delegationRemoved(newValue)} + } + var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Event: Equatable { + enum OneOf_Event: Equatable, Sendable { /// A baker was added. case bakerAdded(Concordium_V2_BakerEvent.BakerAdded) /// A baker was removed. @@ -4910,65 +4514,13 @@ struct Concordium_V2_BakerEvent { case bakerSetBakingRewardCommission(Concordium_V2_BakerEvent.BakerSetBakingRewardCommission) /// The baker's finalization reward commission was updated. case bakerSetFinalizationRewardCommission(Concordium_V2_BakerEvent.BakerSetFinalizationRewardCommission) + /// An existing delegator was removed. + case delegationRemoved(Concordium_V2_BakerEvent.DelegationRemoved) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_BakerEvent.OneOf_Event, rhs: Concordium_V2_BakerEvent.OneOf_Event) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.bakerAdded, .bakerAdded): return { - guard case .bakerAdded(let l) = lhs, case .bakerAdded(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerRemoved, .bakerRemoved): return { - guard case .bakerRemoved(let l) = lhs, case .bakerRemoved(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerStakeIncreased, .bakerStakeIncreased): return { - guard case .bakerStakeIncreased(let l) = lhs, case .bakerStakeIncreased(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerStakeDecreased, .bakerStakeDecreased): return { - guard case .bakerStakeDecreased(let l) = lhs, case .bakerStakeDecreased(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerRestakeEarningsUpdated, .bakerRestakeEarningsUpdated): return { - guard case .bakerRestakeEarningsUpdated(let l) = lhs, case .bakerRestakeEarningsUpdated(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerKeysUpdated, .bakerKeysUpdated): return { - guard case .bakerKeysUpdated(let l) = lhs, case .bakerKeysUpdated(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerSetOpenStatus, .bakerSetOpenStatus): return { - guard case .bakerSetOpenStatus(let l) = lhs, case .bakerSetOpenStatus(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerSetMetadataURL, .bakerSetMetadataURL): return { - guard case .bakerSetMetadataURL(let l) = lhs, case .bakerSetMetadataURL(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerSetTransactionFeeCommission, .bakerSetTransactionFeeCommission): return { - guard case .bakerSetTransactionFeeCommission(let l) = lhs, case .bakerSetTransactionFeeCommission(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerSetBakingRewardCommission, .bakerSetBakingRewardCommission): return { - guard case .bakerSetBakingRewardCommission(let l) = lhs, case .bakerSetBakingRewardCommission(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerSetFinalizationRewardCommission, .bakerSetFinalizationRewardCommission): return { - guard case .bakerSetFinalizationRewardCommission(let l) = lhs, case .bakerSetFinalizationRewardCommission(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// A baker was added. - struct BakerAdded { + struct BakerAdded: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5007,7 +4559,7 @@ struct Concordium_V2_BakerEvent { } /// Baker stake increased. - struct BakerStakeIncreased { + struct BakerStakeIncreased: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5040,7 +4592,7 @@ struct Concordium_V2_BakerEvent { fileprivate var _newStake: Concordium_V2_Amount? = nil } - struct BakerStakeDecreased { + struct BakerStakeDecreased: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5073,7 +4625,7 @@ struct Concordium_V2_BakerEvent { fileprivate var _newStake: Concordium_V2_Amount? = nil } - struct BakerRestakeEarningsUpdated { + struct BakerRestakeEarningsUpdated: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5099,7 +4651,7 @@ struct Concordium_V2_BakerEvent { } /// Updated open status for a baker pool. - struct BakerSetOpenStatus { + struct BakerSetOpenStatus: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5125,7 +4677,7 @@ struct Concordium_V2_BakerEvent { } /// Updated metadata url for a baker pool. - struct BakerSetMetadataUrl { + struct BakerSetMetadataUrl: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5151,7 +4703,7 @@ struct Concordium_V2_BakerEvent { } /// Updated transaction fee commission for a baker pool. - struct BakerSetTransactionFeeCommission { + struct BakerSetTransactionFeeCommission: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5185,7 +4737,7 @@ struct Concordium_V2_BakerEvent { } /// Updated baking reward commission for baker pool - struct BakerSetBakingRewardCommission { + struct BakerSetBakingRewardCommission: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5219,7 +4771,7 @@ struct Concordium_V2_BakerEvent { } /// Updated finalization reward commission for baker pool - struct BakerSetFinalizationRewardCommission { + struct BakerSetFinalizationRewardCommission: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5252,11 +4804,34 @@ struct Concordium_V2_BakerEvent { fileprivate var _finalizationRewardCommission: Concordium_V2_AmountFraction? = nil } + /// Removed an existing delegator. + struct DelegationRemoved: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Delegator's id. + var delegatorID: Concordium_V2_DelegatorId { + get {return _delegatorID ?? Concordium_V2_DelegatorId()} + set {_delegatorID = newValue} + } + /// Returns true if `delegatorID` has been explicitly set. + var hasDelegatorID: Bool {return self._delegatorID != nil} + /// Clears the value of `delegatorID`. Subsequent reads from it will return its default value. + mutating func clearDelegatorID() {self._delegatorID = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _delegatorID: Concordium_V2_DelegatorId? = nil + } + init() {} } /// The identifier for a delegator. -struct Concordium_V2_DelegatorId { +struct Concordium_V2_DelegatorId: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5277,7 +4852,7 @@ struct Concordium_V2_DelegatorId { fileprivate var _id: Concordium_V2_AccountIndex? = nil } -struct Concordium_V2_DelegationEvent { +struct Concordium_V2_DelegationEvent: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5338,59 +4913,36 @@ struct Concordium_V2_DelegationEvent { set {event = .delegationRemoved(newValue)} } + /// An existing baker was removed. + var bakerRemoved: Concordium_V2_DelegationEvent.BakerRemoved { + get { + if case .bakerRemoved(let v)? = event {return v} + return Concordium_V2_DelegationEvent.BakerRemoved() + } + set {event = .bakerRemoved(newValue)} + } + var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Event: Equatable { + enum OneOf_Event: Equatable, Sendable { /// The delegator's stake increased. case delegationStakeIncreased(Concordium_V2_DelegationEvent.DelegationStakeIncreased) /// The delegator's stake decreased. - case delegationStakeDecreased(Concordium_V2_DelegationEvent.DelegationStakeDecreased) - /// The delegator's restaking setting was updated. - case delegationSetRestakeEarnings(Concordium_V2_DelegationEvent.DelegationSetRestakeEarnings) - /// The delegator's delegation target was updated. - case delegationSetDelegationTarget(Concordium_V2_DelegationEvent.DelegationSetDelegationTarget) - /// A delegator was added. - case delegationAdded(Concordium_V2_DelegatorId) - /// A delegator was removed. - case delegationRemoved(Concordium_V2_DelegatorId) - - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_DelegationEvent.OneOf_Event, rhs: Concordium_V2_DelegationEvent.OneOf_Event) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.delegationStakeIncreased, .delegationStakeIncreased): return { - guard case .delegationStakeIncreased(let l) = lhs, case .delegationStakeIncreased(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.delegationStakeDecreased, .delegationStakeDecreased): return { - guard case .delegationStakeDecreased(let l) = lhs, case .delegationStakeDecreased(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.delegationSetRestakeEarnings, .delegationSetRestakeEarnings): return { - guard case .delegationSetRestakeEarnings(let l) = lhs, case .delegationSetRestakeEarnings(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.delegationSetDelegationTarget, .delegationSetDelegationTarget): return { - guard case .delegationSetDelegationTarget(let l) = lhs, case .delegationSetDelegationTarget(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.delegationAdded, .delegationAdded): return { - guard case .delegationAdded(let l) = lhs, case .delegationAdded(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.delegationRemoved, .delegationRemoved): return { - guard case .delegationRemoved(let l) = lhs, case .delegationRemoved(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif + case delegationStakeDecreased(Concordium_V2_DelegationEvent.DelegationStakeDecreased) + /// The delegator's restaking setting was updated. + case delegationSetRestakeEarnings(Concordium_V2_DelegationEvent.DelegationSetRestakeEarnings) + /// The delegator's delegation target was updated. + case delegationSetDelegationTarget(Concordium_V2_DelegationEvent.DelegationSetDelegationTarget) + /// A delegator was added. + case delegationAdded(Concordium_V2_DelegatorId) + /// A delegator was removed. + case delegationRemoved(Concordium_V2_DelegatorId) + /// An existing baker was removed. + case bakerRemoved(Concordium_V2_DelegationEvent.BakerRemoved) + } - struct DelegationStakeIncreased { + struct DelegationStakeIncreased: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5423,7 +4975,7 @@ struct Concordium_V2_DelegationEvent { fileprivate var _newStake: Concordium_V2_Amount? = nil } - struct DelegationStakeDecreased { + struct DelegationStakeDecreased: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5456,7 +5008,7 @@ struct Concordium_V2_DelegationEvent { fileprivate var _newStake: Concordium_V2_Amount? = nil } - struct DelegationSetRestakeEarnings { + struct DelegationSetRestakeEarnings: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5481,7 +5033,7 @@ struct Concordium_V2_DelegationEvent { fileprivate var _delegatorID: Concordium_V2_DelegatorId? = nil } - struct DelegationSetDelegationTarget { + struct DelegationSetDelegationTarget: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5514,12 +5066,34 @@ struct Concordium_V2_DelegationEvent { fileprivate var _delegationTarget: Concordium_V2_DelegationTarget? = nil } + struct BakerRemoved: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Baker's id + var bakerID: Concordium_V2_BakerId { + get {return _bakerID ?? Concordium_V2_BakerId()} + set {_bakerID = newValue} + } + /// Returns true if `bakerID` has been explicitly set. + var hasBakerID: Bool {return self._bakerID != nil} + /// Clears the value of `bakerID`. Subsequent reads from it will return its default value. + mutating func clearBakerID() {self._bakerID = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _bakerID: Concordium_V2_BakerId? = nil + } + init() {} } /// Effects of an account transaction. All variants except `None` /// correspond to a unique transaction that was successful. -struct Concordium_V2_AccountTransactionEffects { +struct Concordium_V2_AccountTransactionEffects: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5701,7 +5275,7 @@ struct Concordium_V2_AccountTransactionEffects { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Effect: Equatable { + enum OneOf_Effect: Equatable, Sendable { /// No effects other than payment from this transaction. /// The rejection reason indicates why the transaction failed. case none(Concordium_V2_AccountTransactionEffects.None) @@ -5743,97 +5317,11 @@ struct Concordium_V2_AccountTransactionEffects { /// A delegator was configured. The details of what happened are contained in a list of DelegatorEvents. case delegationConfigured(Concordium_V2_AccountTransactionEffects.DelegationConfigured) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_AccountTransactionEffects.OneOf_Effect, rhs: Concordium_V2_AccountTransactionEffects.OneOf_Effect) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.none, .none): return { - guard case .none(let l) = lhs, case .none(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.moduleDeployed, .moduleDeployed): return { - guard case .moduleDeployed(let l) = lhs, case .moduleDeployed(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.contractInitialized, .contractInitialized): return { - guard case .contractInitialized(let l) = lhs, case .contractInitialized(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.contractUpdateIssued, .contractUpdateIssued): return { - guard case .contractUpdateIssued(let l) = lhs, case .contractUpdateIssued(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.accountTransfer, .accountTransfer): return { - guard case .accountTransfer(let l) = lhs, case .accountTransfer(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerAdded, .bakerAdded): return { - guard case .bakerAdded(let l) = lhs, case .bakerAdded(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerRemoved, .bakerRemoved): return { - guard case .bakerRemoved(let l) = lhs, case .bakerRemoved(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerStakeUpdated, .bakerStakeUpdated): return { - guard case .bakerStakeUpdated(let l) = lhs, case .bakerStakeUpdated(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerRestakeEarningsUpdated, .bakerRestakeEarningsUpdated): return { - guard case .bakerRestakeEarningsUpdated(let l) = lhs, case .bakerRestakeEarningsUpdated(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerKeysUpdated, .bakerKeysUpdated): return { - guard case .bakerKeysUpdated(let l) = lhs, case .bakerKeysUpdated(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.encryptedAmountTransferred, .encryptedAmountTransferred): return { - guard case .encryptedAmountTransferred(let l) = lhs, case .encryptedAmountTransferred(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.transferredToEncrypted, .transferredToEncrypted): return { - guard case .transferredToEncrypted(let l) = lhs, case .transferredToEncrypted(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.transferredToPublic, .transferredToPublic): return { - guard case .transferredToPublic(let l) = lhs, case .transferredToPublic(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.transferredWithSchedule, .transferredWithSchedule): return { - guard case .transferredWithSchedule(let l) = lhs, case .transferredWithSchedule(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.credentialKeysUpdated, .credentialKeysUpdated): return { - guard case .credentialKeysUpdated(let l) = lhs, case .credentialKeysUpdated(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.credentialsUpdated, .credentialsUpdated): return { - guard case .credentialsUpdated(let l) = lhs, case .credentialsUpdated(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.dataRegistered, .dataRegistered): return { - guard case .dataRegistered(let l) = lhs, case .dataRegistered(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerConfigured, .bakerConfigured): return { - guard case .bakerConfigured(let l) = lhs, case .bakerConfigured(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.delegationConfigured, .delegationConfigured): return { - guard case .delegationConfigured(let l) = lhs, case .delegationConfigured(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// No effects other than payment from this transaction. /// The rejection reason indicates why the transaction failed. - struct None { + struct None: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5869,7 +5357,7 @@ struct Concordium_V2_AccountTransactionEffects { /// A contract update transaction was issued and produced the given trace. /// This is the result of Update transaction. - struct ContractUpdateIssued { + struct ContractUpdateIssued: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5883,7 +5371,7 @@ struct Concordium_V2_AccountTransactionEffects { /// A simple account to account transfer occurred. This is the result of a /// successful Transfer transaction. - struct AccountTransfer { + struct AccountTransfer: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5929,7 +5417,7 @@ struct Concordium_V2_AccountTransactionEffects { /// An account was deregistered as a baker. This is the result of a /// successful UpdateBakerStake transaction. - struct BakerStakeUpdated { + struct BakerStakeUpdated: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5954,7 +5442,7 @@ struct Concordium_V2_AccountTransactionEffects { /// An encrypted amount was transferred. This is the result of a successful /// EncryptedAmountTransfer transaction. - struct EncryptedAmountTransferred { + struct EncryptedAmountTransferred: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -5997,7 +5485,7 @@ struct Concordium_V2_AccountTransactionEffects { /// An account transferred part of its encrypted balance to its public /// balance. This is the result of a successful TransferToPublic transaction. - struct TransferredToPublic { + struct TransferredToPublic: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6030,7 +5518,7 @@ struct Concordium_V2_AccountTransactionEffects { /// A transfer with schedule was performed. This is the result of a /// successful TransferWithSchedule transaction. - struct TransferredWithSchedule { + struct TransferredWithSchedule: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6068,7 +5556,7 @@ struct Concordium_V2_AccountTransactionEffects { /// Account's credentials were updated. This is the result of a /// successful UpdateCredentials transaction. - struct CredentialsUpdated { + struct CredentialsUpdated: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6098,7 +5586,7 @@ struct Concordium_V2_AccountTransactionEffects { /// A baker was configured. The details of what happened are contained in /// the list of BakerEvents. - struct BakerConfigured { + struct BakerConfigured: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6112,7 +5600,7 @@ struct Concordium_V2_AccountTransactionEffects { /// An account configured delegation. The details of what happened are /// contained in the list of DelegationEvents. - struct DelegationConfigured { + struct DelegationConfigured: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6128,7 +5616,7 @@ struct Concordium_V2_AccountTransactionEffects { } /// Election difficulty parameter. -struct Concordium_V2_ElectionDifficulty { +struct Concordium_V2_ElectionDifficulty: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6150,7 +5638,7 @@ struct Concordium_V2_ElectionDifficulty { } /// Parameters that determine timeouts in the consensus protocol used from protocol version 6. -struct Concordium_V2_TimeoutParameters { +struct Concordium_V2_TimeoutParameters: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6195,7 +5683,7 @@ struct Concordium_V2_TimeoutParameters { } /// Finalization committee parameters used from protocol version 6 -struct Concordium_V2_FinalizationCommitteeParameters { +struct Concordium_V2_FinalizationCommitteeParameters: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6225,7 +5713,7 @@ struct Concordium_V2_FinalizationCommitteeParameters { } /// Parameters for the consensus protocol used from protocol version 6. -struct Concordium_V2_ConsensusParametersV1 { +struct Concordium_V2_ConsensusParametersV1: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6270,7 +5758,7 @@ struct Concordium_V2_ConsensusParametersV1 { } /// Represents an exchange rate. -struct Concordium_V2_ExchangeRate { +struct Concordium_V2_ExchangeRate: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6292,7 +5780,7 @@ struct Concordium_V2_ExchangeRate { } /// Represents a ratio, i.e., 'numerator / denominator'. -struct Concordium_V2_Ratio { +struct Concordium_V2_Ratio: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6309,7 +5797,7 @@ struct Concordium_V2_Ratio { } /// A public key used for chain updates. -struct Concordium_V2_UpdatePublicKey { +struct Concordium_V2_UpdatePublicKey: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6322,7 +5810,7 @@ struct Concordium_V2_UpdatePublicKey { } /// The threshold for how many UpdatePublicKeys are need to make a certain chain update. -struct Concordium_V2_UpdateKeysThreshold { +struct Concordium_V2_UpdateKeysThreshold: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6336,7 +5824,7 @@ struct Concordium_V2_UpdateKeysThreshold { } /// Index of a key in an authorizations update payload. -struct Concordium_V2_UpdateKeysIndex { +struct Concordium_V2_UpdateKeysIndex: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6349,7 +5837,7 @@ struct Concordium_V2_UpdateKeysIndex { } /// Represents root or level 1 keys. -struct Concordium_V2_HigherLevelKeys { +struct Concordium_V2_HigherLevelKeys: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6377,7 +5865,7 @@ struct Concordium_V2_HigherLevelKeys { /// An access structure which specifies which UpdatePublicKeys in a HigherLevelKeys that are allowed /// to make chain update of a specific type. The threshold defines the minimum number of allowed keys needed /// to make the actual update. -struct Concordium_V2_AccessStructure { +struct Concordium_V2_AccessStructure: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6405,7 +5893,7 @@ struct Concordium_V2_AccessStructure { /// The set of keys authorized for chain updates, together with access structures /// determining which keys are authorized for which update types. /// This is the payload of an update to authorization. -struct Concordium_V2_AuthorizationsV0 { +struct Concordium_V2_AuthorizationsV0: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6548,7 +6036,7 @@ struct Concordium_V2_AuthorizationsV0 { /// The set of keys authorized for chain updates, together with access structures /// determining which keys are authorized for which update types. /// This is the payload of an update to authorization. -struct Concordium_V2_AuthorizationsV1 { +struct Concordium_V2_AuthorizationsV1: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6593,7 +6081,7 @@ struct Concordium_V2_AuthorizationsV1 { /// Description either of an anonymity revoker or identity provider. /// Metadata that should be visible on the chain. -struct Concordium_V2_Description { +struct Concordium_V2_Description: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6614,7 +6102,7 @@ struct Concordium_V2_Description { /// Information on a single anonymity revoker help by the identity provider. /// Typically an identity provider will hold more than one. -struct Concordium_V2_ArInfo { +struct Concordium_V2_ArInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6653,7 +6141,7 @@ struct Concordium_V2_ArInfo { /// Identity of the anonymity revoker on the chain. This defines their /// evaluateion point for secret sharing, and thus it cannot be 0. - struct ArIdentity { + struct ArIdentity: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6666,7 +6154,7 @@ struct Concordium_V2_ArInfo { } /// Public key of an anonymity revoker. - struct ArPublicKey { + struct ArPublicKey: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6688,7 +6176,7 @@ struct Concordium_V2_ArInfo { /// A succinct identifier of an identity provider on the chain. /// In credential deployments, and other interactions with the chain this is /// used to identify which identity provider is meant. -struct Concordium_V2_IpIdentity { +struct Concordium_V2_IpIdentity: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6701,7 +6189,7 @@ struct Concordium_V2_IpIdentity { } /// Public information about an identity provider. -struct Concordium_V2_IpInfo { +struct Concordium_V2_IpInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6749,7 +6237,7 @@ struct Concordium_V2_IpInfo { var unknownFields = SwiftProtobuf.UnknownStorage() /// Pointcheval-Sanders public key of the identity provider. - struct IpVerifyKey { + struct IpVerifyKey: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6762,7 +6250,7 @@ struct Concordium_V2_IpInfo { } /// Ed25519 public key of the identity provider. - struct IpCdiVerifyKey { + struct IpCdiVerifyKey: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6783,7 +6271,7 @@ struct Concordium_V2_IpInfo { } /// A duration in seconds. -struct Concordium_V2_DurationSeconds { +struct Concordium_V2_DurationSeconds: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6796,7 +6284,7 @@ struct Concordium_V2_DurationSeconds { } /// Inclusive range of amount fractions. -struct Concordium_V2_InclusiveRangeAmountFraction { +struct Concordium_V2_InclusiveRangeAmountFraction: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6828,7 +6316,7 @@ struct Concordium_V2_InclusiveRangeAmountFraction { } /// Ranges of allowed commission values that pools may choose from. -struct Concordium_V2_CommissionRanges { +struct Concordium_V2_CommissionRanges: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6874,7 +6362,7 @@ struct Concordium_V2_CommissionRanges { /// A bound on the relative share of the total staked capital that a baker can /// have as its stake. This is required to be greater than 0. -struct Concordium_V2_CapitalBound { +struct Concordium_V2_CapitalBound: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6896,7 +6384,7 @@ struct Concordium_V2_CapitalBound { } /// A leverage factor. -struct Concordium_V2_LeverageFactor { +struct Concordium_V2_LeverageFactor: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6918,7 +6406,7 @@ struct Concordium_V2_LeverageFactor { } /// A chain epoch. -struct Concordium_V2_Epoch { +struct Concordium_V2_Epoch: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6931,7 +6419,7 @@ struct Concordium_V2_Epoch { } /// A round. -struct Concordium_V2_Round { +struct Concordium_V2_Round: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6945,7 +6433,7 @@ struct Concordium_V2_Round { /// Length of a reward period in epochs. /// Must always be a strictly positive number. -struct Concordium_V2_RewardPeriodLength { +struct Concordium_V2_RewardPeriodLength: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6968,7 +6456,7 @@ struct Concordium_V2_RewardPeriodLength { /// A minting rate of CCD. /// The value is `mantissa * 10^(-exponent)`. -struct Concordium_V2_MintRate { +struct Concordium_V2_MintRate: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -6983,7 +6471,7 @@ struct Concordium_V2_MintRate { init() {} } -struct Concordium_V2_CooldownParametersCpv1 { +struct Concordium_V2_CooldownParametersCpv1: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -7019,7 +6507,7 @@ struct Concordium_V2_CooldownParametersCpv1 { } /// Parameters related to staking pools. -struct Concordium_V2_PoolParametersCpv1 { +struct Concordium_V2_PoolParametersCpv1: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -7112,7 +6600,7 @@ struct Concordium_V2_PoolParametersCpv1 { /// The time parameters are introduced as of protocol version 4, and consist of /// the reward period length and the mint rate per payday. These are coupled as /// a change to either affects the overall rate of minting. -struct Concordium_V2_TimeParametersCpv1 { +struct Concordium_V2_TimeParametersCpv1: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -7144,7 +6632,7 @@ struct Concordium_V2_TimeParametersCpv1 { } /// Mint distribution payload as it looks in protocol version 4 and onward. -struct Concordium_V2_MintDistributionCpv1 { +struct Concordium_V2_MintDistributionCpv1: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -7175,7 +6663,7 @@ struct Concordium_V2_MintDistributionCpv1 { fileprivate var _finalizationReward: Concordium_V2_AmountFraction? = nil } -struct Concordium_V2_ProtocolUpdate { +struct Concordium_V2_ProtocolUpdate: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -7210,7 +6698,7 @@ struct Concordium_V2_ProtocolUpdate { /// finalizers, and the foundation account. It must be the case that /// baking_reward + finalization_reward <= 1. The remaining amount is the /// platform development charge. -struct Concordium_V2_MintDistributionCpv0 { +struct Concordium_V2_MintDistributionCpv0: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -7255,7 +6743,7 @@ struct Concordium_V2_MintDistributionCpv0 { } /// Parameters determining the distribution of transaction fees. -struct Concordium_V2_TransactionFeeDistribution { +struct Concordium_V2_TransactionFeeDistribution: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -7289,7 +6777,7 @@ struct Concordium_V2_TransactionFeeDistribution { } /// Distribution of gas rewards for chain parameters version 0 and 1. -struct Concordium_V2_GasRewards { +struct Concordium_V2_GasRewards: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -7345,7 +6833,7 @@ struct Concordium_V2_GasRewards { } /// Distribution of gas rewards for chain parameters version 2. -struct Concordium_V2_GasRewardsCpv2 { +struct Concordium_V2_GasRewardsCpv2: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -7391,7 +6879,7 @@ struct Concordium_V2_GasRewardsCpv2 { /// Minimum stake needed to become a baker. This only applies to protocol version /// 1-3. -struct Concordium_V2_BakerStakeThreshold { +struct Concordium_V2_BakerStakeThreshold: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -7415,7 +6903,7 @@ struct Concordium_V2_BakerStakeThreshold { /// Root updates are the highest kind of key updates. They can update every other set of keys, /// even themselves. They can only be performed by Root level keys. -struct Concordium_V2_RootUpdate { +struct Concordium_V2_RootUpdate: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -7460,7 +6948,7 @@ struct Concordium_V2_RootUpdate { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_UpdateType: Equatable { + enum OneOf_UpdateType: Equatable, Sendable { /// The root keys were updated. case rootKeysUpdate(Concordium_V2_HigherLevelKeys) /// The level 1 keys were updated. @@ -7470,32 +6958,6 @@ struct Concordium_V2_RootUpdate { /// The level 2 keys were updated. This is similar to `level_2_keys_update_v0` except that a few more keys can be updated. case level2KeysUpdateV1(Concordium_V2_AuthorizationsV1) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_RootUpdate.OneOf_UpdateType, rhs: Concordium_V2_RootUpdate.OneOf_UpdateType) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.rootKeysUpdate, .rootKeysUpdate): return { - guard case .rootKeysUpdate(let l) = lhs, case .rootKeysUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.level1KeysUpdate, .level1KeysUpdate): return { - guard case .level1KeysUpdate(let l) = lhs, case .level1KeysUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.level2KeysUpdateV0, .level2KeysUpdateV0): return { - guard case .level2KeysUpdateV0(let l) = lhs, case .level2KeysUpdateV0(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.level2KeysUpdateV1, .level2KeysUpdateV1): return { - guard case .level2KeysUpdateV1(let l) = lhs, case .level2KeysUpdateV1(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} @@ -7503,7 +6965,7 @@ struct Concordium_V2_RootUpdate { /// Level 1 updates are the intermediate update kind. /// They can update themselves or level 2 keys. They can only be performed by level 1 keys. -struct Concordium_V2_Level1Update { +struct Concordium_V2_Level1Update: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -7539,7 +7001,7 @@ struct Concordium_V2_Level1Update { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_UpdateType: Equatable { + enum OneOf_UpdateType: Equatable, Sendable { /// The level 1 keys were updated. case level1KeysUpdate(Concordium_V2_HigherLevelKeys) /// The level 2 keys were updated. @@ -7547,35 +7009,13 @@ struct Concordium_V2_Level1Update { /// The level 2 keys were updated. This is similar to `level_2_keys_update_v0` except that a few more keys can be updated. case level2KeysUpdateV1(Concordium_V2_AuthorizationsV1) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_Level1Update.OneOf_UpdateType, rhs: Concordium_V2_Level1Update.OneOf_UpdateType) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.level1KeysUpdate, .level1KeysUpdate): return { - guard case .level1KeysUpdate(let l) = lhs, case .level1KeysUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.level2KeysUpdateV0, .level2KeysUpdateV0): return { - guard case .level2KeysUpdateV0(let l) = lhs, case .level2KeysUpdateV0(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.level2KeysUpdateV1, .level2KeysUpdateV1): return { - guard case .level2KeysUpdateV1(let l) = lhs, case .level2KeysUpdateV1(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} } /// The payload of a chain update. -struct Concordium_V2_UpdatePayload { +struct Concordium_V2_UpdatePayload: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -7782,7 +7222,7 @@ struct Concordium_V2_UpdatePayload { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Payload: Equatable { + enum OneOf_Payload: Equatable, Sendable { /// The protocol version was updated. case protocolUpdate(Concordium_V2_ProtocolUpdate) /// The election difficulty was updated. @@ -7828,111 +7268,13 @@ struct Concordium_V2_UpdatePayload { /// Finalization committee parameters (chain parameters version 2). case finalizationCommitteeParametersUpdate(Concordium_V2_FinalizationCommitteeParameters) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_UpdatePayload.OneOf_Payload, rhs: Concordium_V2_UpdatePayload.OneOf_Payload) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.protocolUpdate, .protocolUpdate): return { - guard case .protocolUpdate(let l) = lhs, case .protocolUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.electionDifficultyUpdate, .electionDifficultyUpdate): return { - guard case .electionDifficultyUpdate(let l) = lhs, case .electionDifficultyUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.euroPerEnergyUpdate, .euroPerEnergyUpdate): return { - guard case .euroPerEnergyUpdate(let l) = lhs, case .euroPerEnergyUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.microCcdPerEuroUpdate, .microCcdPerEuroUpdate): return { - guard case .microCcdPerEuroUpdate(let l) = lhs, case .microCcdPerEuroUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.foundationAccountUpdate, .foundationAccountUpdate): return { - guard case .foundationAccountUpdate(let l) = lhs, case .foundationAccountUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.mintDistributionUpdate, .mintDistributionUpdate): return { - guard case .mintDistributionUpdate(let l) = lhs, case .mintDistributionUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.transactionFeeDistributionUpdate, .transactionFeeDistributionUpdate): return { - guard case .transactionFeeDistributionUpdate(let l) = lhs, case .transactionFeeDistributionUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.gasRewardsUpdate, .gasRewardsUpdate): return { - guard case .gasRewardsUpdate(let l) = lhs, case .gasRewardsUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.bakerStakeThresholdUpdate, .bakerStakeThresholdUpdate): return { - guard case .bakerStakeThresholdUpdate(let l) = lhs, case .bakerStakeThresholdUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.rootUpdate, .rootUpdate): return { - guard case .rootUpdate(let l) = lhs, case .rootUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.level1Update, .level1Update): return { - guard case .level1Update(let l) = lhs, case .level1Update(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.addAnonymityRevokerUpdate, .addAnonymityRevokerUpdate): return { - guard case .addAnonymityRevokerUpdate(let l) = lhs, case .addAnonymityRevokerUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.addIdentityProviderUpdate, .addIdentityProviderUpdate): return { - guard case .addIdentityProviderUpdate(let l) = lhs, case .addIdentityProviderUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.cooldownParametersCpv1Update, .cooldownParametersCpv1Update): return { - guard case .cooldownParametersCpv1Update(let l) = lhs, case .cooldownParametersCpv1Update(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.poolParametersCpv1Update, .poolParametersCpv1Update): return { - guard case .poolParametersCpv1Update(let l) = lhs, case .poolParametersCpv1Update(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.timeParametersCpv1Update, .timeParametersCpv1Update): return { - guard case .timeParametersCpv1Update(let l) = lhs, case .timeParametersCpv1Update(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.mintDistributionCpv1Update, .mintDistributionCpv1Update): return { - guard case .mintDistributionCpv1Update(let l) = lhs, case .mintDistributionCpv1Update(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.gasRewardsCpv2Update, .gasRewardsCpv2Update): return { - guard case .gasRewardsCpv2Update(let l) = lhs, case .gasRewardsCpv2Update(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.timeoutParametersUpdate, .timeoutParametersUpdate): return { - guard case .timeoutParametersUpdate(let l) = lhs, case .timeoutParametersUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.minBlockTimeUpdate, .minBlockTimeUpdate): return { - guard case .minBlockTimeUpdate(let l) = lhs, case .minBlockTimeUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.blockEnergyLimitUpdate, .blockEnergyLimitUpdate): return { - guard case .blockEnergyLimitUpdate(let l) = lhs, case .blockEnergyLimitUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.finalizationCommitteeParametersUpdate, .finalizationCommitteeParametersUpdate): return { - guard case .finalizationCommitteeParametersUpdate(let l) = lhs, case .finalizationCommitteeParametersUpdate(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} } /// Details about an account transaction. -struct Concordium_V2_AccountTransactionDetails { +struct Concordium_V2_AccountTransactionDetails: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -7979,7 +7321,7 @@ struct Concordium_V2_AccountTransactionDetails { /// Details of an account creation. These transactions are free, and we only /// ever get a response for them if the account is created, hence no failure /// cases. -struct Concordium_V2_AccountCreationDetails { +struct Concordium_V2_AccountCreationDetails: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -8016,7 +7358,7 @@ struct Concordium_V2_AccountCreationDetails { } /// Transaction time specified as seconds since unix epoch. -struct Concordium_V2_TransactionTime { +struct Concordium_V2_TransactionTime: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -8031,7 +7373,7 @@ struct Concordium_V2_TransactionTime { /// Details of an update instruction. These are free, and we only ever get a /// response for them if the update is successfully enqueued, hence no failure /// cases. -struct Concordium_V2_UpdateDetails { +struct Concordium_V2_UpdateDetails: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -8066,7 +7408,7 @@ struct Concordium_V2_UpdateDetails { /// Summary of the outcome of a block item in structured form. /// The summary determines which transaction type it was. -struct Concordium_V2_BlockItemSummary { +struct Concordium_V2_BlockItemSummary: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -8137,7 +7479,7 @@ struct Concordium_V2_BlockItemSummary { var unknownFields = SwiftProtobuf.UnknownStorage() /// Details that are specific to different transaction types. - enum OneOf_Details: Equatable { + enum OneOf_Details: Equatable, Sendable { /// Details about an account transaction. case accountTransaction(Concordium_V2_AccountTransactionDetails) /// Details about an account creation. @@ -8145,31 +7487,9 @@ struct Concordium_V2_BlockItemSummary { /// Details about a chain update. case update(Concordium_V2_UpdateDetails) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_BlockItemSummary.OneOf_Details, rhs: Concordium_V2_BlockItemSummary.OneOf_Details) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.accountTransaction, .accountTransaction): return { - guard case .accountTransaction(let l) = lhs, case .accountTransaction(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.accountCreation, .accountCreation): return { - guard case .accountCreation(let l) = lhs, case .accountCreation(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.update, .update): return { - guard case .update(let l) = lhs, case .update(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } - struct TransactionIndex { + struct TransactionIndex: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -8190,7 +7510,7 @@ struct Concordium_V2_BlockItemSummary { /// protocol update instruction might not change the protocol version /// specified in the previous field, but it always increments the genesis /// index. -struct Concordium_V2_GenesisIndex { +struct Concordium_V2_GenesisIndex: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -8203,7 +7523,7 @@ struct Concordium_V2_GenesisIndex { } /// The response for GetConsensusInfo. -struct Concordium_V2_ConsensusInfo { +struct Concordium_V2_ConsensusInfo: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -8521,7 +7841,7 @@ struct Concordium_V2_ConsensusInfo { } /// Information about an arrived block that is part of the streaming response. -struct Concordium_V2_ArrivedBlockInfo { +struct Concordium_V2_ArrivedBlockInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -8555,7 +7875,7 @@ struct Concordium_V2_ArrivedBlockInfo { } /// The response for GetCryptographicParameters. -struct Concordium_V2_CryptographicParameters { +struct Concordium_V2_CryptographicParameters: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -8578,7 +7898,7 @@ struct Concordium_V2_CryptographicParameters { } /// The response for GetBlockInfo. -struct Concordium_V2_BlockInfo { +struct Concordium_V2_BlockInfo: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -8767,7 +8087,7 @@ struct Concordium_V2_BlockInfo { } /// Request for GetPoolInfo. -struct Concordium_V2_PoolInfoRequest { +struct Concordium_V2_PoolInfoRequest: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -8801,7 +8121,7 @@ struct Concordium_V2_PoolInfoRequest { } /// A pending change to a baker pool. -struct Concordium_V2_PoolPendingChange { +struct Concordium_V2_PoolPendingChange: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -8826,32 +8146,14 @@ struct Concordium_V2_PoolPendingChange { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Change: Equatable { + enum OneOf_Change: Equatable, Sendable { case reduce(Concordium_V2_PoolPendingChange.Reduce) case remove(Concordium_V2_PoolPendingChange.Remove) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_PoolPendingChange.OneOf_Change, rhs: Concordium_V2_PoolPendingChange.OneOf_Change) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.reduce, .reduce): return { - guard case .reduce(let l) = lhs, case .reduce(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.remove, .remove): return { - guard case .remove(let l) = lhs, case .remove(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// A reduction in baker equity capital is pending. - struct Reduce { + struct Reduce: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -8885,7 +8187,7 @@ struct Concordium_V2_PoolPendingChange { } /// Removal of the pool is pending. - struct Remove { + struct Remove: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -8911,7 +8213,7 @@ struct Concordium_V2_PoolPendingChange { } /// Information about a baker pool in the current reward period. -struct Concordium_V2_PoolCurrentPaydayInfo { +struct Concordium_V2_PoolCurrentPaydayInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -8988,7 +8290,13 @@ struct Concordium_V2_PoolCurrentPaydayInfo { /// Type for the response of GetPoolInfo. /// Contains information about a given pool at the end of a given block. -struct Concordium_V2_PoolInfoResponse { +/// From protocol version 7, pool removal has immediate effect, however, the +/// pool may still be present for the current (and possibly next) reward period. +/// In this case, the `current_payday_info` field will be set, but the +/// `equity_capital`, `delegated_capital`, `delegated_capital_cap` and, +/// `pool_info` fields will all be absent. The `equity_pending_change` field +/// will also be absent, as stake changes are immediate. +struct Concordium_V2_PoolInfoResponse: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9013,7 +8321,7 @@ struct Concordium_V2_PoolInfoResponse { /// Clears the value of `address`. Subsequent reads from it will return its default value. mutating func clearAddress() {_uniqueStorage()._address = nil} - /// The equity capital provided by the pool owner. + /// The equity capital provided by the pool owner. Absent if the pool is removed. var equityCapital: Concordium_V2_Amount { get {return _storage._equityCapital ?? Concordium_V2_Amount()} set {_uniqueStorage()._equityCapital = newValue} @@ -9023,7 +8331,7 @@ struct Concordium_V2_PoolInfoResponse { /// Clears the value of `equityCapital`. Subsequent reads from it will return its default value. mutating func clearEquityCapital() {_uniqueStorage()._equityCapital = nil} - /// The capital delegated to the pool by other accounts. + /// The capital delegated to the pool by other accounts. Absent if the pool is removed. var delegatedCapital: Concordium_V2_Amount { get {return _storage._delegatedCapital ?? Concordium_V2_Amount()} set {_uniqueStorage()._delegatedCapital = newValue} @@ -9034,6 +8342,7 @@ struct Concordium_V2_PoolInfoResponse { mutating func clearDelegatedCapital() {_uniqueStorage()._delegatedCapital = nil} /// The maximum amount that may be delegated to the pool, accounting for leverage and stake limits. + /// Absent if the pool is removed. var delegatedCapitalCap: Concordium_V2_Amount { get {return _storage._delegatedCapitalCap ?? Concordium_V2_Amount()} set {_uniqueStorage()._delegatedCapitalCap = newValue} @@ -9044,6 +8353,7 @@ struct Concordium_V2_PoolInfoResponse { mutating func clearDelegatedCapitalCap() {_uniqueStorage()._delegatedCapitalCap = nil} /// The pool info associated with the pool: open status, metadata URL and commission rates. + /// Absent if the pool is removed. var poolInfo: Concordium_V2_BakerPoolInfo { get {return _storage._poolInfo ?? Concordium_V2_BakerPoolInfo()} set {_uniqueStorage()._poolInfo = newValue} @@ -9053,7 +8363,8 @@ struct Concordium_V2_PoolInfoResponse { /// Clears the value of `poolInfo`. Subsequent reads from it will return its default value. mutating func clearPoolInfo() {_uniqueStorage()._poolInfo = nil} - /// Any pending change to the equity carpital. + /// Any pending change to the equity capital. + /// This is not used from protocol version 7 onwards, as stake changes are immediate. var equityPendingChange: Concordium_V2_PoolPendingChange { get {return _storage._equityPendingChange ?? Concordium_V2_PoolPendingChange()} set {_uniqueStorage()._equityPendingChange = newValue} @@ -9092,7 +8403,7 @@ struct Concordium_V2_PoolInfoResponse { /// Type for the response of GetPassiveDelegationInfo. /// Contains information about passive delegators at the end of a given block. -struct Concordium_V2_PassiveDelegationInfo { +struct Concordium_V2_PassiveDelegationInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9159,7 +8470,7 @@ struct Concordium_V2_PassiveDelegationInfo { } /// Request for GetBlocksAtHeight. -struct Concordium_V2_BlocksAtHeightRequest { +struct Concordium_V2_BlocksAtHeightRequest: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9184,32 +8495,14 @@ struct Concordium_V2_BlocksAtHeightRequest { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_BlocksAtHeight: Equatable { + enum OneOf_BlocksAtHeight: Equatable, Sendable { case absolute(Concordium_V2_BlocksAtHeightRequest.Absolute) case relative(Concordium_V2_BlocksAtHeightRequest.Relative) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_BlocksAtHeightRequest.OneOf_BlocksAtHeight, rhs: Concordium_V2_BlocksAtHeightRequest.OneOf_BlocksAtHeight) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.absolute, .absolute): return { - guard case .absolute(let l) = lhs, case .absolute(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.relative, .relative): return { - guard case .relative(let l) = lhs, case .relative(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// Request using an absolute block height. - struct Absolute { + struct Absolute: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9232,7 +8525,7 @@ struct Concordium_V2_BlocksAtHeightRequest { } /// Request using a relative block height. - struct Relative { + struct Relative: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9273,7 +8566,7 @@ struct Concordium_V2_BlocksAtHeightRequest { } /// Response for GetBlocksAtHeight. -struct Concordium_V2_BlocksAtHeightResponse { +struct Concordium_V2_BlocksAtHeightResponse: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9288,7 +8581,7 @@ struct Concordium_V2_BlocksAtHeightResponse { /// Type for the response of GetTokenomicsInfo. /// Contains information related to tokenomics at the end of a given block. -struct Concordium_V2_TokenomicsInfo { +struct Concordium_V2_TokenomicsInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9313,32 +8606,14 @@ struct Concordium_V2_TokenomicsInfo { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Tokenomics: Equatable { + enum OneOf_Tokenomics: Equatable, Sendable { case v0(Concordium_V2_TokenomicsInfo.V0) case v1(Concordium_V2_TokenomicsInfo.V1) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_TokenomicsInfo.OneOf_Tokenomics, rhs: Concordium_V2_TokenomicsInfo.OneOf_Tokenomics) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.v0, .v0): return { - guard case .v0(let l) = lhs, case .v0(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.v1, .v1): return { - guard case .v1(let l) = lhs, case .v1(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// Version 0 tokenomics. - struct V0 { + struct V0: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9408,7 +8683,7 @@ struct Concordium_V2_TokenomicsInfo { } /// Version 1 tokenomics. - struct V1 { + struct V1: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9525,7 +8800,7 @@ struct Concordium_V2_TokenomicsInfo { } /// Request for InvokeInstance. -struct Concordium_V2_InvokeInstanceRequest { +struct Concordium_V2_InvokeInstanceRequest: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9619,7 +8894,7 @@ struct Concordium_V2_InvokeInstanceRequest { } /// Response type for InvokeInstance. -struct Concordium_V2_InvokeInstanceResponse { +struct Concordium_V2_InvokeInstanceResponse: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9644,32 +8919,14 @@ struct Concordium_V2_InvokeInstanceResponse { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Result: Equatable { + enum OneOf_Result: Equatable, Sendable { case success(Concordium_V2_InvokeInstanceResponse.Success) case failure(Concordium_V2_InvokeInstanceResponse.Failure) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_InvokeInstanceResponse.OneOf_Result, rhs: Concordium_V2_InvokeInstanceResponse.OneOf_Result) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.success, .success): return { - guard case .success(let l) = lhs, case .success(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.failure, .failure): return { - guard case .failure(let l) = lhs, case .failure(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// Contract execution failed. - struct Failure { + struct Failure: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9717,7 +8974,7 @@ struct Concordium_V2_InvokeInstanceResponse { } /// Contract execution succeeded. - struct Success { + struct Success: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9758,7 +9015,7 @@ struct Concordium_V2_InvokeInstanceResponse { } /// Request for GetPoolDelegators and GetPoolDelegatorsRewardPeriod. -struct Concordium_V2_GetPoolDelegatorsRequest { +struct Concordium_V2_GetPoolDelegatorsRequest: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9792,7 +9049,7 @@ struct Concordium_V2_GetPoolDelegatorsRequest { } /// Stream item for GetPoolDelegators and GetPassiveDelegators. -struct Concordium_V2_DelegatorInfo { +struct Concordium_V2_DelegatorInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9837,7 +9094,7 @@ struct Concordium_V2_DelegatorInfo { } /// Stream item for GetPoolDelegatorsRewardPeriod and GetPassiveDelegatorsRewardPeriod. -struct Concordium_V2_DelegatorRewardPeriodInfo { +struct Concordium_V2_DelegatorRewardPeriodInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9871,7 +9128,7 @@ struct Concordium_V2_DelegatorRewardPeriodInfo { } /// Response type for GetBranches. -struct Concordium_V2_Branch { +struct Concordium_V2_Branch: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9899,7 +9156,7 @@ struct Concordium_V2_Branch { /// The leadership election nonce is an unpredictable value updated once an /// epoch to make sure that bakers cannot predict too far in the future when /// they will win the right to bake blocks. -struct Concordium_V2_LeadershipElectionNonce { +struct Concordium_V2_LeadershipElectionNonce: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9913,7 +9170,7 @@ struct Concordium_V2_LeadershipElectionNonce { /// Response type for GetElectionInfo. /// Contains information related to baker election for a perticular block. -struct Concordium_V2_ElectionInfo { +struct Concordium_V2_ElectionInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9943,7 +9200,7 @@ struct Concordium_V2_ElectionInfo { var unknownFields = SwiftProtobuf.UnknownStorage() - struct Baker { + struct Baker: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -9987,7 +9244,7 @@ struct Concordium_V2_ElectionInfo { /// A protocol generated event that is not directly caused by a transaction. This /// includes minting new CCD, rewarding different bakers and delegators, etc. -struct Concordium_V2_BlockSpecialEvent { +struct Concordium_V2_BlockSpecialEvent: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -10060,7 +9317,7 @@ struct Concordium_V2_BlockSpecialEvent { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Event: Equatable { + enum OneOf_Event: Equatable, Sendable { case bakingRewards(Concordium_V2_BlockSpecialEvent.BakingRewards) case mint(Concordium_V2_BlockSpecialEvent.Mint) case finalizationRewards(Concordium_V2_BlockSpecialEvent.FinalizationRewards) @@ -10070,52 +9327,10 @@ struct Concordium_V2_BlockSpecialEvent { case blockAccrueReward(Concordium_V2_BlockSpecialEvent.BlockAccrueReward) case paydayPoolReward(Concordium_V2_BlockSpecialEvent.PaydayPoolReward) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_BlockSpecialEvent.OneOf_Event, rhs: Concordium_V2_BlockSpecialEvent.OneOf_Event) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.bakingRewards, .bakingRewards): return { - guard case .bakingRewards(let l) = lhs, case .bakingRewards(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.mint, .mint): return { - guard case .mint(let l) = lhs, case .mint(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.finalizationRewards, .finalizationRewards): return { - guard case .finalizationRewards(let l) = lhs, case .finalizationRewards(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.blockReward, .blockReward): return { - guard case .blockReward(let l) = lhs, case .blockReward(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.paydayFoundationReward, .paydayFoundationReward): return { - guard case .paydayFoundationReward(let l) = lhs, case .paydayFoundationReward(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.paydayAccountReward, .paydayAccountReward): return { - guard case .paydayAccountReward(let l) = lhs, case .paydayAccountReward(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.blockAccrueReward, .blockAccrueReward): return { - guard case .blockAccrueReward(let l) = lhs, case .blockAccrueReward(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.paydayPoolReward, .paydayPoolReward): return { - guard case .paydayPoolReward(let l) = lhs, case .paydayPoolReward(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// A representation of a mapping from an account address to an amount. - struct AccountAmounts { + struct AccountAmounts: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -10125,7 +9340,7 @@ struct Concordium_V2_BlockSpecialEvent { var unknownFields = SwiftProtobuf.UnknownStorage() /// The entry for the map. - struct Entry { + struct Entry: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -10163,7 +9378,7 @@ struct Concordium_V2_BlockSpecialEvent { /// Payment to each baker of a previous epoch, in proportion to the number /// of blocks they contributed. - struct BakingRewards { + struct BakingRewards: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -10197,7 +9412,7 @@ struct Concordium_V2_BlockSpecialEvent { } /// Minting of new CCD. - struct Mint { + struct Mint: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -10253,7 +9468,7 @@ struct Concordium_V2_BlockSpecialEvent { } /// Payment to each finalizer on inclusion of a finalization record in a block. - struct FinalizationRewards { + struct FinalizationRewards: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -10290,7 +9505,7 @@ struct Concordium_V2_BlockSpecialEvent { /// the baker, and the foundation. It should always be that: /// /// ```transaction_fees + old_gas_account = new_gas_account + baker_reward + foundation_charge``` - struct BlockReward { + struct BlockReward: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -10379,7 +9594,7 @@ struct Concordium_V2_BlockSpecialEvent { } /// Foundation tax. - struct PaydayFoundationReward { + struct PaydayFoundationReward: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -10413,7 +9628,7 @@ struct Concordium_V2_BlockSpecialEvent { } /// Reward payment to the given account. - struct PaydayAccountReward { + struct PaydayAccountReward: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -10469,7 +9684,7 @@ struct Concordium_V2_BlockSpecialEvent { } /// Amounts accrued to accounts for each baked block. - struct BlockAccrueReward { + struct BlockAccrueReward: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -10558,7 +9773,7 @@ struct Concordium_V2_BlockSpecialEvent { } /// Payment distributed to a pool or passive delegators. - struct PaydayPoolReward { + struct PaydayPoolReward: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -10617,7 +9832,7 @@ struct Concordium_V2_BlockSpecialEvent { } /// A pending update. -struct Concordium_V2_PendingUpdate { +struct Concordium_V2_PendingUpdate: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -10854,7 +10069,7 @@ struct Concordium_V2_PendingUpdate { var unknownFields = SwiftProtobuf.UnknownStorage() /// The effect of the update. - enum OneOf_Effect: Equatable { + enum OneOf_Effect: Equatable, Sendable { /// Updates to the root keys. case rootKeys(Concordium_V2_HigherLevelKeys) /// Updates to the level 1 keys. @@ -10904,112 +10119,6 @@ struct Concordium_V2_PendingUpdate { /// Updates to the finalization committee for for chain parameters version 2. case finalizationCommitteeParameters(Concordium_V2_FinalizationCommitteeParameters) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_PendingUpdate.OneOf_Effect, rhs: Concordium_V2_PendingUpdate.OneOf_Effect) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.rootKeys, .rootKeys): return { - guard case .rootKeys(let l) = lhs, case .rootKeys(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.level1Keys, .level1Keys): return { - guard case .level1Keys(let l) = lhs, case .level1Keys(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.level2KeysCpv0, .level2KeysCpv0): return { - guard case .level2KeysCpv0(let l) = lhs, case .level2KeysCpv0(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.level2KeysCpv1, .level2KeysCpv1): return { - guard case .level2KeysCpv1(let l) = lhs, case .level2KeysCpv1(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.protocol, .protocol): return { - guard case .protocol(let l) = lhs, case .protocol(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.electionDifficulty, .electionDifficulty): return { - guard case .electionDifficulty(let l) = lhs, case .electionDifficulty(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.euroPerEnergy, .euroPerEnergy): return { - guard case .euroPerEnergy(let l) = lhs, case .euroPerEnergy(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.microCcdPerEuro, .microCcdPerEuro): return { - guard case .microCcdPerEuro(let l) = lhs, case .microCcdPerEuro(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.foundationAccount, .foundationAccount): return { - guard case .foundationAccount(let l) = lhs, case .foundationAccount(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.mintDistributionCpv0, .mintDistributionCpv0): return { - guard case .mintDistributionCpv0(let l) = lhs, case .mintDistributionCpv0(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.mintDistributionCpv1, .mintDistributionCpv1): return { - guard case .mintDistributionCpv1(let l) = lhs, case .mintDistributionCpv1(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.transactionFeeDistribution, .transactionFeeDistribution): return { - guard case .transactionFeeDistribution(let l) = lhs, case .transactionFeeDistribution(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.gasRewards, .gasRewards): return { - guard case .gasRewards(let l) = lhs, case .gasRewards(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.poolParametersCpv0, .poolParametersCpv0): return { - guard case .poolParametersCpv0(let l) = lhs, case .poolParametersCpv0(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.poolParametersCpv1, .poolParametersCpv1): return { - guard case .poolParametersCpv1(let l) = lhs, case .poolParametersCpv1(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.addAnonymityRevoker, .addAnonymityRevoker): return { - guard case .addAnonymityRevoker(let l) = lhs, case .addAnonymityRevoker(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.addIdentityProvider, .addIdentityProvider): return { - guard case .addIdentityProvider(let l) = lhs, case .addIdentityProvider(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.cooldownParameters, .cooldownParameters): return { - guard case .cooldownParameters(let l) = lhs, case .cooldownParameters(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.timeParameters, .timeParameters): return { - guard case .timeParameters(let l) = lhs, case .timeParameters(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.gasRewardsCpv2, .gasRewardsCpv2): return { - guard case .gasRewardsCpv2(let l) = lhs, case .gasRewardsCpv2(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.timeoutParameters, .timeoutParameters): return { - guard case .timeoutParameters(let l) = lhs, case .timeoutParameters(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.minBlockTime, .minBlockTime): return { - guard case .minBlockTime(let l) = lhs, case .minBlockTime(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.blockEnergyLimit, .blockEnergyLimit): return { - guard case .blockEnergyLimit(let l) = lhs, case .blockEnergyLimit(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.finalizationCommitteeParameters, .finalizationCommitteeParameters): return { - guard case .finalizationCommitteeParameters(let l) = lhs, case .finalizationCommitteeParameters(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} @@ -11018,7 +10127,7 @@ struct Concordium_V2_PendingUpdate { } /// The response for `GetNextUpdateSequenceNumbers`. -struct Concordium_V2_NextUpdateSequenceNumbers { +struct Concordium_V2_NextUpdateSequenceNumbers: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11232,7 +10341,7 @@ struct Concordium_V2_NextUpdateSequenceNumbers { /// A request to send a new block item to the chain. /// An IP address -struct Concordium_V2_IpAddress { +struct Concordium_V2_IpAddress: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11247,7 +10356,7 @@ struct Concordium_V2_IpAddress { /// A port /// Valid port numbers are expected thus /// the value is expected to be in the range (0..u16::MAX). -struct Concordium_V2_Port { +struct Concordium_V2_Port: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11261,7 +10370,7 @@ struct Concordium_V2_Port { /// A socket address consisting of /// an IP + port. -struct Concordium_V2_IpSocketAddress { +struct Concordium_V2_IpSocketAddress: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11298,7 +10407,7 @@ struct Concordium_V2_IpSocketAddress { /// The underlying value is simply a u64. /// Note. There is no authenticity of the peer id and /// as such it is only used for logging purposes. -struct Concordium_V2_PeerId { +struct Concordium_V2_PeerId: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11311,7 +10420,7 @@ struct Concordium_V2_PeerId { } /// A banned peer -struct Concordium_V2_BannedPeer { +struct Concordium_V2_BannedPeer: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11335,7 +10444,7 @@ struct Concordium_V2_BannedPeer { /// The banned peers given by /// their IP addresses. -struct Concordium_V2_BannedPeers { +struct Concordium_V2_BannedPeers: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11350,7 +10459,7 @@ struct Concordium_V2_BannedPeers { /// A peer to ban specified by its IP. /// Note. This will ban all peers located behind the /// specified IP even though they are using different ports. -struct Concordium_V2_PeerToBan { +struct Concordium_V2_PeerToBan: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11372,7 +10481,7 @@ struct Concordium_V2_PeerToBan { } /// Request to enable dumping of network packages. -struct Concordium_V2_DumpRequest { +struct Concordium_V2_DumpRequest: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11390,7 +10499,7 @@ struct Concordium_V2_DumpRequest { } /// Peers and their associated network related statistics -struct Concordium_V2_PeersInfo { +struct Concordium_V2_PeersInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11400,7 +10509,7 @@ struct Concordium_V2_PeersInfo { var unknownFields = SwiftProtobuf.UnknownStorage() /// A peer that the node is connected to. - struct Peer { + struct Peer: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11462,7 +10571,7 @@ struct Concordium_V2_PeersInfo { var unknownFields = SwiftProtobuf.UnknownStorage() /// consensus related information of the peer. - enum OneOf_ConsensusInfo: Equatable { + enum OneOf_ConsensusInfo: Equatable, Sendable { /// The peer is of type `Bootstrapper` is not participating in consensus /// and thus has no catchup status. case bootstrapper(Concordium_V2_Empty) @@ -11470,27 +10579,9 @@ struct Concordium_V2_PeersInfo { /// an associated catchup status. case nodeCatchupStatus(Concordium_V2_PeersInfo.Peer.CatchupStatus) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_PeersInfo.Peer.OneOf_ConsensusInfo, rhs: Concordium_V2_PeersInfo.Peer.OneOf_ConsensusInfo) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.bootstrapper, .bootstrapper): return { - guard case .bootstrapper(let l) = lhs, case .bootstrapper(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.nodeCatchupStatus, .nodeCatchupStatus): return { - guard case .nodeCatchupStatus(let l) = lhs, case .nodeCatchupStatus(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } - enum CatchupStatus: SwiftProtobuf.Enum { + enum CatchupStatus: SwiftProtobuf.Enum, Swift.CaseIterable { typealias RawValue = Int /// The peer does not have any data unknown to us. If we receive a message from the @@ -11533,10 +10624,17 @@ struct Concordium_V2_PeersInfo { } } + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Concordium_V2_PeersInfo.Peer.CatchupStatus] = [ + .uptodate, + .pending, + .catchingup, + ] + } /// Network statistics for the peer - struct NetworkStats { + struct NetworkStats: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11569,23 +10667,10 @@ struct Concordium_V2_PeersInfo { init() {} } -#if swift(>=4.2) - -extension Concordium_V2_PeersInfo.Peer.CatchupStatus: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Concordium_V2_PeersInfo.Peer.CatchupStatus] = [ - .uptodate, - .pending, - .catchingup, - ] -} - -#endif // swift(>=4.2) - /// Node info response /// Contains various information of the /// enquired node. -struct Concordium_V2_NodeInfo { +struct Concordium_V2_NodeInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11649,35 +10734,17 @@ struct Concordium_V2_NodeInfo { var unknownFields = SwiftProtobuf.UnknownStorage() /// Details of the node. - enum OneOf_Details: Equatable { + enum OneOf_Details: Equatable, Sendable { /// The node is a bootstrapper and is not running consensus. case bootstrapper(Concordium_V2_Empty) /// The node is a regular node and runs the consensus /// protocol. case node(Concordium_V2_NodeInfo.Node) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_NodeInfo.OneOf_Details, rhs: Concordium_V2_NodeInfo.OneOf_Details) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.bootstrapper, .bootstrapper): return { - guard case .bootstrapper(let l) = lhs, case .bootstrapper(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.node, .node): return { - guard case .node(let l) = lhs, case .node(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// Network related information of the node. - struct NetworkInfo { + struct NetworkInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11712,7 +10779,7 @@ struct Concordium_V2_NodeInfo { } /// Consensus info for a node configured with baker keys. - struct BakerConsensusInfo { + struct BakerConsensusInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11761,7 +10828,7 @@ struct Concordium_V2_NodeInfo { var unknownFields = SwiftProtobuf.UnknownStorage() /// Status of the baker configured node. - enum OneOf_Status: Equatable { + enum OneOf_Status: Equatable, Sendable { /// The node is currently not baking. case passiveCommitteeInfo(Concordium_V2_NodeInfo.BakerConsensusInfo.PassiveCommitteeInfo) /// The node is configured with baker keys and @@ -11771,34 +10838,12 @@ struct Concordium_V2_NodeInfo { /// is member of the baking and finalization committees. case activeFinalizerCommitteeInfo(Concordium_V2_NodeInfo.BakerConsensusInfo.ActiveFinalizerCommitteeInfo) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_NodeInfo.BakerConsensusInfo.OneOf_Status, rhs: Concordium_V2_NodeInfo.BakerConsensusInfo.OneOf_Status) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.passiveCommitteeInfo, .passiveCommitteeInfo): return { - guard case .passiveCommitteeInfo(let l) = lhs, case .passiveCommitteeInfo(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.activeBakerCommitteeInfo, .activeBakerCommitteeInfo): return { - guard case .activeBakerCommitteeInfo(let l) = lhs, case .activeBakerCommitteeInfo(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.activeFinalizerCommitteeInfo, .activeFinalizerCommitteeInfo): return { - guard case .activeFinalizerCommitteeInfo(let l) = lhs, case .activeFinalizerCommitteeInfo(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// The committee information of a node configured with /// baker keys but somehow the node is _not_ part of the /// current baking committee. - enum PassiveCommitteeInfo: SwiftProtobuf.Enum { + enum PassiveCommitteeInfo: SwiftProtobuf.Enum, Swift.CaseIterable { typealias RawValue = Int /// The node is started with baker keys however it is currently not in the baking committee. @@ -11837,12 +10882,19 @@ struct Concordium_V2_NodeInfo { } } + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Concordium_V2_NodeInfo.BakerConsensusInfo.PassiveCommitteeInfo] = [ + .notInCommittee, + .addedButNotActiveInCommittee, + .addedButWrongKeys, + ] + } /// Tagging message type for a node that /// is configured with baker keys and active in /// the current baking committee - struct ActiveBakerCommitteeInfo { + struct ActiveBakerCommitteeInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11855,7 +10907,7 @@ struct Concordium_V2_NodeInfo { /// Tagging message type for a node that /// is configured with baker keys and active in /// the current finalizer committee (and also baking committee). - struct ActiveFinalizerCommitteeInfo { + struct ActiveFinalizerCommitteeInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11871,7 +10923,7 @@ struct Concordium_V2_NodeInfo { } /// The node is a regular node. - struct Node { + struct Node: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -11914,7 +10966,7 @@ struct Concordium_V2_NodeInfo { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_ConsensusStatus: Equatable { + enum OneOf_ConsensusStatus: Equatable, Sendable { /// The node is not running consensus. /// This is the case only when the node is /// not supporting the protocol on the chain. @@ -11929,28 +10981,6 @@ struct Concordium_V2_NodeInfo { /// The node is configured with baker credentials and consensus is running. case active(Concordium_V2_NodeInfo.BakerConsensusInfo) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_NodeInfo.Node.OneOf_ConsensusStatus, rhs: Concordium_V2_NodeInfo.Node.OneOf_ConsensusStatus) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.notRunning, .notRunning): return { - guard case .notRunning(let l) = lhs, case .notRunning(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.passive, .passive): return { - guard case .passive(let l) = lhs, case .passive(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.active, .active): return { - guard case .active(let l) = lhs, case .active(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} @@ -11963,20 +10993,7 @@ struct Concordium_V2_NodeInfo { fileprivate var _networkInfo: Concordium_V2_NodeInfo.NetworkInfo? = nil } -#if swift(>=4.2) - -extension Concordium_V2_NodeInfo.BakerConsensusInfo.PassiveCommitteeInfo: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Concordium_V2_NodeInfo.BakerConsensusInfo.PassiveCommitteeInfo] = [ - .notInCommittee, - .addedButNotActiveInCommittee, - .addedButWrongKeys, - ] -} - -#endif // swift(>=4.2) - -struct Concordium_V2_SendBlockItemRequest { +struct Concordium_V2_SendBlockItemRequest: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12015,7 +11032,7 @@ struct Concordium_V2_SendBlockItemRequest { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_BlockItem: Equatable { + enum OneOf_BlockItem: Equatable, Sendable { /// Account transactions are messages which are signed and paid for by an account. case accountTransaction(Concordium_V2_AccountTransaction) /// Credential deployments create new accounts. They are not paid for @@ -12026,28 +11043,6 @@ struct Concordium_V2_SendBlockItemRequest { /// to make future update instructions. case updateInstruction(Concordium_V2_UpdateInstruction) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_SendBlockItemRequest.OneOf_BlockItem, rhs: Concordium_V2_SendBlockItemRequest.OneOf_BlockItem) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.accountTransaction, .accountTransaction): return { - guard case .accountTransaction(let l) = lhs, case .accountTransaction(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.credentialDeployment, .credentialDeployment): return { - guard case .credentialDeployment(let l) = lhs, case .credentialDeployment(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.updateInstruction, .updateInstruction): return { - guard case .updateInstruction(let l) = lhs, case .updateInstruction(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} @@ -12056,7 +11051,7 @@ struct Concordium_V2_SendBlockItemRequest { /// Credential deployments create new accounts. They are not paid for /// directly by the sender. Instead, bakers are rewarded by the protocol for /// including them. -struct Concordium_V2_CredentialDeployment { +struct Concordium_V2_CredentialDeployment: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12086,24 +11081,11 @@ struct Concordium_V2_CredentialDeployment { var unknownFields = SwiftProtobuf.UnknownStorage() /// The credential to be added. - enum OneOf_Payload: Equatable { + enum OneOf_Payload: Equatable, @unchecked Sendable { /// A raw payload, which is just the encoded payload. /// A typed variant might be added in the future. case rawPayload(Data) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_CredentialDeployment.OneOf_Payload, rhs: Concordium_V2_CredentialDeployment.OneOf_Payload) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.rawPayload, .rawPayload): return { - guard case .rawPayload(let l) = lhs, case .rawPayload(let r) = rhs else { preconditionFailure() } - return l == r - }() - } - } - #endif } init() {} @@ -12113,7 +11095,7 @@ struct Concordium_V2_CredentialDeployment { /// A single signature. Used when sending block items to a node with /// `SendBlockItem`. -struct Concordium_V2_Signature { +struct Concordium_V2_Signature: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12127,7 +11109,7 @@ struct Concordium_V2_Signature { /// A signature on an update instruction. /// The type `UpdateKeysIndex` is not used directly, as messages cannot be keys in maps. -struct Concordium_V2_SignatureMap { +struct Concordium_V2_SignatureMap: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12142,7 +11124,7 @@ struct Concordium_V2_SignatureMap { /// Wrapper for a map from indexes to signatures. /// Needed because protobuf doesn't allow nested maps directly. /// The keys in the SignatureMap must not exceed 2^8. -struct Concordium_V2_AccountSignatureMap { +struct Concordium_V2_AccountSignatureMap: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12154,7 +11136,7 @@ struct Concordium_V2_AccountSignatureMap { init() {} } -struct Concordium_V2_AccountTransactionSignature { +struct Concordium_V2_AccountTransactionSignature: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12171,7 +11153,7 @@ struct Concordium_V2_AccountTransactionSignature { /// Header of an account transaction that contains basic data to check whether /// the sender and the transaction are valid. The header is shared by all transaction types. -struct Concordium_V2_AccountTransactionHeader { +struct Concordium_V2_AccountTransactionHeader: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12227,7 +11209,7 @@ struct Concordium_V2_AccountTransactionHeader { } /// Data required to initialize a new contract instance. -struct Concordium_V2_InitContractPayload { +struct Concordium_V2_InitContractPayload: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12284,7 +11266,7 @@ struct Concordium_V2_InitContractPayload { } /// Data required to update a contract instance. -struct Concordium_V2_UpdateContractPayload { +struct Concordium_V2_UpdateContractPayload: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12341,7 +11323,7 @@ struct Concordium_V2_UpdateContractPayload { } /// Payload of a transfer between two accounts. -struct Concordium_V2_TransferPayload { +struct Concordium_V2_TransferPayload: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12375,7 +11357,7 @@ struct Concordium_V2_TransferPayload { } /// Payload of a transfer between two accounts with a memo. -struct Concordium_V2_TransferWithMemoPayload { +struct Concordium_V2_TransferWithMemoPayload: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12420,7 +11402,7 @@ struct Concordium_V2_TransferWithMemoPayload { } /// The payload for an account transaction. -struct Concordium_V2_AccountTransactionPayload { +struct Concordium_V2_AccountTransactionPayload: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12488,56 +11470,18 @@ struct Concordium_V2_AccountTransactionPayload { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Payload: Equatable { + enum OneOf_Payload: Equatable, @unchecked Sendable { /// A pre-serialized payload in the binary serialization format defined /// by the protocol. case rawPayload(Data) /// A transfer between two accounts. With an optional memo. case deployModule(Concordium_V2_VersionedModuleSource) - case initContract(Concordium_V2_InitContractPayload) - case updateContract(Concordium_V2_UpdateContractPayload) - case transfer(Concordium_V2_TransferPayload) - case transferWithMemo(Concordium_V2_TransferWithMemoPayload) - case registerData(Concordium_V2_RegisteredData) - - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_AccountTransactionPayload.OneOf_Payload, rhs: Concordium_V2_AccountTransactionPayload.OneOf_Payload) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.rawPayload, .rawPayload): return { - guard case .rawPayload(let l) = lhs, case .rawPayload(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.deployModule, .deployModule): return { - guard case .deployModule(let l) = lhs, case .deployModule(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.initContract, .initContract): return { - guard case .initContract(let l) = lhs, case .initContract(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.updateContract, .updateContract): return { - guard case .updateContract(let l) = lhs, case .updateContract(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.transfer, .transfer): return { - guard case .transfer(let l) = lhs, case .transfer(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.transferWithMemo, .transferWithMemo): return { - guard case .transferWithMemo(let l) = lhs, case .transferWithMemo(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.registerData, .registerData): return { - guard case .registerData(let l) = lhs, case .registerData(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif + case initContract(Concordium_V2_InitContractPayload) + case updateContract(Concordium_V2_UpdateContractPayload) + case transfer(Concordium_V2_TransferPayload) + case transferWithMemo(Concordium_V2_TransferWithMemoPayload) + case registerData(Concordium_V2_RegisteredData) + } init() {} @@ -12545,7 +11489,7 @@ struct Concordium_V2_AccountTransactionPayload { /// An unsigned account transaction. This is used with the /// `GetTransactionSignHash` endpoint to obtain the message to sign. -struct Concordium_V2_PreAccountTransaction { +struct Concordium_V2_PreAccountTransaction: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12578,7 +11522,7 @@ struct Concordium_V2_PreAccountTransaction { /// Account transactions are messages which are signed and paid for by the sender /// account. -struct Concordium_V2_AccountTransaction { +struct Concordium_V2_AccountTransaction: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12619,7 +11563,7 @@ struct Concordium_V2_AccountTransaction { fileprivate var _payload: Concordium_V2_AccountTransactionPayload? = nil } -struct Concordium_V2_UpdateInstructionHeader { +struct Concordium_V2_UpdateInstructionHeader: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12661,7 +11605,7 @@ struct Concordium_V2_UpdateInstructionHeader { } /// The payload for an UpdateInstruction. -struct Concordium_V2_UpdateInstructionPayload { +struct Concordium_V2_UpdateInstructionPayload: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12679,29 +11623,16 @@ struct Concordium_V2_UpdateInstructionPayload { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Payload: Equatable { + enum OneOf_Payload: Equatable, @unchecked Sendable { /// A raw payload encoded according to the format defined by the protocol. case rawPayload(Data) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_UpdateInstructionPayload.OneOf_Payload, rhs: Concordium_V2_UpdateInstructionPayload.OneOf_Payload) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.rawPayload, .rawPayload): return { - guard case .rawPayload(let l) = lhs, case .rawPayload(let r) = rhs else { preconditionFailure() } - return l == r - }() - } - } - #endif } init() {} } -struct Concordium_V2_UpdateInstruction { +struct Concordium_V2_UpdateInstruction: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12745,7 +11676,7 @@ struct Concordium_V2_UpdateInstruction { /// Signature on an account transaction is defined to be the signature on the /// hash of the `PreAccountTransaction`. -struct Concordium_V2_AccountTransactionSignHash { +struct Concordium_V2_AccountTransactionSignHash: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12759,7 +11690,7 @@ struct Concordium_V2_AccountTransactionSignHash { /// The number of credential deployments allowed in a block. This in effect /// determines the number of accounts that can be created in a block. -struct Concordium_V2_CredentialsPerBlockLimit { +struct Concordium_V2_CredentialsPerBlockLimit: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12772,7 +11703,7 @@ struct Concordium_V2_CredentialsPerBlockLimit { } /// Updatable chain parameters that apply to protocol versions 1-3. -struct Concordium_V2_ChainParametersV0 { +struct Concordium_V2_ChainParametersV0: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -12916,7 +11847,7 @@ struct Concordium_V2_ChainParametersV0 { } /// Updatable chain parameters that apply to protocol versions 4-5. -struct Concordium_V2_ChainParametersV1 { +struct Concordium_V2_ChainParametersV1: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13072,7 +12003,7 @@ struct Concordium_V2_ChainParametersV1 { } /// Updatable chain parameters that apply to protocol versions 6. -struct Concordium_V2_ChainParametersV2 { +struct Concordium_V2_ChainParametersV2: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13238,7 +12169,7 @@ struct Concordium_V2_ChainParametersV2 { } /// Chain parameters. -struct Concordium_V2_ChainParameters { +struct Concordium_V2_ChainParameters: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13274,7 +12205,7 @@ struct Concordium_V2_ChainParameters { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Parameters: Equatable { + enum OneOf_Parameters: Equatable, Sendable { /// Chain parameters that apply when the block is a protocol version 1-3 block. case v0(Concordium_V2_ChainParametersV0) /// Chain parameters that apply when the block is a protocol version 4-5 block. @@ -13282,35 +12213,13 @@ struct Concordium_V2_ChainParameters { /// Chain parameters that apply when the block is a protocol version 6- block. case v2(Concordium_V2_ChainParametersV2) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_ChainParameters.OneOf_Parameters, rhs: Concordium_V2_ChainParameters.OneOf_Parameters) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.v0, .v0): return { - guard case .v0(let l) = lhs, case .v0(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.v1, .v1): return { - guard case .v1(let l) = lhs, case .v1(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.v2, .v2): return { - guard case .v2(let l) = lhs, case .v2(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} } /// Details about a finalizer for the finalization round. -struct Concordium_V2_FinalizationSummaryParty { +struct Concordium_V2_FinalizationSummaryParty: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13340,7 +12249,7 @@ struct Concordium_V2_FinalizationSummaryParty { /// Index of the finalization round. This increases on each successfully /// completed finalization. -struct Concordium_V2_FinalizationIndex { +struct Concordium_V2_FinalizationIndex: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13353,7 +12262,7 @@ struct Concordium_V2_FinalizationIndex { } /// Details about a finalization record included in a block. -struct Concordium_V2_FinalizationSummary { +struct Concordium_V2_FinalizationSummary: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13402,7 +12311,7 @@ struct Concordium_V2_FinalizationSummary { } /// Finalization summary that may or may not be part of the block. -struct Concordium_V2_BlockFinalizationSummary { +struct Concordium_V2_BlockFinalizationSummary: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13429,36 +12338,18 @@ struct Concordium_V2_BlockFinalizationSummary { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Summary: Equatable { + enum OneOf_Summary: Equatable, Sendable { /// There is no finalization data in the block. case none(Concordium_V2_Empty) /// There is a single finalization record with the block. case record(Concordium_V2_FinalizationSummary) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_BlockFinalizationSummary.OneOf_Summary, rhs: Concordium_V2_BlockFinalizationSummary.OneOf_Summary) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.none, .none): return { - guard case .none(let l) = lhs, case .none(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.record, .record): return { - guard case .record(let l) = lhs, case .record(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} } -struct Concordium_V2_BlockItem { +struct Concordium_V2_BlockItem: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13507,7 +12398,7 @@ struct Concordium_V2_BlockItem { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_BlockItem: Equatable { + enum OneOf_BlockItem: Equatable, Sendable { /// Account transactions are messages which are signed and paid for by an account. case accountTransaction(Concordium_V2_AccountTransaction) /// Credential deployments create new accounts. They are not paid for @@ -13518,28 +12409,6 @@ struct Concordium_V2_BlockItem { /// to make future update instructions. case updateInstruction(Concordium_V2_UpdateInstruction) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_BlockItem.OneOf_BlockItem, rhs: Concordium_V2_BlockItem.OneOf_BlockItem) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.accountTransaction, .accountTransaction): return { - guard case .accountTransaction(let l) = lhs, case .accountTransaction(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.credentialDeployment, .credentialDeployment): return { - guard case .credentialDeployment(let l) = lhs, case .credentialDeployment(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.updateInstruction, .updateInstruction): return { - guard case .updateInstruction(let l) = lhs, case .updateInstruction(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} @@ -13549,7 +12418,7 @@ struct Concordium_V2_BlockItem { /// Information about a particular baker with respect to /// the current reward period. -struct Concordium_V2_BakerRewardPeriodInfo { +struct Concordium_V2_BakerRewardPeriodInfo: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13620,7 +12489,7 @@ struct Concordium_V2_BakerRewardPeriodInfo { } /// The signature of a 'QuorumCertificate'. -struct Concordium_V2_QuorumSignature { +struct Concordium_V2_QuorumSignature: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13638,7 +12507,7 @@ struct Concordium_V2_QuorumSignature { /// finalization comittee issues in order to certify a block. /// A block must be certified before it will be part of the /// authorative part of the chain. -struct Concordium_V2_QuorumCertificate { +struct Concordium_V2_QuorumCertificate: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13702,7 +12571,7 @@ struct Concordium_V2_QuorumCertificate { /// The finalizer round is a map from a 'Round' /// to the list of finalizers (identified by their 'BakerId') that signed /// off the round. -struct Concordium_V2_FinalizerRound { +struct Concordium_V2_FinalizerRound: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13729,7 +12598,7 @@ struct Concordium_V2_FinalizerRound { } /// The signature of a 'TimeoutCertificate'. -struct Concordium_V2_TimeoutSignature { +struct Concordium_V2_TimeoutSignature: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13747,7 +12616,7 @@ struct Concordium_V2_TimeoutSignature { /// finalization committee issues when a round times out, /// thus making it possible for the protocol to proceed to the /// next round. -struct Concordium_V2_TimeoutCertificate { +struct Concordium_V2_TimeoutCertificate: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13804,7 +12673,7 @@ struct Concordium_V2_TimeoutCertificate { /// A proof that establishes that the successor block of /// a 'EpochFinalizationEntry' is the immediate successor of /// the finalized block. -struct Concordium_V2_SuccessorProof { +struct Concordium_V2_SuccessorProof: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13822,7 +12691,7 @@ struct Concordium_V2_SuccessorProof { /// makes the protocol able to advance to a new epoch. /// I.e. the 'EpochFinalizationEntry' is present if and only if /// the block is the first block of a new 'Epoch'. -struct Concordium_V2_EpochFinalizationEntry { +struct Concordium_V2_EpochFinalizationEntry: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13870,7 +12739,7 @@ struct Concordium_V2_EpochFinalizationEntry { /// Certificates for a block for protocols supporting /// ConcordiumBFT. -struct Concordium_V2_BlockCertificates { +struct Concordium_V2_BlockCertificates: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13916,7 +12785,7 @@ struct Concordium_V2_BlockCertificates { } /// Details of which baker won the lottery in a given round in consensus version 1. -struct Concordium_V2_WinningBaker { +struct Concordium_V2_WinningBaker: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13955,7 +12824,7 @@ struct Concordium_V2_WinningBaker { /// An operation to dry run. The first operation in a dry-run sequence should be /// `load_block_state`: any other operation will be met with `NoState` until a /// state is successfully loaded. -struct Concordium_V2_DryRunRequest { +struct Concordium_V2_DryRunRequest: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -13995,7 +12864,7 @@ struct Concordium_V2_DryRunRequest { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Request: Equatable { + enum OneOf_Request: Equatable, Sendable { /// Load the state of the specified block to use for subsequent requests. /// The state is taken at the end of execution of the block, and the block’s /// timestamp is used as the current timestamp. @@ -14007,35 +12876,13 @@ struct Concordium_V2_DryRunRequest { /// Run a (non-transaction) operation to modify the state. case stateOperation(Concordium_V2_DryRunStateOperation) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_DryRunRequest.OneOf_Request, rhs: Concordium_V2_DryRunRequest.OneOf_Request) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.loadBlockState, .loadBlockState): return { - guard case .loadBlockState(let l) = lhs, case .loadBlockState(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.stateQuery, .stateQuery): return { - guard case .stateQuery(let l) = lhs, case .stateQuery(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.stateOperation, .stateOperation): return { - guard case .stateOperation(let l) = lhs, case .stateOperation(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} } /// Run a query as part of a dry run. Queries do not update the block state. -struct Concordium_V2_DryRunStateQuery { +struct Concordium_V2_DryRunStateQuery: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14079,7 +12926,7 @@ struct Concordium_V2_DryRunStateQuery { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Query: Equatable { + enum OneOf_Query: Equatable, Sendable { /// Look up information on a particular account. /// /// The energy cost for this query is 200. @@ -14095,35 +12942,13 @@ struct Concordium_V2_DryRunStateQuery { /// execution. case invokeInstance(Concordium_V2_DryRunInvokeInstance) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_DryRunStateQuery.OneOf_Query, rhs: Concordium_V2_DryRunStateQuery.OneOf_Query) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.getAccountInfo, .getAccountInfo): return { - guard case .getAccountInfo(let l) = lhs, case .getAccountInfo(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.getInstanceInfo, .getInstanceInfo): return { - guard case .getInstanceInfo(let l) = lhs, case .getInstanceInfo(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.invokeInstance, .invokeInstance): return { - guard case .invokeInstance(let l) = lhs, case .invokeInstance(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} } /// Invoke an entrypoint on a smart contract instance. -struct Concordium_V2_DryRunInvokeInstance { +struct Concordium_V2_DryRunInvokeInstance: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14205,7 +13030,7 @@ struct Concordium_V2_DryRunInvokeInstance { } /// An operation that can update the state as part of a dry run. -struct Concordium_V2_DryRunStateOperation { +struct Concordium_V2_DryRunStateOperation: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14250,7 +13075,7 @@ struct Concordium_V2_DryRunStateOperation { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Operation: Equatable { + enum OneOf_Operation: Equatable, Sendable { /// Sets the current block time to the given timestamp for the purposes of future /// transactions. /// @@ -14267,35 +13092,13 @@ struct Concordium_V2_DryRunStateOperation { /// transaction. case runTransaction(Concordium_V2_DryRunTransaction) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_DryRunStateOperation.OneOf_Operation, rhs: Concordium_V2_DryRunStateOperation.OneOf_Operation) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.setTimestamp, .setTimestamp): return { - guard case .setTimestamp(let l) = lhs, case .setTimestamp(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.mintToAccount, .mintToAccount): return { - guard case .mintToAccount(let l) = lhs, case .mintToAccount(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.runTransaction, .runTransaction): return { - guard case .runTransaction(let l) = lhs, case .runTransaction(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} } /// Mint a specified amount and credit it to the specified account as part of a dry run. -struct Concordium_V2_DryRunMintToAccount { +struct Concordium_V2_DryRunMintToAccount: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14329,7 +13132,7 @@ struct Concordium_V2_DryRunMintToAccount { } /// Dry run an account transaction -struct Concordium_V2_DryRunTransaction { +struct Concordium_V2_DryRunTransaction: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14390,7 +13193,7 @@ struct Concordium_V2_DryRunTransaction { /// A dry run signature is a pair of a credential index and key index, identifying the credential /// and key that is presumed to have signed the transaction. No actual cryptographic signature is /// included. -struct Concordium_V2_DryRunSignature { +struct Concordium_V2_DryRunSignature: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14407,7 +13210,7 @@ struct Concordium_V2_DryRunSignature { } /// A response to a `DryRunRequest`. -struct Concordium_V2_DryRunResponse { +struct Concordium_V2_DryRunResponse: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14444,30 +13247,12 @@ struct Concordium_V2_DryRunResponse { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Response: Equatable { + enum OneOf_Response: Equatable, Sendable { /// The request produced an error. The request otherwise has no effect on the state. case error(Concordium_V2_DryRunErrorResponse) /// The request was successful. case success(Concordium_V2_DryRunSuccessResponse) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_DryRunResponse.OneOf_Response, rhs: Concordium_V2_DryRunResponse.OneOf_Response) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.error, .error): return { - guard case .error(let l) = lhs, case .error(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.success, .success): return { - guard case .success(let l) = lhs, case .success(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } init() {} @@ -14475,7 +13260,7 @@ struct Concordium_V2_DryRunResponse { fileprivate var _quotaRemaining: Concordium_V2_Energy? = nil } -struct Concordium_V2_DryRunErrorResponse { +struct Concordium_V2_DryRunErrorResponse: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14564,7 +13349,7 @@ struct Concordium_V2_DryRunErrorResponse { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Error: Equatable { + enum OneOf_Error: Equatable, Sendable { /// The current block state is undefined. It should be initialized with /// a 'load_block_state' request before any other operations. case noState(Concordium_V2_DryRunErrorResponse.NoState) @@ -14590,53 +13375,11 @@ struct Concordium_V2_DryRunErrorResponse { /// Response to 'invoke_instance'. case invokeFailed(Concordium_V2_DryRunErrorResponse.InvokeFailure) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_DryRunErrorResponse.OneOf_Error, rhs: Concordium_V2_DryRunErrorResponse.OneOf_Error) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.noState, .noState): return { - guard case .noState(let l) = lhs, case .noState(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.blockNotFound, .blockNotFound): return { - guard case .blockNotFound(let l) = lhs, case .blockNotFound(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.accountNotFound, .accountNotFound): return { - guard case .accountNotFound(let l) = lhs, case .accountNotFound(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.instanceNotFound, .instanceNotFound): return { - guard case .instanceNotFound(let l) = lhs, case .instanceNotFound(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.amountOverLimit, .amountOverLimit): return { - guard case .amountOverLimit(let l) = lhs, case .amountOverLimit(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.balanceInsufficient, .balanceInsufficient): return { - guard case .balanceInsufficient(let l) = lhs, case .balanceInsufficient(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.energyInsufficient, .energyInsufficient): return { - guard case .energyInsufficient(let l) = lhs, case .energyInsufficient(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.invokeFailed, .invokeFailed): return { - guard case .invokeFailed(let l) = lhs, case .invokeFailed(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// The current block state is undefined. It should be initialized with /// a 'load_block_state' request before any other operations. - struct NoState { + struct NoState: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14647,7 +13390,7 @@ struct Concordium_V2_DryRunErrorResponse { } /// The requested block was not found, so its state could not be loaded. - struct BlockNotFound { + struct BlockNotFound: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14658,7 +13401,7 @@ struct Concordium_V2_DryRunErrorResponse { } /// The specified account was not found. - struct AccountNotFound { + struct AccountNotFound: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14669,7 +13412,7 @@ struct Concordium_V2_DryRunErrorResponse { } /// The specified instance was not found. - struct InstanceNotFound { + struct InstanceNotFound: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14680,7 +13423,7 @@ struct Concordium_V2_DryRunErrorResponse { } /// The amount that was requested to be minted would overflow the total supply. - struct AmountOverLimit { + struct AmountOverLimit: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14704,7 +13447,7 @@ struct Concordium_V2_DryRunErrorResponse { /// The sender account for the transaction has insufficient balance to pay the preliminary fees /// for the transaction to be included in a block. - struct BalanceInsufficient { + struct BalanceInsufficient: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14739,7 +13482,7 @@ struct Concordium_V2_DryRunErrorResponse { /// The energy made available for the transaction is insufficient to cover the basic processing /// required to include a transaction in a block. - struct EnergyInsufficient { + struct EnergyInsufficient: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14766,7 +13509,7 @@ struct Concordium_V2_DryRunErrorResponse { } /// Invoking the smart contract instance failed. - struct InvokeFailure { + struct InvokeFailure: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14817,7 +13560,7 @@ struct Concordium_V2_DryRunErrorResponse { } /// The dry run operation completed successfully. -struct Concordium_V2_DryRunSuccessResponse { +struct Concordium_V2_DryRunSuccessResponse: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14896,7 +13639,7 @@ struct Concordium_V2_DryRunSuccessResponse { var unknownFields = SwiftProtobuf.UnknownStorage() - enum OneOf_Response: Equatable { + enum OneOf_Response: Equatable, Sendable { /// The state from the specified block was successfully loaded. /// Response to 'load_block_state'. case blockStateLoaded(Concordium_V2_DryRunSuccessResponse.BlockStateLoaded) @@ -14919,48 +13662,10 @@ struct Concordium_V2_DryRunSuccessResponse { /// Response to 'run_transaction'. case transactionExecuted(Concordium_V2_DryRunSuccessResponse.TransactionExecuted) - #if !swift(>=4.1) - static func ==(lhs: Concordium_V2_DryRunSuccessResponse.OneOf_Response, rhs: Concordium_V2_DryRunSuccessResponse.OneOf_Response) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.blockStateLoaded, .blockStateLoaded): return { - guard case .blockStateLoaded(let l) = lhs, case .blockStateLoaded(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.accountInfo, .accountInfo): return { - guard case .accountInfo(let l) = lhs, case .accountInfo(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.instanceInfo, .instanceInfo): return { - guard case .instanceInfo(let l) = lhs, case .instanceInfo(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.invokeSucceeded, .invokeSucceeded): return { - guard case .invokeSucceeded(let l) = lhs, case .invokeSucceeded(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.timestampSet, .timestampSet): return { - guard case .timestampSet(let l) = lhs, case .timestampSet(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.mintedToAccount, .mintedToAccount): return { - guard case .mintedToAccount(let l) = lhs, case .mintedToAccount(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.transactionExecuted, .transactionExecuted): return { - guard case .transactionExecuted(let l) = lhs, case .transactionExecuted(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// The block state at the specified block was successfully loaded. - struct BlockStateLoaded { + struct BlockStateLoaded: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -14998,7 +13703,7 @@ struct Concordium_V2_DryRunSuccessResponse { } /// The current apparent timestamp was updated to the specified value. - struct TimestampSet { + struct TimestampSet: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -15009,7 +13714,7 @@ struct Concordium_V2_DryRunSuccessResponse { } /// The specified amount was minted to the specified account. - struct MintedToAccount { + struct MintedToAccount: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -15020,7 +13725,7 @@ struct Concordium_V2_DryRunSuccessResponse { } /// The transaction was executed. - struct TransactionExecuted { + struct TransactionExecuted: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -15066,7 +13771,7 @@ struct Concordium_V2_DryRunSuccessResponse { } /// The smart contract instance was invoked successfully. - struct InvokeSuccess { + struct InvokeSuccess: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -15106,365 +13811,6 @@ struct Concordium_V2_DryRunSuccessResponse { init() {} } -#if swift(>=5.5) && canImport(_Concurrency) -extension Concordium_V2_OpenStatus: @unchecked Sendable {} -extension Concordium_V2_ContractVersion: @unchecked Sendable {} -extension Concordium_V2_CredentialType: @unchecked Sendable {} -extension Concordium_V2_UpdateType: @unchecked Sendable {} -extension Concordium_V2_TransactionType: @unchecked Sendable {} -extension Concordium_V2_ProtocolVersion: @unchecked Sendable {} -extension Concordium_V2_Empty: @unchecked Sendable {} -extension Concordium_V2_BlockHash: @unchecked Sendable {} -extension Concordium_V2_Sha256Hash: @unchecked Sendable {} -extension Concordium_V2_TransactionHash: @unchecked Sendable {} -extension Concordium_V2_StateHash: @unchecked Sendable {} -extension Concordium_V2_AbsoluteBlockHeight: @unchecked Sendable {} -extension Concordium_V2_BlockHeight: @unchecked Sendable {} -extension Concordium_V2_BakerId: @unchecked Sendable {} -extension Concordium_V2_AccountIndex: @unchecked Sendable {} -extension Concordium_V2_ModuleRef: @unchecked Sendable {} -extension Concordium_V2_VersionedModuleSource: @unchecked Sendable {} -extension Concordium_V2_VersionedModuleSource.OneOf_Module: @unchecked Sendable {} -extension Concordium_V2_VersionedModuleSource.ModuleSourceV0: @unchecked Sendable {} -extension Concordium_V2_VersionedModuleSource.ModuleSourceV1: @unchecked Sendable {} -extension Concordium_V2_Timestamp: @unchecked Sendable {} -extension Concordium_V2_Release: @unchecked Sendable {} -extension Concordium_V2_NewRelease: @unchecked Sendable {} -extension Concordium_V2_ReleaseSchedule: @unchecked Sendable {} -extension Concordium_V2_EncryptedAmount: @unchecked Sendable {} -extension Concordium_V2_EncryptedBalance: @unchecked Sendable {} -extension Concordium_V2_DelegationTarget: @unchecked Sendable {} -extension Concordium_V2_DelegationTarget.OneOf_Target: @unchecked Sendable {} -extension Concordium_V2_BakerElectionVerifyKey: @unchecked Sendable {} -extension Concordium_V2_BakerSignatureVerifyKey: @unchecked Sendable {} -extension Concordium_V2_BakerAggregationVerifyKey: @unchecked Sendable {} -extension Concordium_V2_BakerInfo: @unchecked Sendable {} -extension Concordium_V2_StakePendingChange: @unchecked Sendable {} -extension Concordium_V2_StakePendingChange.OneOf_Change: @unchecked Sendable {} -extension Concordium_V2_StakePendingChange.Reduce: @unchecked Sendable {} -extension Concordium_V2_AmountFraction: @unchecked Sendable {} -extension Concordium_V2_CommissionRates: @unchecked Sendable {} -extension Concordium_V2_BakerPoolInfo: @unchecked Sendable {} -extension Concordium_V2_AccountStakingInfo: @unchecked Sendable {} -extension Concordium_V2_AccountStakingInfo.OneOf_StakingInfo: @unchecked Sendable {} -extension Concordium_V2_AccountStakingInfo.Baker: @unchecked Sendable {} -extension Concordium_V2_AccountStakingInfo.Delegator: @unchecked Sendable {} -extension Concordium_V2_SequenceNumber: @unchecked Sendable {} -extension Concordium_V2_UpdateSequenceNumber: @unchecked Sendable {} -extension Concordium_V2_Amount: @unchecked Sendable {} -extension Concordium_V2_CredentialIndex: @unchecked Sendable {} -extension Concordium_V2_SignatureThreshold: @unchecked Sendable {} -extension Concordium_V2_AccountThreshold: @unchecked Sendable {} -extension Concordium_V2_EncryptionKey: @unchecked Sendable {} -extension Concordium_V2_AccountAddress: @unchecked Sendable {} -extension Concordium_V2_Address: @unchecked Sendable {} -extension Concordium_V2_Address.OneOf_Type: @unchecked Sendable {} -extension Concordium_V2_AccountVerifyKey: @unchecked Sendable {} -extension Concordium_V2_AccountVerifyKey.OneOf_Key: @unchecked Sendable {} -extension Concordium_V2_CredentialPublicKeys: @unchecked Sendable {} -extension Concordium_V2_CredentialRegistrationId: @unchecked Sendable {} -extension Concordium_V2_IdentityProviderIdentity: @unchecked Sendable {} -extension Concordium_V2_YearMonth: @unchecked Sendable {} -extension Concordium_V2_Policy: @unchecked Sendable {} -extension Concordium_V2_InitialCredentialValues: @unchecked Sendable {} -extension Concordium_V2_ChainArData: @unchecked Sendable {} -extension Concordium_V2_ArThreshold: @unchecked Sendable {} -extension Concordium_V2_Commitment: @unchecked Sendable {} -extension Concordium_V2_CredentialCommitments: @unchecked Sendable {} -extension Concordium_V2_NormalCredentialValues: @unchecked Sendable {} -extension Concordium_V2_AccountCredential: @unchecked Sendable {} -extension Concordium_V2_AccountCredential.OneOf_CredentialValues: @unchecked Sendable {} -extension Concordium_V2_AccountInfo: @unchecked Sendable {} -extension Concordium_V2_BlockHashInput: @unchecked Sendable {} -extension Concordium_V2_BlockHashInput.OneOf_BlockHashInput: @unchecked Sendable {} -extension Concordium_V2_BlockHashInput.RelativeHeight: @unchecked Sendable {} -extension Concordium_V2_EpochRequest: @unchecked Sendable {} -extension Concordium_V2_EpochRequest.OneOf_EpochRequestInput: @unchecked Sendable {} -extension Concordium_V2_EpochRequest.RelativeEpoch: @unchecked Sendable {} -extension Concordium_V2_AccountIdentifierInput: @unchecked Sendable {} -extension Concordium_V2_AccountIdentifierInput.OneOf_AccountIdentifierInput: @unchecked Sendable {} -extension Concordium_V2_AccountInfoRequest: @unchecked Sendable {} -extension Concordium_V2_FinalizedBlockInfo: @unchecked Sendable {} -extension Concordium_V2_AncestorsRequest: @unchecked Sendable {} -extension Concordium_V2_ModuleSourceRequest: @unchecked Sendable {} -extension Concordium_V2_ContractAddress: @unchecked Sendable {} -extension Concordium_V2_InstanceInfoRequest: @unchecked Sendable {} -extension Concordium_V2_InstanceInfo: @unchecked Sendable {} -extension Concordium_V2_InstanceInfo.OneOf_Version: @unchecked Sendable {} -extension Concordium_V2_InstanceInfo.V0: @unchecked Sendable {} -extension Concordium_V2_InstanceInfo.V1: @unchecked Sendable {} -extension Concordium_V2_InstanceStateKVPair: @unchecked Sendable {} -extension Concordium_V2_InstanceStateLookupRequest: @unchecked Sendable {} -extension Concordium_V2_InstanceStateValueAtKey: @unchecked Sendable {} -extension Concordium_V2_ReceiveName: @unchecked Sendable {} -extension Concordium_V2_InitName: @unchecked Sendable {} -extension Concordium_V2_Parameter: @unchecked Sendable {} -extension Concordium_V2_ContractStateV0: @unchecked Sendable {} -extension Concordium_V2_BlockItemStatus: @unchecked Sendable {} -extension Concordium_V2_BlockItemStatus.OneOf_Status: @unchecked Sendable {} -extension Concordium_V2_BlockItemStatus.Committed: @unchecked Sendable {} -extension Concordium_V2_BlockItemStatus.Finalized: @unchecked Sendable {} -extension Concordium_V2_BlockItemSummaryInBlock: @unchecked Sendable {} -extension Concordium_V2_Energy: @unchecked Sendable {} -extension Concordium_V2_Slot: @unchecked Sendable {} -extension Concordium_V2_NextAccountSequenceNumber: @unchecked Sendable {} -extension Concordium_V2_Duration: @unchecked Sendable {} -extension Concordium_V2_RejectReason: @unchecked Sendable {} -extension Concordium_V2_RejectReason.OneOf_Reason: @unchecked Sendable {} -extension Concordium_V2_RejectReason.InvalidInitMethod: @unchecked Sendable {} -extension Concordium_V2_RejectReason.InvalidReceiveMethod: @unchecked Sendable {} -extension Concordium_V2_RejectReason.AmountTooLarge: @unchecked Sendable {} -extension Concordium_V2_RejectReason.RejectedInit: @unchecked Sendable {} -extension Concordium_V2_RejectReason.RejectedReceive: @unchecked Sendable {} -extension Concordium_V2_RejectReason.DuplicateCredIds: @unchecked Sendable {} -extension Concordium_V2_RejectReason.NonExistentCredIds: @unchecked Sendable {} -extension Concordium_V2_ContractInitializedEvent: @unchecked Sendable {} -extension Concordium_V2_ContractEvent: @unchecked Sendable {} -extension Concordium_V2_InstanceUpdatedEvent: @unchecked Sendable {} -extension Concordium_V2_ContractTraceElement: @unchecked Sendable {} -extension Concordium_V2_ContractTraceElement.OneOf_Element: @unchecked Sendable {} -extension Concordium_V2_ContractTraceElement.Transferred: @unchecked Sendable {} -extension Concordium_V2_ContractTraceElement.Interrupted: @unchecked Sendable {} -extension Concordium_V2_ContractTraceElement.Resumed: @unchecked Sendable {} -extension Concordium_V2_ContractTraceElement.Upgraded: @unchecked Sendable {} -extension Concordium_V2_BakerKeysEvent: @unchecked Sendable {} -extension Concordium_V2_Memo: @unchecked Sendable {} -extension Concordium_V2_BakerStakeUpdatedData: @unchecked Sendable {} -extension Concordium_V2_EncryptedAmountRemovedEvent: @unchecked Sendable {} -extension Concordium_V2_NewEncryptedAmountEvent: @unchecked Sendable {} -extension Concordium_V2_EncryptedSelfAmountAddedEvent: @unchecked Sendable {} -extension Concordium_V2_RegisteredData: @unchecked Sendable {} -extension Concordium_V2_BakerEvent: @unchecked Sendable {} -extension Concordium_V2_BakerEvent.OneOf_Event: @unchecked Sendable {} -extension Concordium_V2_BakerEvent.BakerAdded: @unchecked Sendable {} -extension Concordium_V2_BakerEvent.BakerStakeIncreased: @unchecked Sendable {} -extension Concordium_V2_BakerEvent.BakerStakeDecreased: @unchecked Sendable {} -extension Concordium_V2_BakerEvent.BakerRestakeEarningsUpdated: @unchecked Sendable {} -extension Concordium_V2_BakerEvent.BakerSetOpenStatus: @unchecked Sendable {} -extension Concordium_V2_BakerEvent.BakerSetMetadataUrl: @unchecked Sendable {} -extension Concordium_V2_BakerEvent.BakerSetTransactionFeeCommission: @unchecked Sendable {} -extension Concordium_V2_BakerEvent.BakerSetBakingRewardCommission: @unchecked Sendable {} -extension Concordium_V2_BakerEvent.BakerSetFinalizationRewardCommission: @unchecked Sendable {} -extension Concordium_V2_DelegatorId: @unchecked Sendable {} -extension Concordium_V2_DelegationEvent: @unchecked Sendable {} -extension Concordium_V2_DelegationEvent.OneOf_Event: @unchecked Sendable {} -extension Concordium_V2_DelegationEvent.DelegationStakeIncreased: @unchecked Sendable {} -extension Concordium_V2_DelegationEvent.DelegationStakeDecreased: @unchecked Sendable {} -extension Concordium_V2_DelegationEvent.DelegationSetRestakeEarnings: @unchecked Sendable {} -extension Concordium_V2_DelegationEvent.DelegationSetDelegationTarget: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionEffects: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionEffects.OneOf_Effect: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionEffects.None: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionEffects.ContractUpdateIssued: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionEffects.AccountTransfer: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionEffects.BakerStakeUpdated: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionEffects.EncryptedAmountTransferred: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionEffects.TransferredToPublic: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionEffects.TransferredWithSchedule: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionEffects.CredentialsUpdated: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionEffects.BakerConfigured: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionEffects.DelegationConfigured: @unchecked Sendable {} -extension Concordium_V2_ElectionDifficulty: @unchecked Sendable {} -extension Concordium_V2_TimeoutParameters: @unchecked Sendable {} -extension Concordium_V2_FinalizationCommitteeParameters: @unchecked Sendable {} -extension Concordium_V2_ConsensusParametersV1: @unchecked Sendable {} -extension Concordium_V2_ExchangeRate: @unchecked Sendable {} -extension Concordium_V2_Ratio: @unchecked Sendable {} -extension Concordium_V2_UpdatePublicKey: @unchecked Sendable {} -extension Concordium_V2_UpdateKeysThreshold: @unchecked Sendable {} -extension Concordium_V2_UpdateKeysIndex: @unchecked Sendable {} -extension Concordium_V2_HigherLevelKeys: @unchecked Sendable {} -extension Concordium_V2_AccessStructure: @unchecked Sendable {} -extension Concordium_V2_AuthorizationsV0: @unchecked Sendable {} -extension Concordium_V2_AuthorizationsV1: @unchecked Sendable {} -extension Concordium_V2_Description: @unchecked Sendable {} -extension Concordium_V2_ArInfo: @unchecked Sendable {} -extension Concordium_V2_ArInfo.ArIdentity: @unchecked Sendable {} -extension Concordium_V2_ArInfo.ArPublicKey: @unchecked Sendable {} -extension Concordium_V2_IpIdentity: @unchecked Sendable {} -extension Concordium_V2_IpInfo: @unchecked Sendable {} -extension Concordium_V2_IpInfo.IpVerifyKey: @unchecked Sendable {} -extension Concordium_V2_IpInfo.IpCdiVerifyKey: @unchecked Sendable {} -extension Concordium_V2_DurationSeconds: @unchecked Sendable {} -extension Concordium_V2_InclusiveRangeAmountFraction: @unchecked Sendable {} -extension Concordium_V2_CommissionRanges: @unchecked Sendable {} -extension Concordium_V2_CapitalBound: @unchecked Sendable {} -extension Concordium_V2_LeverageFactor: @unchecked Sendable {} -extension Concordium_V2_Epoch: @unchecked Sendable {} -extension Concordium_V2_Round: @unchecked Sendable {} -extension Concordium_V2_RewardPeriodLength: @unchecked Sendable {} -extension Concordium_V2_MintRate: @unchecked Sendable {} -extension Concordium_V2_CooldownParametersCpv1: @unchecked Sendable {} -extension Concordium_V2_PoolParametersCpv1: @unchecked Sendable {} -extension Concordium_V2_TimeParametersCpv1: @unchecked Sendable {} -extension Concordium_V2_MintDistributionCpv1: @unchecked Sendable {} -extension Concordium_V2_ProtocolUpdate: @unchecked Sendable {} -extension Concordium_V2_MintDistributionCpv0: @unchecked Sendable {} -extension Concordium_V2_TransactionFeeDistribution: @unchecked Sendable {} -extension Concordium_V2_GasRewards: @unchecked Sendable {} -extension Concordium_V2_GasRewardsCpv2: @unchecked Sendable {} -extension Concordium_V2_BakerStakeThreshold: @unchecked Sendable {} -extension Concordium_V2_RootUpdate: @unchecked Sendable {} -extension Concordium_V2_RootUpdate.OneOf_UpdateType: @unchecked Sendable {} -extension Concordium_V2_Level1Update: @unchecked Sendable {} -extension Concordium_V2_Level1Update.OneOf_UpdateType: @unchecked Sendable {} -extension Concordium_V2_UpdatePayload: @unchecked Sendable {} -extension Concordium_V2_UpdatePayload.OneOf_Payload: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionDetails: @unchecked Sendable {} -extension Concordium_V2_AccountCreationDetails: @unchecked Sendable {} -extension Concordium_V2_TransactionTime: @unchecked Sendable {} -extension Concordium_V2_UpdateDetails: @unchecked Sendable {} -extension Concordium_V2_BlockItemSummary: @unchecked Sendable {} -extension Concordium_V2_BlockItemSummary.OneOf_Details: @unchecked Sendable {} -extension Concordium_V2_BlockItemSummary.TransactionIndex: @unchecked Sendable {} -extension Concordium_V2_GenesisIndex: @unchecked Sendable {} -extension Concordium_V2_ConsensusInfo: @unchecked Sendable {} -extension Concordium_V2_ArrivedBlockInfo: @unchecked Sendable {} -extension Concordium_V2_CryptographicParameters: @unchecked Sendable {} -extension Concordium_V2_BlockInfo: @unchecked Sendable {} -extension Concordium_V2_PoolInfoRequest: @unchecked Sendable {} -extension Concordium_V2_PoolPendingChange: @unchecked Sendable {} -extension Concordium_V2_PoolPendingChange.OneOf_Change: @unchecked Sendable {} -extension Concordium_V2_PoolPendingChange.Reduce: @unchecked Sendable {} -extension Concordium_V2_PoolPendingChange.Remove: @unchecked Sendable {} -extension Concordium_V2_PoolCurrentPaydayInfo: @unchecked Sendable {} -extension Concordium_V2_PoolInfoResponse: @unchecked Sendable {} -extension Concordium_V2_PassiveDelegationInfo: @unchecked Sendable {} -extension Concordium_V2_BlocksAtHeightRequest: @unchecked Sendable {} -extension Concordium_V2_BlocksAtHeightRequest.OneOf_BlocksAtHeight: @unchecked Sendable {} -extension Concordium_V2_BlocksAtHeightRequest.Absolute: @unchecked Sendable {} -extension Concordium_V2_BlocksAtHeightRequest.Relative: @unchecked Sendable {} -extension Concordium_V2_BlocksAtHeightResponse: @unchecked Sendable {} -extension Concordium_V2_TokenomicsInfo: @unchecked Sendable {} -extension Concordium_V2_TokenomicsInfo.OneOf_Tokenomics: @unchecked Sendable {} -extension Concordium_V2_TokenomicsInfo.V0: @unchecked Sendable {} -extension Concordium_V2_TokenomicsInfo.V1: @unchecked Sendable {} -extension Concordium_V2_InvokeInstanceRequest: @unchecked Sendable {} -extension Concordium_V2_InvokeInstanceResponse: @unchecked Sendable {} -extension Concordium_V2_InvokeInstanceResponse.OneOf_Result: @unchecked Sendable {} -extension Concordium_V2_InvokeInstanceResponse.Failure: @unchecked Sendable {} -extension Concordium_V2_InvokeInstanceResponse.Success: @unchecked Sendable {} -extension Concordium_V2_GetPoolDelegatorsRequest: @unchecked Sendable {} -extension Concordium_V2_DelegatorInfo: @unchecked Sendable {} -extension Concordium_V2_DelegatorRewardPeriodInfo: @unchecked Sendable {} -extension Concordium_V2_Branch: @unchecked Sendable {} -extension Concordium_V2_LeadershipElectionNonce: @unchecked Sendable {} -extension Concordium_V2_ElectionInfo: @unchecked Sendable {} -extension Concordium_V2_ElectionInfo.Baker: @unchecked Sendable {} -extension Concordium_V2_BlockSpecialEvent: @unchecked Sendable {} -extension Concordium_V2_BlockSpecialEvent.OneOf_Event: @unchecked Sendable {} -extension Concordium_V2_BlockSpecialEvent.AccountAmounts: @unchecked Sendable {} -extension Concordium_V2_BlockSpecialEvent.AccountAmounts.Entry: @unchecked Sendable {} -extension Concordium_V2_BlockSpecialEvent.BakingRewards: @unchecked Sendable {} -extension Concordium_V2_BlockSpecialEvent.Mint: @unchecked Sendable {} -extension Concordium_V2_BlockSpecialEvent.FinalizationRewards: @unchecked Sendable {} -extension Concordium_V2_BlockSpecialEvent.BlockReward: @unchecked Sendable {} -extension Concordium_V2_BlockSpecialEvent.PaydayFoundationReward: @unchecked Sendable {} -extension Concordium_V2_BlockSpecialEvent.PaydayAccountReward: @unchecked Sendable {} -extension Concordium_V2_BlockSpecialEvent.BlockAccrueReward: @unchecked Sendable {} -extension Concordium_V2_BlockSpecialEvent.PaydayPoolReward: @unchecked Sendable {} -extension Concordium_V2_PendingUpdate: @unchecked Sendable {} -extension Concordium_V2_PendingUpdate.OneOf_Effect: @unchecked Sendable {} -extension Concordium_V2_NextUpdateSequenceNumbers: @unchecked Sendable {} -extension Concordium_V2_IpAddress: @unchecked Sendable {} -extension Concordium_V2_Port: @unchecked Sendable {} -extension Concordium_V2_IpSocketAddress: @unchecked Sendable {} -extension Concordium_V2_PeerId: @unchecked Sendable {} -extension Concordium_V2_BannedPeer: @unchecked Sendable {} -extension Concordium_V2_BannedPeers: @unchecked Sendable {} -extension Concordium_V2_PeerToBan: @unchecked Sendable {} -extension Concordium_V2_DumpRequest: @unchecked Sendable {} -extension Concordium_V2_PeersInfo: @unchecked Sendable {} -extension Concordium_V2_PeersInfo.Peer: @unchecked Sendable {} -extension Concordium_V2_PeersInfo.Peer.OneOf_ConsensusInfo: @unchecked Sendable {} -extension Concordium_V2_PeersInfo.Peer.CatchupStatus: @unchecked Sendable {} -extension Concordium_V2_PeersInfo.Peer.NetworkStats: @unchecked Sendable {} -extension Concordium_V2_NodeInfo: @unchecked Sendable {} -extension Concordium_V2_NodeInfo.OneOf_Details: @unchecked Sendable {} -extension Concordium_V2_NodeInfo.NetworkInfo: @unchecked Sendable {} -extension Concordium_V2_NodeInfo.BakerConsensusInfo: @unchecked Sendable {} -extension Concordium_V2_NodeInfo.BakerConsensusInfo.OneOf_Status: @unchecked Sendable {} -extension Concordium_V2_NodeInfo.BakerConsensusInfo.PassiveCommitteeInfo: @unchecked Sendable {} -extension Concordium_V2_NodeInfo.BakerConsensusInfo.ActiveBakerCommitteeInfo: @unchecked Sendable {} -extension Concordium_V2_NodeInfo.BakerConsensusInfo.ActiveFinalizerCommitteeInfo: @unchecked Sendable {} -extension Concordium_V2_NodeInfo.Node: @unchecked Sendable {} -extension Concordium_V2_NodeInfo.Node.OneOf_ConsensusStatus: @unchecked Sendable {} -extension Concordium_V2_SendBlockItemRequest: @unchecked Sendable {} -extension Concordium_V2_SendBlockItemRequest.OneOf_BlockItem: @unchecked Sendable {} -extension Concordium_V2_CredentialDeployment: @unchecked Sendable {} -extension Concordium_V2_CredentialDeployment.OneOf_Payload: @unchecked Sendable {} -extension Concordium_V2_Signature: @unchecked Sendable {} -extension Concordium_V2_SignatureMap: @unchecked Sendable {} -extension Concordium_V2_AccountSignatureMap: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionSignature: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionHeader: @unchecked Sendable {} -extension Concordium_V2_InitContractPayload: @unchecked Sendable {} -extension Concordium_V2_UpdateContractPayload: @unchecked Sendable {} -extension Concordium_V2_TransferPayload: @unchecked Sendable {} -extension Concordium_V2_TransferWithMemoPayload: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionPayload: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionPayload.OneOf_Payload: @unchecked Sendable {} -extension Concordium_V2_PreAccountTransaction: @unchecked Sendable {} -extension Concordium_V2_AccountTransaction: @unchecked Sendable {} -extension Concordium_V2_UpdateInstructionHeader: @unchecked Sendable {} -extension Concordium_V2_UpdateInstructionPayload: @unchecked Sendable {} -extension Concordium_V2_UpdateInstructionPayload.OneOf_Payload: @unchecked Sendable {} -extension Concordium_V2_UpdateInstruction: @unchecked Sendable {} -extension Concordium_V2_AccountTransactionSignHash: @unchecked Sendable {} -extension Concordium_V2_CredentialsPerBlockLimit: @unchecked Sendable {} -extension Concordium_V2_ChainParametersV0: @unchecked Sendable {} -extension Concordium_V2_ChainParametersV1: @unchecked Sendable {} -extension Concordium_V2_ChainParametersV2: @unchecked Sendable {} -extension Concordium_V2_ChainParameters: @unchecked Sendable {} -extension Concordium_V2_ChainParameters.OneOf_Parameters: @unchecked Sendable {} -extension Concordium_V2_FinalizationSummaryParty: @unchecked Sendable {} -extension Concordium_V2_FinalizationIndex: @unchecked Sendable {} -extension Concordium_V2_FinalizationSummary: @unchecked Sendable {} -extension Concordium_V2_BlockFinalizationSummary: @unchecked Sendable {} -extension Concordium_V2_BlockFinalizationSummary.OneOf_Summary: @unchecked Sendable {} -extension Concordium_V2_BlockItem: @unchecked Sendable {} -extension Concordium_V2_BlockItem.OneOf_BlockItem: @unchecked Sendable {} -extension Concordium_V2_BakerRewardPeriodInfo: @unchecked Sendable {} -extension Concordium_V2_QuorumSignature: @unchecked Sendable {} -extension Concordium_V2_QuorumCertificate: @unchecked Sendable {} -extension Concordium_V2_FinalizerRound: @unchecked Sendable {} -extension Concordium_V2_TimeoutSignature: @unchecked Sendable {} -extension Concordium_V2_TimeoutCertificate: @unchecked Sendable {} -extension Concordium_V2_SuccessorProof: @unchecked Sendable {} -extension Concordium_V2_EpochFinalizationEntry: @unchecked Sendable {} -extension Concordium_V2_BlockCertificates: @unchecked Sendable {} -extension Concordium_V2_WinningBaker: @unchecked Sendable {} -extension Concordium_V2_DryRunRequest: @unchecked Sendable {} -extension Concordium_V2_DryRunRequest.OneOf_Request: @unchecked Sendable {} -extension Concordium_V2_DryRunStateQuery: @unchecked Sendable {} -extension Concordium_V2_DryRunStateQuery.OneOf_Query: @unchecked Sendable {} -extension Concordium_V2_DryRunInvokeInstance: @unchecked Sendable {} -extension Concordium_V2_DryRunStateOperation: @unchecked Sendable {} -extension Concordium_V2_DryRunStateOperation.OneOf_Operation: @unchecked Sendable {} -extension Concordium_V2_DryRunMintToAccount: @unchecked Sendable {} -extension Concordium_V2_DryRunTransaction: @unchecked Sendable {} -extension Concordium_V2_DryRunSignature: @unchecked Sendable {} -extension Concordium_V2_DryRunResponse: @unchecked Sendable {} -extension Concordium_V2_DryRunResponse.OneOf_Response: @unchecked Sendable {} -extension Concordium_V2_DryRunErrorResponse: @unchecked Sendable {} -extension Concordium_V2_DryRunErrorResponse.OneOf_Error: @unchecked Sendable {} -extension Concordium_V2_DryRunErrorResponse.NoState: @unchecked Sendable {} -extension Concordium_V2_DryRunErrorResponse.BlockNotFound: @unchecked Sendable {} -extension Concordium_V2_DryRunErrorResponse.AccountNotFound: @unchecked Sendable {} -extension Concordium_V2_DryRunErrorResponse.InstanceNotFound: @unchecked Sendable {} -extension Concordium_V2_DryRunErrorResponse.AmountOverLimit: @unchecked Sendable {} -extension Concordium_V2_DryRunErrorResponse.BalanceInsufficient: @unchecked Sendable {} -extension Concordium_V2_DryRunErrorResponse.EnergyInsufficient: @unchecked Sendable {} -extension Concordium_V2_DryRunErrorResponse.InvokeFailure: @unchecked Sendable {} -extension Concordium_V2_DryRunSuccessResponse: @unchecked Sendable {} -extension Concordium_V2_DryRunSuccessResponse.OneOf_Response: @unchecked Sendable {} -extension Concordium_V2_DryRunSuccessResponse.BlockStateLoaded: @unchecked Sendable {} -extension Concordium_V2_DryRunSuccessResponse.TimestampSet: @unchecked Sendable {} -extension Concordium_V2_DryRunSuccessResponse.MintedToAccount: @unchecked Sendable {} -extension Concordium_V2_DryRunSuccessResponse.TransactionExecuted: @unchecked Sendable {} -extension Concordium_V2_DryRunSuccessResponse.InvokeSuccess: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) - // MARK: - Code below here is support for the SwiftProtobuf runtime. fileprivate let _protobuf_package = "concordium.v2" @@ -15559,8 +13905,8 @@ extension Concordium_V2_Empty: SwiftProtobuf.Message, SwiftProtobuf._MessageImpl static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + // Load everything into unknown fields + while try decoder.nextFieldNumber() != nil {} } func traverse(visitor: inout V) throws { @@ -17808,6 +16154,62 @@ extension Concordium_V2_AccountCredential: SwiftProtobuf.Message, SwiftProtobuf. } } +extension Concordium_V2_Cooldown: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Cooldown" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "end_time"), + 2: .same(proto: "amount"), + 3: .same(proto: "status"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._endTime) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._amount) }() + case 3: try { try decoder.decodeSingularEnumField(value: &self.status) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._endTime { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._amount { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if self.status != .cooldown { + try visitor.visitSingularEnumField(value: self.status, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Concordium_V2_Cooldown, rhs: Concordium_V2_Cooldown) -> Bool { + if lhs._endTime != rhs._endTime {return false} + if lhs._amount != rhs._amount {return false} + if lhs.status != rhs.status {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Concordium_V2_Cooldown.CooldownStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "COOLDOWN"), + 1: .same(proto: "PRE_COOLDOWN"), + 2: .same(proto: "PRE_PRE_COOLDOWN"), + ] +} + extension Concordium_V2_AccountInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".AccountInfo" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ @@ -17821,6 +16223,8 @@ extension Concordium_V2_AccountInfo: SwiftProtobuf.Message, SwiftProtobuf._Messa 8: .same(proto: "index"), 9: .same(proto: "stake"), 10: .same(proto: "address"), + 11: .same(proto: "cooldowns"), + 12: .standard(proto: "available_balance"), ] fileprivate class _StorageClass { @@ -17834,8 +16238,18 @@ extension Concordium_V2_AccountInfo: SwiftProtobuf.Message, SwiftProtobuf._Messa var _index: Concordium_V2_AccountIndex? = nil var _stake: Concordium_V2_AccountStakingInfo? = nil var _address: Concordium_V2_AccountAddress? = nil - - static let defaultInstance = _StorageClass() + var _cooldowns: [Concordium_V2_Cooldown] = [] + var _availableBalance: Concordium_V2_Amount? = nil + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif private init() {} @@ -17850,6 +16264,8 @@ extension Concordium_V2_AccountInfo: SwiftProtobuf.Message, SwiftProtobuf._Messa _index = source._index _stake = source._stake _address = source._address + _cooldowns = source._cooldowns + _availableBalance = source._availableBalance } } @@ -17878,6 +16294,8 @@ extension Concordium_V2_AccountInfo: SwiftProtobuf.Message, SwiftProtobuf._Messa case 8: try { try decoder.decodeSingularMessageField(value: &_storage._index) }() case 9: try { try decoder.decodeSingularMessageField(value: &_storage._stake) }() case 10: try { try decoder.decodeSingularMessageField(value: &_storage._address) }() + case 11: try { try decoder.decodeRepeatedMessageField(value: &_storage._cooldowns) }() + case 12: try { try decoder.decodeSingularMessageField(value: &_storage._availableBalance) }() default: break } } @@ -17920,6 +16338,12 @@ extension Concordium_V2_AccountInfo: SwiftProtobuf.Message, SwiftProtobuf._Messa try { if let v = _storage._address { try visitor.visitSingularMessageField(value: v, fieldNumber: 10) } }() + if !_storage._cooldowns.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._cooldowns, fieldNumber: 11) + } + try { if let v = _storage._availableBalance { + try visitor.visitSingularMessageField(value: v, fieldNumber: 12) + } }() } try unknownFields.traverse(visitor: &visitor) } @@ -17939,6 +16363,8 @@ extension Concordium_V2_AccountInfo: SwiftProtobuf.Message, SwiftProtobuf._Messa if _storage._index != rhs_storage._index {return false} if _storage._stake != rhs_storage._stake {return false} if _storage._address != rhs_storage._address {return false} + if _storage._cooldowns != rhs_storage._cooldowns {return false} + if _storage._availableBalance != rhs_storage._availableBalance {return false} return true } if !storagesAreEqual {return false} @@ -21438,6 +19864,7 @@ extension Concordium_V2_BakerEvent: SwiftProtobuf.Message, SwiftProtobuf._Messag 9: .standard(proto: "baker_set_transaction_fee_commission"), 10: .standard(proto: "baker_set_baking_reward_commission"), 11: .standard(proto: "baker_set_finalization_reward_commission"), + 12: .standard(proto: "delegation_removed"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -21589,6 +20016,19 @@ extension Concordium_V2_BakerEvent: SwiftProtobuf.Message, SwiftProtobuf._Messag self.event = .bakerSetFinalizationRewardCommission(v) } }() + case 12: try { + var v: Concordium_V2_BakerEvent.DelegationRemoved? + var hadOneofValue = false + if let current = self.event { + hadOneofValue = true + if case .delegationRemoved(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.event = .delegationRemoved(v) + } + }() default: break } } @@ -21644,6 +20084,10 @@ extension Concordium_V2_BakerEvent: SwiftProtobuf.Message, SwiftProtobuf._Messag guard case .bakerSetFinalizationRewardCommission(let v)? = self.event else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 11) }() + case .delegationRemoved?: try { + guard case .delegationRemoved(let v)? = self.event else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 12) + }() case nil: break } try unknownFields.traverse(visitor: &visitor) @@ -22040,6 +20484,42 @@ extension Concordium_V2_BakerEvent.BakerSetFinalizationRewardCommission: SwiftPr } } +extension Concordium_V2_BakerEvent.DelegationRemoved: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Concordium_V2_BakerEvent.protoMessageName + ".DelegationRemoved" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "delegator_id"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._delegatorID) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._delegatorID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Concordium_V2_BakerEvent.DelegationRemoved, rhs: Concordium_V2_BakerEvent.DelegationRemoved) -> Bool { + if lhs._delegatorID != rhs._delegatorID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + extension Concordium_V2_DelegatorId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".DelegatorId" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ @@ -22085,6 +20565,7 @@ extension Concordium_V2_DelegationEvent: SwiftProtobuf.Message, SwiftProtobuf._M 4: .standard(proto: "delegation_set_delegation_target"), 5: .standard(proto: "delegation_added"), 6: .standard(proto: "delegation_removed"), + 7: .standard(proto: "baker_removed"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -22171,6 +20652,19 @@ extension Concordium_V2_DelegationEvent: SwiftProtobuf.Message, SwiftProtobuf._M self.event = .delegationRemoved(v) } }() + case 7: try { + var v: Concordium_V2_DelegationEvent.BakerRemoved? + var hadOneofValue = false + if let current = self.event { + hadOneofValue = true + if case .bakerRemoved(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.event = .bakerRemoved(v) + } + }() default: break } } @@ -22206,6 +20700,10 @@ extension Concordium_V2_DelegationEvent: SwiftProtobuf.Message, SwiftProtobuf._M guard case .delegationRemoved(let v)? = self.event else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 6) }() + case .bakerRemoved?: try { + guard case .bakerRemoved(let v)? = self.event else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + }() case nil: break } try unknownFields.traverse(visitor: &visitor) @@ -22386,6 +20884,42 @@ extension Concordium_V2_DelegationEvent.DelegationSetDelegationTarget: SwiftProt } } +extension Concordium_V2_DelegationEvent.BakerRemoved: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Concordium_V2_DelegationEvent.protoMessageName + ".BakerRemoved" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "baker_id"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._bakerID) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._bakerID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Concordium_V2_DelegationEvent.BakerRemoved, rhs: Concordium_V2_DelegationEvent.BakerRemoved) -> Bool { + if lhs._bakerID != rhs._bakerID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + extension Concordium_V2_AccountTransactionEffects: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".AccountTransactionEffects" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ @@ -23637,7 +22171,15 @@ extension Concordium_V2_AuthorizationsV0: SwiftProtobuf.Message, SwiftProtobuf._ var _addAnonymityRevoker: Concordium_V2_AccessStructure? = nil var _addIdentityProvider: Concordium_V2_AccessStructure? = nil - static let defaultInstance = _StorageClass() + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif private init() {} @@ -25745,7 +24287,15 @@ extension Concordium_V2_BlockItemSummary: SwiftProtobuf.Message, SwiftProtobuf._ var _hash: Concordium_V2_TransactionHash? = nil var _details: Concordium_V2_BlockItemSummary.OneOf_Details? - static let defaultInstance = _StorageClass() + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif private init() {} @@ -26011,7 +24561,15 @@ extension Concordium_V2_ConsensusInfo: SwiftProtobuf.Message, SwiftProtobuf._Mes var _currentEpoch: Concordium_V2_Epoch? = nil var _triggerBlockTime: Concordium_V2_Timestamp? = nil - static let defaultInstance = _StorageClass() + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif private init() {} @@ -26144,10 +24702,10 @@ extension Concordium_V2_ConsensusInfo: SwiftProtobuf.Message, SwiftProtobuf._Mes try { if let v = _storage._blockLastReceivedTime { try visitor.visitSingularMessageField(value: v, fieldNumber: 10) } }() - if _storage._blockReceiveLatencyEma != 0 { + if _storage._blockReceiveLatencyEma.bitPattern != 0 { try visitor.visitSingularDoubleField(value: _storage._blockReceiveLatencyEma, fieldNumber: 11) } - if _storage._blockReceiveLatencyEmsd != 0 { + if _storage._blockReceiveLatencyEmsd.bitPattern != 0 { try visitor.visitSingularDoubleField(value: _storage._blockReceiveLatencyEmsd, fieldNumber: 12) } try { if let v = _storage._blockReceivePeriodEma { @@ -26162,10 +24720,10 @@ extension Concordium_V2_ConsensusInfo: SwiftProtobuf.Message, SwiftProtobuf._Mes try { if let v = _storage._blockLastArrivedTime { try visitor.visitSingularMessageField(value: v, fieldNumber: 16) } }() - if _storage._blockArriveLatencyEma != 0 { + if _storage._blockArriveLatencyEma.bitPattern != 0 { try visitor.visitSingularDoubleField(value: _storage._blockArriveLatencyEma, fieldNumber: 17) } - if _storage._blockArriveLatencyEmsd != 0 { + if _storage._blockArriveLatencyEmsd.bitPattern != 0 { try visitor.visitSingularDoubleField(value: _storage._blockArriveLatencyEmsd, fieldNumber: 18) } try { if let v = _storage._blockArrivePeriodEma { @@ -26174,10 +24732,10 @@ extension Concordium_V2_ConsensusInfo: SwiftProtobuf.Message, SwiftProtobuf._Mes try { if let v = _storage._blockArrivePeriodEmsd { try visitor.visitSingularDoubleField(value: v, fieldNumber: 20) } }() - if _storage._transactionsPerBlockEma != 0 { + if _storage._transactionsPerBlockEma.bitPattern != 0 { try visitor.visitSingularDoubleField(value: _storage._transactionsPerBlockEma, fieldNumber: 21) } - if _storage._transactionsPerBlockEmsd != 0 { + if _storage._transactionsPerBlockEmsd.bitPattern != 0 { try visitor.visitSingularDoubleField(value: _storage._transactionsPerBlockEmsd, fieldNumber: 22) } if _storage._finalizationCount != 0 { @@ -26399,7 +24957,15 @@ extension Concordium_V2_BlockInfo: SwiftProtobuf.Message, SwiftProtobuf._Message var _round: Concordium_V2_Round? = nil var _epoch: Concordium_V2_Epoch? = nil - static let defaultInstance = _StorageClass() + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif private init() {} @@ -26805,7 +25371,7 @@ extension Concordium_V2_PoolCurrentPaydayInfo: SwiftProtobuf.Message, SwiftProto try { if let v = self._effectiveStake { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) } }() - if self.lotteryPower != 0 { + if self.lotteryPower.bitPattern != 0 { try visitor.visitSingularDoubleField(value: self.lotteryPower, fieldNumber: 5) } try { if let v = self._bakerEquityCapital { @@ -26859,7 +25425,15 @@ extension Concordium_V2_PoolInfoResponse: SwiftProtobuf.Message, SwiftProtobuf._ var _currentPaydayInfo: Concordium_V2_PoolCurrentPaydayInfo? = nil var _allPoolTotalCapital: Concordium_V2_Amount? = nil - static let defaultInstance = _StorageClass() + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif private init() {} @@ -27963,7 +26537,7 @@ extension Concordium_V2_ElectionInfo.Baker: SwiftProtobuf.Message, SwiftProtobuf try { if let v = self._account { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) } }() - if self.lotteryPower != 0 { + if self.lotteryPower.bitPattern != 0 { try visitor.visitSingularDoubleField(value: self.lotteryPower, fieldNumber: 3) } try unknownFields.traverse(visitor: &visitor) @@ -29181,7 +27755,15 @@ extension Concordium_V2_NextUpdateSequenceNumbers: SwiftProtobuf.Message, SwiftP var _blockEnergyLimit: Concordium_V2_SequenceNumber? = nil var _finalizationCommitteeParameters: Concordium_V2_SequenceNumber? = nil - static let defaultInstance = _StorageClass() + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif private init() {} @@ -30057,8 +28639,8 @@ extension Concordium_V2_NodeInfo.BakerConsensusInfo.ActiveBakerCommitteeInfo: Sw static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + // Load everything into unknown fields + while try decoder.nextFieldNumber() != nil {} } func traverse(visitor: inout V) throws { @@ -30076,8 +28658,8 @@ extension Concordium_V2_NodeInfo.BakerConsensusInfo.ActiveFinalizerCommitteeInfo static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + // Load everything into unknown fields + while try decoder.nextFieldNumber() != nil {} } func traverse(visitor: inout V) throws { @@ -31176,7 +29758,15 @@ extension Concordium_V2_ChainParametersV0: SwiftProtobuf.Message, SwiftProtobuf. var _level1Keys: Concordium_V2_HigherLevelKeys? = nil var _level2Keys: Concordium_V2_AuthorizationsV0? = nil - static let defaultInstance = _StorageClass() + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif private init() {} @@ -31342,7 +29932,15 @@ extension Concordium_V2_ChainParametersV1: SwiftProtobuf.Message, SwiftProtobuf. var _level1Keys: Concordium_V2_HigherLevelKeys? = nil var _level2Keys: Concordium_V2_AuthorizationsV1? = nil - static let defaultInstance = _StorageClass() + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif private init() {} @@ -31516,7 +30114,15 @@ extension Concordium_V2_ChainParametersV2: SwiftProtobuf.Message, SwiftProtobuf. var _level2Keys: Concordium_V2_AuthorizationsV1? = nil var _finalizationCommitteeParameters: Concordium_V2_FinalizationCommitteeParameters? = nil - static let defaultInstance = _StorageClass() + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif private init() {} @@ -32430,7 +31036,15 @@ extension Concordium_V2_BlockCertificates: SwiftProtobuf.Message, SwiftProtobuf. var _timeoutCertificate: Concordium_V2_TimeoutCertificate? = nil var _epochFinalizationEntry: Concordium_V2_EpochFinalizationEntry? = nil - static let defaultInstance = _StorageClass() + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif private init() {} @@ -33272,8 +31886,8 @@ extension Concordium_V2_DryRunErrorResponse.NoState: SwiftProtobuf.Message, Swif static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + // Load everything into unknown fields + while try decoder.nextFieldNumber() != nil {} } func traverse(visitor: inout V) throws { @@ -33291,8 +31905,8 @@ extension Concordium_V2_DryRunErrorResponse.BlockNotFound: SwiftProtobuf.Message static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + // Load everything into unknown fields + while try decoder.nextFieldNumber() != nil {} } func traverse(visitor: inout V) throws { @@ -33310,8 +31924,8 @@ extension Concordium_V2_DryRunErrorResponse.AccountNotFound: SwiftProtobuf.Messa static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + // Load everything into unknown fields + while try decoder.nextFieldNumber() != nil {} } func traverse(visitor: inout V) throws { @@ -33329,8 +31943,8 @@ extension Concordium_V2_DryRunErrorResponse.InstanceNotFound: SwiftProtobuf.Mess static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + // Load everything into unknown fields + while try decoder.nextFieldNumber() != nil {} } func traverse(visitor: inout V) throws { @@ -33718,8 +32332,8 @@ extension Concordium_V2_DryRunSuccessResponse.TimestampSet: SwiftProtobuf.Messag static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + // Load everything into unknown fields + while try decoder.nextFieldNumber() != nil {} } func traverse(visitor: inout V) throws { @@ -33737,8 +32351,8 @@ extension Concordium_V2_DryRunSuccessResponse.MintedToAccount: SwiftProtobuf.Mes static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + // Load everything into unknown fields + while try decoder.nextFieldNumber() != nil {} } func traverse(visitor: inout V) throws { From 10938ac0b61dd5db0a523bb0f3c4b00e614689ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Zeppelin?= Date: Thu, 3 Oct 2024 13:49:43 +0200 Subject: [PATCH 3/5] Adapt types to GRPC changes --- Sources/Concordium/Domain/Account.swift | 102 +++++++++++++++++++++++- Sources/Concordium/Domain/Events.swift | 6 ++ Sources/Concordium/Domain/Queries.swift | 20 +++-- 3 files changed, 117 insertions(+), 11 deletions(-) diff --git a/Sources/Concordium/Domain/Account.swift b/Sources/Concordium/Domain/Account.swift index 8ecfe0b..2f75711 100644 --- a/Sources/Concordium/Domain/Account.swift +++ b/Sources/Concordium/Domain/Account.swift @@ -847,12 +847,72 @@ public enum AccountStakingInfo: FromGRPC { } } +/// Describes a cooldown associated with removal of stake from a baker/delegator account +public struct Cooldown { + /// The time at which the cooldown will end + public let timestamp: Date + /// The amount that is in cooldown and set to be released at the end of the cooldown period + public let amount: CCD + /// The status of the cooldown + public let status: Status + + /** + * The status of a cooldown. When stake is removed from a baker or delegator + * (from protocol version 7) it first enters the pre-pre-cooldown state. + * The next time the stake snaphot is taken (at the epoch transition before + * a payday) it enters the pre-cooldown state. At the subsequent payday, it + * enters the cooldown state. At the payday after the end of the cooldown + * period, the stake is finally released. + */ + public enum Status { + /** + * The amount is in cooldown and will expire at the specified time, becoming available + * at the subsequent pay day. + */ + case cooldown + /** + * The amount will enter cooldown at the next pay day. The specified end time is + * projected to be the end of the cooldown period, but the actual end time will be + * determined at the payday, and may be different if the global cooldown period + * changes. + */ + case preCooldown + /** + * The amount will enter pre-cooldown at the next snapshot epoch (i.e. the epoch + * transition before a pay day transition). As with pre-cooldown, the specified + * end time is projected, but the actual end time will be determined later. + */ + case prePreCooldown + } +} + +extension Cooldown.Status: FromGRPC { + static func fromGRPC(_ g: Concordium_V2_Cooldown.CooldownStatus) throws -> Self { + switch g { + case .cooldown: + return .cooldown + case .preCooldown: + return .preCooldown + case .prePreCooldown: + return .prePreCooldown + case .UNRECOGNIZED(_): + throw GRPCError.valueOutOfBounds + } + } +} + +extension Cooldown: FromGRPC { + static func fromGRPC(_ g: Concordium_V2_Cooldown) throws -> Self { + return Self(timestamp: .fromGRPC(g.endTime), amount: try .fromGRPC(g.amount), status: try .fromGRPC(g.status)) + } +} + /// Information about the account at a particular point in time on chain. public struct AccountInfo: FromGRPC { /// Next sequence number to be used for transactions signed from this account. public var sequenceNumber: SequenceNumber /// Current (unencrypted) balance of the account. - public var amount: MicroCCDAmount + public var amount: CCD /// Release schedule for any locked up amount. This could be an empty release schedule. public var releaseSchedule: ReleaseSchedule /// Map of all currently active credentials on the account. @@ -879,12 +939,46 @@ public struct AccountInfo: FromGRPC { /// Canonical address of the account. /// This is derived from the first credential that created the account. public var address: AccountAddress + /** + * The stake on the account that is in cooldown. + * There can be multiple amounts in cooldown that expire at different times. + * This was introduced in protocol version 7, and will be empty in + * earlier protocol versions. + */ + public var cooldowns: [Cooldown] + /** + * The available (unencrypted) balance of the account (i.e. that can be transferred + * or used to pay for transactions). This is the balance minus the locked amount. + * The locked amount is the maximum of the amount in the release schedule and + * the total amount that is actively staked or in cooldown (inactive stake). + * This was introduced with node version 7.0 + */ + public var availableBalance: CCD static func fromGRPC(_ grpc: Concordium_V2_AccountInfo) throws -> Self { let credentials = try grpc.creds.reduce(into: [:]) { r, v in r[UInt8(v.key)] = try Versioned(version: 0, value: AccountCredentialDeploymentValues.fromGRPC(v.value)) } + let releaseSchedule = try ReleaseSchedule.fromGRPC(grpc.schedule) + var availableBalance: CCD + if (grpc.hasAvailableBalance) { + /// present for node version >=7 + availableBalance = try .fromGRPC(grpc.availableBalance) + } else { + /// Node version <7 + var staked: MicroCCDAmount = 0 + if let stakingInfo = grpc.stake.stakingInfo { + switch stakingInfo { + case let .baker(data): + staked = data.stakedAmount.value + case let .delegator(data): + staked = data.stakedAmount.value + } + } + availableBalance = CCD(microCCD: grpc.amount.value - max(releaseSchedule.total, staked)) + } + return try self.init( sequenceNumber: grpc.sequenceNumber.value, - amount: grpc.amount.value, + amount: .fromGRPC(grpc.amount), releaseSchedule: .fromGRPC(grpc.schedule), credentials: credentials, threshold: SignatureThreshold(exactly: grpc.threshold.value) ?! GRPCError.valueOutOfBounds, @@ -892,7 +986,9 @@ public struct AccountInfo: FromGRPC { encryptionKey: grpc.encryptionKey.value, index: grpc.index.value, stake: grpc.hasStake ? .fromGRPC(grpc.stake) : nil, - address: AccountAddress(grpc.address.value) + address: AccountAddress(grpc.address.value), + cooldowns: try grpc.cooldowns.map({try Cooldown.fromGRPC($0)}), + availableBalance: availableBalance ) } } diff --git a/Sources/Concordium/Domain/Events.swift b/Sources/Concordium/Domain/Events.swift index b7857a5..2793233 100644 --- a/Sources/Concordium/Domain/Events.swift +++ b/Sources/Concordium/Domain/Events.swift @@ -114,6 +114,7 @@ public enum DelegationEvent { case delegationStakeDecreased(delegatorId: AccountIndex, newStake: CCD) case delegationSetRestakeEarnings(delegatorId: AccountIndex, restakeEarnings: Bool) case delegationSetDelegationTarget(delegatorId: AccountIndex, delegationTarget: DelegationTarget) + case bakerRemoved(bakerId: AccountIndex) } extension DelegationEvent: FromGRPC { @@ -134,6 +135,8 @@ extension DelegationEvent: FromGRPC { return try .delegationStakeDecreased(delegatorId: data.delegatorID.id.value, newStake: .fromGRPC(data.newStake)) case let .delegationStakeIncreased(data): return try .delegationStakeIncreased(delegatorId: data.delegatorID.id.value, newStake: .fromGRPC(data.newStake)) + case let .bakerRemoved(data): + return .bakerRemoved(bakerId: data.bakerID.value) } } } @@ -173,6 +176,7 @@ public enum BakerEvent { case bakerSetTransactionFeeCommission(bakerId: AccountIndex, commission: AmountFraction) case bakerSetBakingRewardCommission(bakerId: AccountIndex, commission: AmountFraction) case bakerSetFinalizationRewardCommission(bakerId: AccountIndex, commission: AmountFraction) + case delegatorRemoved(delegatorId: AccountIndex) } extension BakerEvent: FromGRPC { @@ -203,6 +207,8 @@ extension BakerEvent: FromGRPC { return try .bakerSetOpenStatus(bakerId: data.bakerID.value, openStatus: .fromGRPC(data.openStatus)) case let .bakerSetMetadataURL(data): return .bakerSetMetadataUrl(bakerId: data.bakerID.value, metadataUrl: data.url) + case let .delegationRemoved(data): + return .delegatorRemoved(delegatorId: data.delegatorID.id.value) } } } diff --git a/Sources/Concordium/Domain/Queries.swift b/Sources/Concordium/Domain/Queries.swift index 188cbf2..8497a8a 100644 --- a/Sources/Concordium/Domain/Queries.swift +++ b/Sources/Concordium/Domain/Queries.swift @@ -1343,15 +1343,15 @@ public struct BakerPoolStatus { /// The account address of the pool owner. public let bakerAddress: AccountAddress /// The equity capital provided by the pool owner. - public let bakerEquityCapital: CCD + public let bakerEquityCapital: CCD? /// The capital delegated to the pool by other accounts. - public let delegatedCapital: CCD + public let delegatedCapital: CCD? /// The maximum amount that may be delegated to the pool, accounting for /// leverage and stake limits. - public let delegatedCapitalCap: CCD + public let delegatedCapitalCap: CCD? /// The pool info associated with the pool: open status, metadata URL /// and commission rates. - public let poolInfo: BakerPoolInfo + public let poolInfo: BakerPoolInfo? /// Any pending change to the baker's stake. public let bakerStakePendingChange: PoolPendingChange /// Status of the pool in the current reward period. This will be [`None`] @@ -1366,14 +1366,18 @@ extension BakerPoolStatus: FromGRPC { typealias GRPC = Concordium_V2_PoolInfoResponse static func fromGRPC(_ g: GRPC) throws -> BakerPoolStatus { + let bakerEquityCapital = g.hasEquityCapital ? try CCD.fromGRPC(g.equityCapital) : nil + let delegatedCapital = g.hasDelegatedCapital ? try CCD.fromGRPC(g.delegatedCapital) : nil + let delegatedCapitalCap = g.hasDelegatedCapitalCap ? try CCD.fromGRPC(g.delegatedCapitalCap) : nil + let poolInfo = g.hasPoolInfo ? try BakerPoolInfo.fromGRPC(g.poolInfo) : nil let currentPaydayStatus = g.hasCurrentPaydayInfo ? try CurrentPaydayBakerPoolStatus.fromGRPC(g.currentPaydayInfo) : nil return try Self( bakerId: g.baker.value, bakerAddress: .fromGRPC(g.address), - bakerEquityCapital: .fromGRPC(g.equityCapital), - delegatedCapital: .fromGRPC(g.delegatedCapital), - delegatedCapitalCap: .fromGRPC(g.delegatedCapitalCap), - poolInfo: .fromGRPC(g.poolInfo), + bakerEquityCapital: bakerEquityCapital, + delegatedCapital: delegatedCapital, + delegatedCapitalCap: delegatedCapitalCap, + poolInfo: poolInfo, bakerStakePendingChange: .fromGRPC(g.equityPendingChange), currentPaydayStatus: currentPaydayStatus, allPoolTotalCapital: .fromGRPC(g.allPoolTotalCapital) From 1d28d77bd0843551715443163995105535dbb07e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Zeppelin?= Date: Thu, 3 Oct 2024 14:10:59 +0200 Subject: [PATCH 4/5] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 609fdcf..db5917b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Return type of `NodeClient.send` to `SubmittedTransaction` to provide ergonomics for working with transaction submitted to chain. - Representation of raw data is changed from hex strings to `Data` across all functions and data structures +- Updated a number of types to conform to the changes introduced to the GRPC API in concordium node version 7 ## [0.1.1] - 2024-04-29 From 3967e8431f1fbbe1aac55ce11119071ca4c3080b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Zeppelin?= Date: Thu, 3 Oct 2024 14:16:00 +0200 Subject: [PATCH 5/5] FMT --- Sources/Concordium/Domain/Account.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/Concordium/Domain/Account.swift b/Sources/Concordium/Domain/Account.swift index 2f75711..3c1d704 100644 --- a/Sources/Concordium/Domain/Account.swift +++ b/Sources/Concordium/Domain/Account.swift @@ -895,7 +895,7 @@ extension Cooldown.Status: FromGRPC { return .preCooldown case .prePreCooldown: return .prePreCooldown - case .UNRECOGNIZED(_): + case .UNRECOGNIZED: throw GRPCError.valueOutOfBounds } } @@ -903,7 +903,7 @@ extension Cooldown.Status: FromGRPC { extension Cooldown: FromGRPC { static func fromGRPC(_ g: Concordium_V2_Cooldown) throws -> Self { - return Self(timestamp: .fromGRPC(g.endTime), amount: try .fromGRPC(g.amount), status: try .fromGRPC(g.status)) + try Self(timestamp: .fromGRPC(g.endTime), amount: .fromGRPC(g.amount), status: .fromGRPC(g.status)) } } @@ -959,7 +959,7 @@ public struct AccountInfo: FromGRPC { let credentials = try grpc.creds.reduce(into: [:]) { r, v in r[UInt8(v.key)] = try Versioned(version: 0, value: AccountCredentialDeploymentValues.fromGRPC(v.value)) } let releaseSchedule = try ReleaseSchedule.fromGRPC(grpc.schedule) var availableBalance: CCD - if (grpc.hasAvailableBalance) { + if grpc.hasAvailableBalance { /// present for node version >=7 availableBalance = try .fromGRPC(grpc.availableBalance) } else { @@ -975,7 +975,7 @@ public struct AccountInfo: FromGRPC { } availableBalance = CCD(microCCD: grpc.amount.value - max(releaseSchedule.total, staked)) } - + return try self.init( sequenceNumber: grpc.sequenceNumber.value, amount: .fromGRPC(grpc.amount), @@ -987,7 +987,7 @@ public struct AccountInfo: FromGRPC { index: grpc.index.value, stake: grpc.hasStake ? .fromGRPC(grpc.stake) : nil, address: AccountAddress(grpc.address.value), - cooldowns: try grpc.cooldowns.map({try Cooldown.fromGRPC($0)}), + cooldowns: grpc.cooldowns.map { try Cooldown.fromGRPC($0) }, availableBalance: availableBalance ) }