From adefa7624ed3a0ad1a4b1f36da4aeb54f832b02b Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Fri, 28 Jul 2023 13:10:58 +0200 Subject: [PATCH 1/2] Fix baking and delegation on P6 (cherry picked from commit 5530963f52806ac09966eb4e2f1ad9582bd4aed0) --- ConcordiumWallet/Model/AutoGenerated/GASRewards.swift | 8 ++------ .../Model/AutoGenerated/MakeCreateTransferRequest.swift | 4 ++-- ConcordiumWallet/Service/MobileWallet.swift | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ConcordiumWallet/Model/AutoGenerated/GASRewards.swift b/ConcordiumWallet/Model/AutoGenerated/GASRewards.swift index de7171d6..7dad694d 100644 --- a/ConcordiumWallet/Model/AutoGenerated/GASRewards.swift +++ b/ConcordiumWallet/Model/AutoGenerated/GASRewards.swift @@ -10,13 +10,11 @@ struct GASRewards: Codable { let chainUpdate: Double let accountCreation: Double let baker: Double - let finalizationProof: Double enum CodingKeys: String, CodingKey { case chainUpdate = "chainUpdate" case accountCreation = "accountCreation" case baker = "baker" - case finalizationProof = "finalizationProof" } } @@ -41,14 +39,12 @@ extension GASRewards { func with( chainUpdate: Double? = nil, accountCreation: Double? = nil, - baker: Double? = nil, - finalizationProof: Double? = nil + baker: Double? = nil ) -> GASRewards { return GASRewards( chainUpdate: chainUpdate ?? self.chainUpdate, accountCreation: accountCreation ?? self.accountCreation, - baker: baker ?? self.baker, - finalizationProof: finalizationProof ?? self.finalizationProof + baker: baker ?? self.baker ) } diff --git a/ConcordiumWallet/Model/AutoGenerated/MakeCreateTransferRequest.swift b/ConcordiumWallet/Model/AutoGenerated/MakeCreateTransferRequest.swift index 77ff9943..4f9186f7 100644 --- a/ConcordiumWallet/Model/AutoGenerated/MakeCreateTransferRequest.swift +++ b/ConcordiumWallet/Model/AutoGenerated/MakeCreateTransferRequest.swift @@ -19,7 +19,7 @@ struct MakeCreateTransferRequest: Codable { let metadataURL: String? let transactionFeeCommission: Double? let bakingRewardCommission: Double? - let finalizationRewardCommission: Double? + let finalizationRewardCommission: String? let bakerKeys: GeneratedBakerKeys? let keys: AccountKeys? let energy: Int? @@ -85,7 +85,7 @@ extension MakeCreateTransferRequest { metadataURL: String?? = nil, transactionFeeCommission: Double?? = nil, bakingRewardCommission: Double?? = nil, - finalizationRewardCommission: Double?? = nil, + finalizationRewardCommission: String?? = nil, bakerKeys: GeneratedBakerKeys?? = nil, keys: AccountKeys?? = nil, energy: Int?? = nil, diff --git a/ConcordiumWallet/Service/MobileWallet.swift b/ConcordiumWallet/Service/MobileWallet.swift index 33a5c5cd..4917f5f8 100644 --- a/ConcordiumWallet/Service/MobileWallet.swift +++ b/ConcordiumWallet/Service/MobileWallet.swift @@ -260,7 +260,7 @@ class MobileWallet: MobileWalletProtocol { metadataURL: metadataURL, transactionFeeCommission: transactionFeeCommission, bakingRewardCommission: bakingRewardCommission, - finalizationRewardCommission: finalizationRewardCommission, + finalizationRewardCommission: finalizationRewardCommission?.string, bakerKeys: bakerKeys, keys: privateAccountKeys, energy: energy, From fb54445f3141f4a1ed941efa0606a01661839c49 Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Fri, 28 Jul 2023 15:02:28 +0200 Subject: [PATCH 2/2] Revert change for translating commissions from doubles into strings The change don't work for the version of the crypto libs used in the legacy wallet. In the test we also didn't run into any errors related to this. --- .../Model/AutoGenerated/MakeCreateTransferRequest.swift | 4 ++-- ConcordiumWallet/Service/MobileWallet.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ConcordiumWallet/Model/AutoGenerated/MakeCreateTransferRequest.swift b/ConcordiumWallet/Model/AutoGenerated/MakeCreateTransferRequest.swift index 4f9186f7..77ff9943 100644 --- a/ConcordiumWallet/Model/AutoGenerated/MakeCreateTransferRequest.swift +++ b/ConcordiumWallet/Model/AutoGenerated/MakeCreateTransferRequest.swift @@ -19,7 +19,7 @@ struct MakeCreateTransferRequest: Codable { let metadataURL: String? let transactionFeeCommission: Double? let bakingRewardCommission: Double? - let finalizationRewardCommission: String? + let finalizationRewardCommission: Double? let bakerKeys: GeneratedBakerKeys? let keys: AccountKeys? let energy: Int? @@ -85,7 +85,7 @@ extension MakeCreateTransferRequest { metadataURL: String?? = nil, transactionFeeCommission: Double?? = nil, bakingRewardCommission: Double?? = nil, - finalizationRewardCommission: String?? = nil, + finalizationRewardCommission: Double?? = nil, bakerKeys: GeneratedBakerKeys?? = nil, keys: AccountKeys?? = nil, energy: Int?? = nil, diff --git a/ConcordiumWallet/Service/MobileWallet.swift b/ConcordiumWallet/Service/MobileWallet.swift index 4917f5f8..33a5c5cd 100644 --- a/ConcordiumWallet/Service/MobileWallet.swift +++ b/ConcordiumWallet/Service/MobileWallet.swift @@ -260,7 +260,7 @@ class MobileWallet: MobileWalletProtocol { metadataURL: metadataURL, transactionFeeCommission: transactionFeeCommission, bakingRewardCommission: bakingRewardCommission, - finalizationRewardCommission: finalizationRewardCommission?.string, + finalizationRewardCommission: finalizationRewardCommission, bakerKeys: bakerKeys, keys: privateAccountKeys, energy: energy,