From d247d9b30f8a7c75aefa1e6e3d5c895f910c6985 Mon Sep 17 00:00:00 2001 From: schwartz-concordium <132270889+schwartz-concordium@users.noreply.github.com> Date: Wed, 26 Jul 2023 16:55:15 +0200 Subject: [PATCH] Update after HexString change in SDK --- .../GraphQL/Transactions/ChainUpdatePayload.cs | 2 +- .../Transactions/TransactionRejectReason.cs | 2 +- .../Transactions/TransactionResultEvent.cs | 18 +++++++++--------- .../Api/GraphQL/Import/BakerWriterTest.cs | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/backend/Application/Api/GraphQL/Transactions/ChainUpdatePayload.cs b/backend/Application/Api/GraphQL/Transactions/ChainUpdatePayload.cs index 5f09b4e9e..c8052c7b6 100644 --- a/backend/Application/Api/GraphQL/Transactions/ChainUpdatePayload.cs +++ b/backend/Application/Api/GraphQL/Transactions/ChainUpdatePayload.cs @@ -64,7 +64,7 @@ internal static ProtocolChainUpdatePayload From(ProtocolUpdate update) return new ProtocolChainUpdatePayload( update.Message, update.SpecificationUrl, - update.SpecificationHash.ToHex(), + update.SpecificationHash.ToHexString(), Convert.ToHexString(update.SpecificationAuxiliaryData).ToLowerInvariant() ); } diff --git a/backend/Application/Api/GraphQL/Transactions/TransactionRejectReason.cs b/backend/Application/Api/GraphQL/Transactions/TransactionRejectReason.cs index fd159b030..11f8c25d8 100644 --- a/backend/Application/Api/GraphQL/Transactions/TransactionRejectReason.cs +++ b/backend/Application/Api/GraphQL/Transactions/TransactionRejectReason.cs @@ -36,7 +36,7 @@ internal static TransactionRejectReason MapRejectReason(IRejectReason rejectReas Concordium.Sdk.Types.OutOfEnergy => new OutOfEnergy(), Concordium.Sdk.Types.RejectedInit x => new RejectedInit(x.RejectReason), Concordium.Sdk.Types.RejectedReceive x => new RejectedReceive(x.RejectReason, - ContractAddress.From(x.ContractAddress), x.ReceiveName.Receive, x.Parameter.ToHex()), + ContractAddress.From(x.ContractAddress), x.ReceiveName.Receive, x.Parameter.ToHexString()), Concordium.Sdk.Types.InvalidProof => new InvalidProof(), Concordium.Sdk.Types.AlreadyABaker x => new AlreadyABaker(x.BakerId.Id.Index), Concordium.Sdk.Types.NotABaker x => new NotABaker(AccountAddress.From(x.AccountAddress)), diff --git a/backend/Application/Api/GraphQL/Transactions/TransactionResultEvent.cs b/backend/Application/Api/GraphQL/Transactions/TransactionResultEvent.cs index 7ba85de42..170aac355 100644 --- a/backend/Application/Api/GraphQL/Transactions/TransactionResultEvent.cs +++ b/backend/Application/Api/GraphQL/Transactions/TransactionResultEvent.cs @@ -494,7 +494,7 @@ internal static ContractInitialized From(Concordium.Sdk.Types.ContractInitialize ContractAddress.From(contract.Data.ContractAddress), contract.Data.Amount.Value, contract.Data.InitName.Name, - contract.Data.Events.Select(d => d.ToHex()).ToArray() + contract.Data.Events.Select(d => d.ToHexString()).ToArray() ); } } @@ -536,9 +536,9 @@ internal static ContractUpdated From(Updated updated) ContractAddress.From(updated.Address), Address.From(updated.Instigator), updated.Amount.Value, - updated.Message.ToHex(), + updated.Message.ToHexString(), updated.ReceiveName.Receive, - updated.Events.Select(e => e.ToHex()).ToArray() + updated.Events.Select(e => e.ToHexString()).ToArray() ); } } @@ -548,7 +548,7 @@ public record CredentialDeployed( AccountAddress AccountAddress) : TransactionResultEvent { internal static CredentialDeployed From(AccountCreationDetails accountCreationDetails) => - new(accountCreationDetails.RegId.ToHex(), + new(accountCreationDetails.RegId.ToHexString(), AccountAddress.From(accountCreationDetails.Address)); } @@ -562,7 +562,7 @@ public record CredentialKeysUpdated( internal static CredentialKeysUpdated From(Concordium.Sdk.Types.CredentialKeysUpdated keys) { return new CredentialKeysUpdated( - keys.CredId.ToHex() + keys.CredId.ToHexString() ); } } @@ -586,8 +586,8 @@ internal static CredentialsUpdated From( { return new CredentialsUpdated( AccountAddress.From(sender), - updated.NewCredIds.Select(c => c.ToHex()).ToArray(), - updated.RemovedCredIds.Select(c => c.ToHex()).ToArray(), + updated.NewCredIds.Select(c => c.ToHexString()).ToArray(), + updated.RemovedCredIds.Select(c => c.ToHexString()).ToArray(), (byte)updated.NewThreshold.Threshold ); } @@ -604,7 +604,7 @@ public DecodedText GetDecoded() return DecodedText.CreateFromHex(DataAsHex); } - internal static DataRegistered From(Concordium.Sdk.Types.DataRegistered registered) => new(registered.ToHex()); + internal static DataRegistered From(Concordium.Sdk.Types.DataRegistered registered) => new(registered.ToHexString()); } /// @@ -740,7 +740,7 @@ internal static ContractInterrupted From(Interrupted interrupted) { return new ContractInterrupted( ContractAddress.From(interrupted.Address), - interrupted.Events.Select(e => e.ToHex()).ToArray() + interrupted.Events.Select(e => e.ToHexString()).ToArray() ); } } diff --git a/backend/Tests/Api/GraphQL/Import/BakerWriterTest.cs b/backend/Tests/Api/GraphQL/Import/BakerWriterTest.cs index e30b082c1..5b97d9bcb 100644 --- a/backend/Tests/Api/GraphQL/Import/BakerWriterTest.cs +++ b/backend/Tests/Api/GraphQL/Import/BakerWriterTest.cs @@ -124,11 +124,11 @@ public async Task UpdateBakersFromAccountBaker() { new AccountBaker ( - BakerId: new BakerId(new AccountIndex(11)), + BakerInfo: new BakerInfo(BakerId: new BakerId(new AccountIndex(11)), Array.Empty(),Array.Empty(), Array.Empty()), PendingChange: new AccountBakerRemovePending(_anyDateTimeOffset), RestakeEarnings: false, StakedAmount: CcdAmount.Zero, - null + BakerPoolInfo: null ) };