From 296099267c2653c8d7be12268316e1a5d986ebca Mon Sep 17 00:00:00 2001 From: David Hernando Date: Tue, 17 Dec 2024 13:01:24 +0100 Subject: [PATCH 1/3] modify TransactionRuntime type and serialize stored/session targets as per new requirements for VM1. Signed-off-by: David Hernando --- Casper.Network.SDK/Types/AddressableEntity.cs | 3 +- Casper.Network.SDK/Types/StoredValue.cs | 4 +- .../Types/TransactionBuilder.cs | 39 +--- .../Types/TransactionV1EntryPoint.cs | 35 ++-- .../Types/TransactionV1Target.cs | 177 ++++++++++-------- 5 files changed, 131 insertions(+), 127 deletions(-) diff --git a/Casper.Network.SDK/Types/AddressableEntity.cs b/Casper.Network.SDK/Types/AddressableEntity.cs index bd77aed..1a73c0a 100644 --- a/Casper.Network.SDK/Types/AddressableEntity.cs +++ b/Casper.Network.SDK/Types/AddressableEntity.cs @@ -75,9 +75,10 @@ public override EntityKind Read( }; break; case "SmartContract": + var tag = reader.GetString(); entity = new EntityKind() { - SmartContract = EnumCompat.Parse(reader.GetString()), + SmartContract = TransactionRuntime.FromString(tag), }; break; case "System": diff --git a/Casper.Network.SDK/Types/StoredValue.cs b/Casper.Network.SDK/Types/StoredValue.cs index d8094d5..e1afa70 100644 --- a/Casper.Network.SDK/Types/StoredValue.cs +++ b/Casper.Network.SDK/Types/StoredValue.cs @@ -44,7 +44,7 @@ public class StoredValue /// /// Stores a package. /// - public Package Package { get; init; } + public Package SmartContract { get; init; } /// /// A record of byte code. @@ -76,7 +76,7 @@ public class StoredValue /// /// Raw bytes. Similar to a [`crate::StoredValue::CLValue`] but does not incur overhead of a [`crate::CLValue`] and [`crate::CLType`]. /// - public byte[] RawBytes { get; init; } + public string RawBytes { get; init; } public class StoredValueConverter : JsonConverter { diff --git a/Casper.Network.SDK/Types/TransactionBuilder.cs b/Casper.Network.SDK/Types/TransactionBuilder.cs index 026bdb5..8ce07cb 100644 --- a/Casper.Network.SDK/Types/TransactionBuilder.cs +++ b/Casper.Network.SDK/Types/TransactionBuilder.cs @@ -559,41 +559,31 @@ public override TransactionV1 Build() public class ContractCallBuilder : TransactionV1Builder { - private ulong _transferredValue = 0; - public ContractCallBuilder() { } public ContractCallBuilder ByHash(string contractHash) { - _invocationTarget = TransactionV1Target.StoredByHash(contractHash, _transferredValue); + _invocationTarget = TransactionV1Target.StoredByHash(contractHash); return this; } public ContractCallBuilder ByName(string name) { - _invocationTarget = TransactionV1Target.StoredByName(name, _transferredValue); + _invocationTarget = TransactionV1Target.StoredByName(name); return this; } public ContractCallBuilder ByPackageHash(string contractHash, UInt32? version = null) { - _invocationTarget = TransactionV1Target.StoredByPackageHash(contractHash, version, _transferredValue); + _invocationTarget = TransactionV1Target.StoredByPackageHash(contractHash, version); return this; } public ContractCallBuilder ByPackageName(string name, UInt32? version = null) { - _invocationTarget = TransactionV1Target.StoredByPackageName(name, version, _transferredValue); - return this; - } - - public ContractCallBuilder TransferredValue(ulong transferredValue) - { - _transferredValue = transferredValue; - if (_invocationTarget is StoredTransactionV1Target storedTransactionV1Target) - storedTransactionV1Target.TransferredValue = transferredValue; + _invocationTarget = TransactionV1Target.StoredByPackageName(name, version); return this; } @@ -613,8 +603,6 @@ public ContractCallBuilder RuntimeArgs(List args) public class SessionBuilder : TransactionV1Builder { private bool _isInstallOrUpgrade = false; - private ulong _transferredValue = 0; - private string _seed = null; private byte[] _wasm = null; public SessionBuilder() @@ -624,9 +612,8 @@ public SessionBuilder() public SessionBuilder Wasm(byte[] wasmBytes) { - var target = TransactionV1Target.Session(wasmBytes, _transferredValue); + var target = TransactionV1Target.Session(wasmBytes); target.IsInstallUpgrade = _isInstallOrUpgrade; - target.Seed = _seed; _invocationTarget = target; return this; } @@ -639,22 +626,6 @@ public SessionBuilder InstallOrUpgrade() return this; } - public SessionBuilder TransferredValue(ulong transferredValue) - { - _transferredValue = transferredValue; - if (_invocationTarget is SessionTransactionV1Target sessionTarget) - sessionTarget.TransferredValue = transferredValue; - return this; - } - - public SessionBuilder Seed(string seed) - { - _seed = seed; - if (_invocationTarget is SessionTransactionV1Target sessionTarget) - sessionTarget.Seed = seed; - return this; - } - public SessionBuilder RuntimeArgs(List args) { _runtimeArgs = args; diff --git a/Casper.Network.SDK/Types/TransactionV1EntryPoint.cs b/Casper.Network.SDK/Types/TransactionV1EntryPoint.cs index dbd25c6..50d5aa5 100644 --- a/Casper.Network.SDK/Types/TransactionV1EntryPoint.cs +++ b/Casper.Network.SDK/Types/TransactionV1EntryPoint.cs @@ -10,51 +10,56 @@ namespace Casper.Network.SDK.Types /// public enum NativeEntryPoint { + /// + /// Used to call entry point call() in session transactions. + /// + Call = 0, + + /// + /// A non-native, arbitrary entry point. + /// + Custom = 1, + /// /// The `transfer` native entry point, used to transfer `Motes` from a source purse to a target purse. /// - Transfer = 1, + Transfer = 2, /// /// The `add_bid` native entry point, used to create or top off a bid purse. /// - AddBid = 2, + AddBid = 3, /// /// The `withdraw_bid` native entry point, used to decrease a stake. /// - WithdrawBid = 3, + WithdrawBid = 4, /// /// The `delegate` native entry point, used to add a new delegator or increase an existing delegator's stake. /// - Delegate = 4, + Delegate = 5, /// /// The `undelegate` native entry point, used to reduce a delegator's stake or remove the delegator if the remaining stake is 0. /// - Undelegate = 5, + Undelegate = 6, /// /// The `redelegate` native entry point, used to reduce a delegator's stake or remove the delegator if /// the remaining stake is 0, and after the unbonding delay, automatically delegate to a new validator. /// - Redelegate = 6, + Redelegate = 7, /// /// The `activate_bid` native entry point, used to used to reactivate an inactive bid. /// - ActivateBid = 7, + ActivateBid = 8, /// /// The `change_bid_public_key` native entry point, used to change a bid's public key. /// - ChangeBidPublicKey = 8, - - /// - /// Used to call entry point call() in session transactions - /// - Call = 9, + ChangeBidPublicKey = 9, /// /// The `add_reservations` native entry point, used to add delegators to validator's reserve list. @@ -103,7 +108,8 @@ public NativeTransactionV1EntryPoint(string name) } const ushort TAG_FIELD_INDEX = 0; - const byte CALL_VARIANT_TAG = 1; + const byte CALL_VARIANT_TAG = 0; + const byte CUSTOM_VARIANT_TAG = 1; const byte TRANSFER_VARIANT_TAG = 2; const byte ADD_BID_VARIANT_TAG = 3; const byte WITHDRAW_BID_VARIANT_TAG = 4; @@ -120,6 +126,7 @@ public byte[] ToBytes() var tag = Type switch { NativeEntryPoint.Call => CALL_VARIANT_TAG, + NativeEntryPoint.Custom => CUSTOM_VARIANT_TAG, NativeEntryPoint.Transfer => TRANSFER_VARIANT_TAG, NativeEntryPoint.AddBid => ADD_BID_VARIANT_TAG, NativeEntryPoint.Delegate => DELEGATE_VARIANT_TAG, diff --git a/Casper.Network.SDK/Types/TransactionV1Target.cs b/Casper.Network.SDK/Types/TransactionV1Target.cs index 1dbc990..ce6ff13 100644 --- a/Casper.Network.SDK/Types/TransactionV1Target.cs +++ b/Casper.Network.SDK/Types/TransactionV1Target.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using System.Text.Json; using System.Text.Json.Serialization; using Casper.Network.SDK.ByteSerializers; @@ -22,7 +23,7 @@ public class ByHashInvocationTarget : IInvocationTarget const ushort TAG_FIELD_INDEX = 0; const byte BY_HASH_VARIANT = 0; const ushort BY_HASH_HASH_INDEX = 1; - + public byte[] ToBytes() { return new CalltableSerialization() @@ -35,11 +36,11 @@ public byte[] ToBytes() public class ByNameInvocationTarget : IInvocationTarget { public string Name { get; init; } - + const ushort TAG_FIELD_INDEX = 0; const byte BY_NAME_VARIANT = 1; const ushort BY_NAME_NAME_INDEX = 1; - + public byte[] ToBytes() { return new CalltableSerialization() @@ -54,12 +55,12 @@ public class ByPackageHashInvocationTarget : IInvocationTarget [JsonPropertyName("addr")] public string Hash { get; init; } [JsonPropertyName("version")] public UInt32? Version { get; init; } - + const ushort TAG_FIELD_INDEX = 0; const byte BY_PACKAGE_HASH_VARIANT = 2; const ushort BY_PACKAGE_HASH_ADDR_INDEX = 1; const ushort BY_PACKAGE_HASH_VERSION_INDEX = 2; - + public byte[] ToBytes() { return new CalltableSerialization() @@ -77,12 +78,12 @@ public class ByPackageNameInvocationTarget : IInvocationTarget [JsonPropertyName("name")] public string Name { get; init; } [JsonPropertyName("version")] public UInt32? Version { get; init; } - + const ushort TAG_FIELD_INDEX = 0; const byte BY_PACKAGE_NAME_VARIANT = 3; const ushort BY_PACKAGE_NAME_NAME_INDEX = 1; const ushort BY_PACKAGE_NAME_VERSION_INDEX = 2; - + public byte[] ToBytes() { return new CalltableSerialization() @@ -178,17 +179,62 @@ public enum TransactionTargetType Session = 2, } - public enum TransactionRuntime + public class TransactionRuntime { + private const byte VM_CASPER_V1_TAG = 0; + private const byte VM_CASPER_V2_TAG = 1; + private byte _tag = VM_CASPER_V1_TAG; + + public static TransactionRuntime FromString(string json) + { + switch (json) + { + case "VmCasperV1": + return VmCasperV1(); + case "VmCasperV2": + return VmCasperV2(); + default: + throw new JsonException($"Unknown TransactionRuntime '{json}'"); + } + } + + public override string ToString() + { + switch (_tag) + { + case VM_CASPER_V1_TAG: + return "VmCasperV1"; + case VM_CASPER_V2_TAG: + return "VmCasperV2"; + default: + throw new JsonException($"Unknown TransactionRuntime '{_tag}'"); + } + } + /// /// The Casper Version 1 Virtual Machine. /// - VmCasperV1, + public static TransactionRuntime VmCasperV1() + { + return new TransactionRuntime() { _tag = VM_CASPER_V1_TAG }; + } /// /// The Casper Version 2 Virtual Machine. /// - VmCasperV2, + public static TransactionRuntime VmCasperV2() + { + return new TransactionRuntime() { _tag = VM_CASPER_V2_TAG }; + } + + const ushort TAG_FIELD_INDEX = 0; + + public byte[] ToBytes() + { + return new CalltableSerialization() + .AddField(TAG_FIELD_INDEX, new byte[] { _tag }) + .GetBytes(); + } } public interface ITransactionV1Target @@ -200,7 +246,7 @@ public class NativeTransactionV1Target : ITransactionV1Target { const ushort TAG_FIELD_INDEX = 0; const byte NATIVE_VARIANT = 0; - + public byte[] ToBytes() { return new CalltableSerialization() @@ -219,25 +265,23 @@ public class StoredTransactionV1Target : ITransactionV1Target /// [JsonPropertyName("runtime")] public TransactionRuntime Runtime { get; set; } - - /// - /// The amount of motes to transfer before code is executed. - /// - [JsonPropertyName("transferred_value")] - public ulong TransferredValue { get; set; } - + + public StoredTransactionV1Target() + { + Runtime = TransactionRuntime.VmCasperV1(); + } + const ushort TAG_FIELD_INDEX = 0; const byte STORED_VARIANT = 1; const ushort STORED_ID_INDEX = 1; const ushort STORED_RUNTIME_INDEX = 2; - const ushort STORED_TRANSFERRED_VALUE_INDEX = 3; + public byte[] ToBytes() { return new CalltableSerialization() .AddField(TAG_FIELD_INDEX, new byte[] { STORED_VARIANT }) .AddField(STORED_ID_INDEX, Id.ToBytes()) - .AddField(STORED_RUNTIME_INDEX, new byte[] { (byte)Runtime}) - .AddField(STORED_TRANSFERRED_VALUE_INDEX, CLValue.U64(TransferredValue)) + .AddField(STORED_RUNTIME_INDEX, Runtime.ToBytes()) .GetBytes(); } } @@ -249,104 +293,90 @@ public class SessionTransactionV1Target : ITransactionV1Target /// [JsonPropertyName("is_install_upgrade")] public bool IsInstallUpgrade { get; set; } - + /// /// Wasm bytes for a Session transaction type. /// [JsonPropertyName("module_bytes")] [JsonConverter(typeof(HexBytesConverter))] public byte[] ModuleBytes { get; set; } - + /// /// Targeted Casper VM version. /// [JsonPropertyName("runtime")] public TransactionRuntime Runtime { get; set; } - - /// - /// The amount of motes to transfer before code is executed. - /// This is for protection against phishing attack where a malicious session code drains - /// the balance of the caller account. The amount stated here is the maximum amount - /// that can be transferred from the caller account to the session account. - /// - [JsonPropertyName("transferred_value")] - public ulong TransferredValue { get; set; } - - /// - /// The seed for the session code that is used for an installer. - /// - [JsonPropertyName("seed")] - public string Seed { get; set; } - + + public SessionTransactionV1Target() + { + Runtime = TransactionRuntime.VmCasperV1(); + } + const ushort TAG_FIELD_INDEX = 0; const byte SESSION_VARIANT = 2; const ushort SESSION_IS_INSTALL_INDEX = 1; const ushort SESSION_RUNTIME_INDEX = 2; const ushort SESSION_MODULE_BYTES_INDEX = 3; - const ushort SESSION_TRANSFERRED_VALUE_INDEX = 4; - const ushort SESSION_SEED_INDEX = 5; + public byte[] ToBytes() { + var ms = new MemoryStream(); + ms.Write(BitConverter.GetBytes(ModuleBytes.Length)); + ms.Write(ModuleBytes); + return new CalltableSerialization() .AddField(TAG_FIELD_INDEX, new byte[] { SESSION_VARIANT }) - .AddField(SESSION_IS_INSTALL_INDEX, new byte[] { IsInstallUpgrade ? (byte)0x01 :(byte) 0x00 }) - .AddField(SESSION_RUNTIME_INDEX, new byte[] { (byte)Runtime }) - .AddField(SESSION_MODULE_BYTES_INDEX, ModuleBytes) - .AddField(SESSION_TRANSFERRED_VALUE_INDEX, CLValue.U64(TransferredValue)) - .AddField(SESSION_SEED_INDEX, Hex.Decode(Seed)) + .AddField(SESSION_IS_INSTALL_INDEX, new byte[] { IsInstallUpgrade ? (byte)0x01 : (byte)0x00 }) + .AddField(SESSION_RUNTIME_INDEX, Runtime.ToBytes()) + .AddField(SESSION_MODULE_BYTES_INDEX, ms.ToArray()) .GetBytes(); } } - + public class TransactionV1Target { public static ITransactionV1Target Native => new NativeTransactionV1Target(); - - public static StoredTransactionV1Target StoredByHash(string contractHash, ulong transferredValue = 0) + + public static StoredTransactionV1Target StoredByHash(string contractHash) { return new StoredTransactionV1Target() { Id = new ByHashInvocationTarget { Hash = contractHash }, - TransferredValue = transferredValue, }; } - public static StoredTransactionV1Target StoredByName(string name, ulong transferredValue = 0) + public static StoredTransactionV1Target StoredByName(string name) { return new StoredTransactionV1Target() { Id = new ByNameInvocationTarget { Name = name }, - TransferredValue = transferredValue, }; } - public static StoredTransactionV1Target StoredByPackageHash(string packageHash, UInt32? version = null, ulong transferredValue = 0) + public static StoredTransactionV1Target StoredByPackageHash(string packageHash, UInt32? version = null) { return new StoredTransactionV1Target() { Id = new ByPackageHashInvocationTarget { Hash = packageHash, Version = version }, - TransferredValue = transferredValue, }; } - public static StoredTransactionV1Target StoredByPackageName(string name, UInt32? version = null, ulong transferredValue = 0) + public static StoredTransactionV1Target StoredByPackageName(string name, UInt32? version = null) { return new StoredTransactionV1Target() { Id = new ByPackageNameInvocationTarget() { Name = name, Version = version }, - TransferredValue = transferredValue, }; } - public static SessionTransactionV1Target Session(byte[] moduleBytes, ulong transferredValue = 0) + public static SessionTransactionV1Target Session(byte[] moduleBytes) { return new SessionTransactionV1Target() { ModuleBytes = moduleBytes, - TransferredValue = transferredValue, }; } - + public class TransactionTargetConverter : JsonConverter { public override ITransactionV1Target Read( @@ -366,13 +396,14 @@ public override ITransactionV1Target Read( throw new JsonException($"TransactionTargetType '{targetType}' not supported."); } } + if (reader.TokenType == JsonTokenType.StartObject) { ITransactionV1Target transactionTarget = null; IInvocationTarget id = null; string module_bytes = null; - ulong transferredValue = 0;; - TransactionRuntime runtime = TransactionRuntime.VmCasperV1; + bool is_install_upgrade = false; + TransactionRuntime runtime = TransactionRuntime.VmCasperV1(); reader.Read(); // skip start object var targetType = reader.GetString(); @@ -392,12 +423,8 @@ public override ITransactionV1Target Read( id = JsonSerializer.Deserialize(ref reader, options); reader.Read(); break; - case "transferred_value": - transferredValue = reader.GetUInt64(); - reader.Read(); - break; case "runtime": - runtime = EnumCompat.Parse(reader.GetString()); + runtime = TransactionRuntime.FromString(reader.GetString()); reader.Read(); // skip end object break; } @@ -408,7 +435,6 @@ public override ITransactionV1Target Read( transactionTarget = new StoredTransactionV1Target() { Id = id, - TransferredValue = transferredValue, Runtime = runtime, }; break; @@ -420,15 +446,17 @@ public override ITransactionV1Target Read( reader.Read(); switch (prop) { + case "is_install_upgrade": + is_install_upgrade = reader.GetBoolean(); + reader.Read(); + break; case "module_bytes": module_bytes = reader.GetString(); - break; - case "transferred_value": - transferredValue = reader.GetUInt64(); reader.Read(); break; case "runtime": - runtime = EnumCompat.Parse(reader.GetString()); + runtime = TransactionRuntime.FromString(reader.GetString()); + reader.Read(); break; } } @@ -437,8 +465,8 @@ public override ITransactionV1Target Read( transactionTarget = new SessionTransactionV1Target() { + IsInstallUpgrade = is_install_upgrade, ModuleBytes = Hex.Decode(module_bytes), - TransferredValue = transferredValue, Runtime = runtime, }; break; @@ -467,8 +495,6 @@ public override void Write( writer.WriteStartObject("Stored"); writer.WritePropertyName("id"); JsonSerializer.Serialize(writer, storedTarget.Id); - writer.WritePropertyName("transferred_value"); - writer.WriteNumberValue(storedTarget.TransferredValue); writer.WriteString("runtime", storedTarget.Runtime.ToString()); writer.WriteEndObject(); writer.WriteEndObject(); @@ -476,9 +502,8 @@ public override void Write( case SessionTransactionV1Target sessionTarget: writer.WriteStartObject(); writer.WriteStartObject("Session"); + writer.WriteBoolean("is_install_upgrade", sessionTarget.IsInstallUpgrade); writer.WriteString("module_bytes", Hex.ToHexString(sessionTarget.ModuleBytes)); - writer.WritePropertyName("transferred_value"); - writer.WriteNumberValue(sessionTarget.TransferredValue); writer.WriteString("runtime", sessionTarget.Runtime.ToString()); writer.WriteEndObject(); writer.WriteEndObject(); From 4ed286abb870876ebe440e6713a8075f493206bc Mon Sep 17 00:00:00 2001 From: David Hernando Date: Wed, 18 Dec 2024 11:31:52 +0100 Subject: [PATCH 2/3] Remove Category from Transaction abstract type Fix tests. Signed-off-by: David Hernando --- .../RPCResponses/GetEntityResultTest.cs | 2 +- .../RPCResponses/GetTransactionTest.cs | 13 +- .../get-transaction-deploy-stored-v200.json | 14 +- .../get-transaction-session-v200.json | 1584 ++++++----------- .../TestData/get-transaction-stored-v200.json | 286 +-- Casper.Network.SDK/Types/StoredValue.cs | 13 +- Casper.Network.SDK/Types/Transaction.cs | 7 - Docs/Examples/NativeTransfer/Program.cs | 2 +- 8 files changed, 583 insertions(+), 1338 deletions(-) diff --git a/Casper.Network.SDK.Test/RPCResponses/GetEntityResultTest.cs b/Casper.Network.SDK.Test/RPCResponses/GetEntityResultTest.cs index b11ed89..6b04ddc 100644 --- a/Casper.Network.SDK.Test/RPCResponses/GetEntityResultTest.cs +++ b/Casper.Network.SDK.Test/RPCResponses/GetEntityResultTest.cs @@ -45,7 +45,7 @@ public void GetEntityContractTest_v200() Assert.IsNotNull(result.Entity.Package); Assert.IsNotNull(result.Entity.MainPurse); Assert.AreEqual("byte-code-85def61e3ee02e10a1e845cfb8e8b2d9640a18f605333158027a24ed8569d895", result.Entity.ByteCodeHash); - Assert.AreEqual(TransactionRuntime.VmCasperV1, result.Entity.EntityKind.SmartContract); + Assert.AreEqual(TransactionRuntime.VmCasperV1().ToString(), result.Entity.EntityKind.SmartContract); Assert.AreEqual(1, result.Entity.ActionThresholds.KeyManagement); Assert.AreEqual(1, result.Entity.ActionThresholds.Deployment); Assert.AreEqual(1, result.Entity.ActionThresholds.UpgradeManagement); diff --git a/Casper.Network.SDK.Test/RPCResponses/GetTransactionTest.cs b/Casper.Network.SDK.Test/RPCResponses/GetTransactionTest.cs index 2452f49..9983185 100644 --- a/Casper.Network.SDK.Test/RPCResponses/GetTransactionTest.cs +++ b/Casper.Network.SDK.Test/RPCResponses/GetTransactionTest.cs @@ -29,7 +29,6 @@ public void GetTransactionWithDeployHashTest_v200() Assert.IsNull(result.Transaction.InitiatorAddr.AccountHash); Assert.IsTrue(result.Transaction.Invocation is Transaction.NativeTransactionInvocation); Assert.AreEqual(NativeEntryPoint.Transfer, (result.Transaction.Invocation as Transaction.NativeTransactionInvocation)!.Type); - Assert.AreEqual(TransactionCategory.Mint, result.Transaction.Category); Assert.IsTrue(result.Transaction.Scheduling is StandardTransactionScheduling); Assert.AreEqual(deploy.Approvals.Count, result.Transaction.Approvals.Count); Assert.AreEqual(deploy.Approvals[0].Signature, result.Transaction.Approvals[0].Signature); @@ -63,7 +62,6 @@ public void GetDeployWithDeployHashTest_v200() Assert.IsNull(transaction.InitiatorAddr.AccountHash); Assert.IsTrue(transaction.Invocation is Transaction.NativeTransactionInvocation); Assert.AreEqual(NativeEntryPoint.Transfer, (transaction.Invocation as Transaction.NativeTransactionInvocation)!.Type); - Assert.AreEqual(TransactionCategory.Mint, transaction.Category); Assert.IsTrue(transaction.Scheduling is StandardTransactionScheduling); Assert.AreEqual(deploy.Approvals.Count, transaction.Approvals.Count); Assert.AreEqual(deploy.Approvals[0].Signature, transaction.Approvals[0].Signature); @@ -96,10 +94,9 @@ public void GetTransactionWithSessionTransactionTest_v200() Assert.IsNull(transaction.InitiatorAddr.AccountHash); Assert.IsTrue(transaction.Invocation is Transaction.SessionTransactionInvocation); Assert.AreEqual("01020304", Hex.ToHexString((transaction.Invocation as Transaction.SessionTransactionInvocation)!.Wasm)); - Assert.AreEqual(TransactionCategory.InstallUpgrade, transaction.Category); Assert.IsTrue(transaction.Scheduling is StandardTransactionScheduling); - Assert.IsTrue(transaction.PricingMode is FixedPricingMode); - Assert.AreEqual(2, ((FixedPricingMode)transaction.PricingMode).GasPriceTolerance); + Assert.IsTrue(transaction.PricingMode is PaymentLimitedPricingMode); + Assert.AreEqual(1, ((PaymentLimitedPricingMode)transaction.PricingMode).GasPriceTolerance); Assert.AreEqual(transactionV1.Approvals.Count, transaction.Approvals.Count); Assert.AreEqual(transactionV1.Approvals[0].Signature, transaction.Approvals[0].Signature); @@ -128,11 +125,10 @@ public void GetTransactionWithStoredTransactionTest_v200() Assert.AreEqual(transactionV1.Payload.ChainName, transaction.ChainName); Assert.AreEqual(transactionV1.Payload.Timestamp, transaction.Timestamp); Assert.AreEqual(transactionV1.Payload.InitiatorAddr.AccountHash, transaction.InitiatorAddr.AccountHash); - Assert.AreEqual("account-hash-e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f", transaction.InitiatorAddr.AccountHash.ToString().ToLower()); - Assert.IsNull(transaction.InitiatorAddr.PublicKey); + Assert.AreEqual("01a5a5b7328118681638be3e06c8749609280dba4c9daf9aeb3d3464b8839b018a", transaction.InitiatorAddr.PublicKey.ToString().ToLower()); + Assert.IsNull(transaction.InitiatorAddr.AccountHash); Assert.IsTrue(transaction.Invocation is Transaction.StoredTransactionInvocation); Assert.AreEqual("transfer", (transaction.Invocation as Transaction.StoredTransactionInvocation)!.EntryPoint); - Assert.AreEqual(TransactionCategory.Medium, transaction.Category); Assert.IsTrue(transaction.Scheduling is StandardTransactionScheduling); Assert.AreEqual(transactionV1.Approvals.Count, transaction.Approvals.Count); Assert.AreEqual(transactionV1.Approvals[0].Signature, transaction.Approvals[0].Signature); @@ -167,7 +163,6 @@ public void GetTransactionWithStoredDeployTest_v200() Assert.IsNull(transaction.InitiatorAddr.AccountHash); Assert.IsTrue(transaction.Invocation is Transaction.StoredTransactionInvocation); Assert.AreEqual("transfer", (transaction.Invocation as Transaction.StoredTransactionInvocation)!.EntryPoint); - Assert.AreEqual(TransactionCategory.Large, transaction.Category); Assert.IsTrue(transaction.Scheduling is StandardTransactionScheduling); Assert.AreEqual(deploy.Approvals.Count, transaction.Approvals.Count); Assert.AreEqual(deploy.Approvals[0].Signature, transaction.Approvals[0].Signature); diff --git a/Casper.Network.SDK.Test/TestData/get-transaction-deploy-stored-v200.json b/Casper.Network.SDK.Test/TestData/get-transaction-deploy-stored-v200.json index 54766a3..404246f 100644 --- a/Casper.Network.SDK.Test/TestData/get-transaction-deploy-stored-v200.json +++ b/Casper.Network.SDK.Test/TestData/get-transaction-deploy-stored-v200.json @@ -141,19 +141,19 @@ "kind": "Identity" }, { - "key": "message-topic-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1", + "key": "message-topic-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1", "kind": "Identity" }, { - "key": "message-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1-1", + "key": "message-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1-1", "kind": { - "Prune": "message-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1-1" + "Prune": "message-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1-1" } }, { - "key": "message-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1-2", + "key": "message-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1-2", "kind": { - "Prune": "message-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1-2" + "Prune": "message-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1-2" } }, { @@ -161,7 +161,7 @@ "kind": "Identity" }, { - "key": "message-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1-0", + "key": "message-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1-0", "kind": { "Write": { "Message": "message-checksum-4e8fa8422d6022df02a2d41568e25ebfbc9d7d098f8c31f42e4493523627f0f4" @@ -169,7 +169,7 @@ } }, { - "key": "message-topic-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1", + "key": "message-topic-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1", "kind": { "Write": { "MessageTopic": { diff --git a/Casper.Network.SDK.Test/TestData/get-transaction-session-v200.json b/Casper.Network.SDK.Test/TestData/get-transaction-session-v200.json index e8e323b..feeffa6 100644 --- a/Casper.Network.SDK.Test/TestData/get-transaction-session-v200.json +++ b/Casper.Network.SDK.Test/TestData/get-transaction-session-v200.json @@ -2,108 +2,110 @@ "api_version": "2.0.0", "transaction": { "Version1": { - "hash": "45a4d4ce6ff79d7b49c34d2c7bdc55543d1734b1a03d66bea513e631ff21213b", - "header": { - "chain_name": "casper-net-1", - "timestamp": "2024-07-17T08:52:03.256Z", + "hash": "22ef28d7e341c79d868e1be407ec4af4f25c267c0094201ba511045b3af191f6", + "payload": { + "initiator_addr": { + "PublicKey": "01a5a5b7328118681638be3e06c8749609280dba4c9daf9aeb3d3464b8839b018a" + }, + "timestamp": "2024-12-18T09:03:15.790Z", "ttl": "30m", - "body_hash": "9b1d4002bb1af17ec9fc4193ac5ba7db6535b6dd813034b730829a94b13ebc46", + "chain_name": "casper-net-1", "pricing_mode": { - "Fixed": { - "gas_price_tolerance": 2 + "PaymentLimited": { + "payment_amount": 1000000000000, + "gas_price_tolerance": 1, + "standard_payment": true } }, - "initiator_addr": { - "PublicKey": "0106ed45915392c02b37136618372ac8dde8e0e3b8ee6190b2ca6db539b354ede4" - } - }, - "body": { - "args": [ - [ - "name", - { - "cl_type": "String", - "bytes": "0b000000434c49434b312054657374", - "parsed": "CLICK1 Test" - } - ], - [ - "symbol", - { - "cl_type": "String", - "bytes": "06000000434c49434b31", - "parsed": "CLICK1" - } - ], - [ - "decimals", - { - "cl_type": "U8", - "bytes": "09", - "parsed": 9 - } - ], - [ - "total_supply", - { - "cl_type": "U256", - "bytes": "070080c6a47e8d03", - "parsed": "1000000000000000" - } - ], - [ - "events_mode", - { - "cl_type": "U8", - "bytes": "05", - "parsed": 5 - } - ], - [ - "enable_mint_burn", - { - "cl_type": "U8", - "bytes": "01", - "parsed": 1 + "fields": { + "args": { + "Named": [ + [ + "name", + { + "cl_type": "String", + "bytes": "0b000000434c49434b542054657374", + "parsed": "CLICKT Test" + } + ], + [ + "symbol", + { + "cl_type": "String", + "bytes": "06000000434c49434b54", + "parsed": "CLICKT" + } + ], + [ + "decimals", + { + "cl_type": "U8", + "bytes": "09", + "parsed": 9 + } + ], + [ + "total_supply", + { + "cl_type": "U256", + "bytes": "070080c6a47e8d03", + "parsed": "1000000000000000" + } + ], + [ + "events_mode", + { + "cl_type": "U8", + "bytes": "02", + "parsed": 2 + } + ], + [ + "enable_mint_burn", + { + "cl_type": "U8", + "bytes": "01", + "parsed": 1 + } + ] + ] + }, + "entry_point": "Call", + "scheduling": "Standard", + "target": { + "Session": { + "is_install_upgrade": true, + "module_bytes": "01020304", + "runtime": "VmCasperV1" } - ] - ], - "target": { - "Session": { - "module_bytes": "01020304", - "runtime": "VmCasperV1" } - }, - "entry_point": "Call", - "transaction_category": 2, - "scheduling": "Standard" + } }, "approvals": [ { - "signer": "0106ed45915392c02b37136618372ac8dde8e0e3b8ee6190b2ca6db539b354ede4", - "signature": "016a910dafe6b87b8f12daa5698c33c0ab06eda11e79e06cacc446d3de65d85176fa26a0a9036ad80272aca8b1dfe674227e9cfaa98509e60439879d4fde487b04" + "signer": "01a5a5b7328118681638be3e06c8749609280dba4c9daf9aeb3d3464b8839b018a", + "signature": "013bb82f647fcb53a4fa01871e43100bbee1a90370480361a96f426280b73c07adee7a7116b6a433f0173b8a2403d95c3fa84fbcb28f74535f6a598721d299300a" } ] } }, "execution_info": { - "block_hash": "b84c248b4c1bee3abf77e84b921fcc0d09290a1556285327922da4dc23de3177", - "block_height": 1809, + "block_hash": "856ce7684bc53fc76e27d91a9dfda2c158fd18a69789fecbdf98535d3bddadf0", + "block_height": 72, "execution_result": { "Version2": { "initiator": { - "PublicKey": "0106ed45915392c02b37136618372ac8dde8e0e3b8ee6190b2ca6db539b354ede4" + "PublicKey": "01a5a5b7328118681638be3e06c8749609280dba4c9daf9aeb3d3464b8839b018a" }, "error_message": null, "limit": "1000000000000", - "consumed": "350280524938", + "consumed": "314102340989", "cost": "1000000000000", - "payment": [], "transfers": [], - "size_estimate": 303776, + "size_estimate": 278442, "effects": [ { - "key": "balance-hold-016f8eee1d8ea5eee794ffe69a9008c9c8620eea284ee2c49bf686ae8eee042215af3fe4bf90010000", + "key": "balance-hold-01e542fb9f5dc6d06d849e2ac3ad6cc5cd4b7c71392dc8759c0898f4ab04439520bee001d993010000", "kind": { "Write": { "CLValue": { @@ -115,31 +117,31 @@ } }, { - "key": "uref-5aa675065318455e193fc341bb4750174283add94ca195f71e4b4104e4c84b1a-000", + "key": "uref-6702ca24ad114bf8fe2e7e2169461b98e11f12ad7ad191d6e4b6594183f64ecf-000", "kind": { "Write": { "CLValue": { "cl_type": "String", - "bytes": "0b000000434c49434b312054657374", - "parsed": "CLICK1 Test" + "bytes": "0b000000434c49434b542054657374", + "parsed": "CLICKT Test" } } } }, { - "key": "uref-977f30046644e5c7a7e8cb297e5f8971a1680543dc31d1066ab4870c575b8a0d-000", + "key": "uref-644d8cce1ad2d0fb9a783a72e9542a4edc3e88e62f13e55d3d6a2899cd205619-000", "kind": { "Write": { "CLValue": { "cl_type": "String", - "bytes": "06000000434c49434b31", - "parsed": "CLICK1" + "bytes": "06000000434c49434b54", + "parsed": "CLICKT" } } } }, { - "key": "uref-63c283118dd23b4ceb6fb4eabe219941ca795a9588f5e09c1438cf7e4904d285-000", + "key": "uref-127a8c723a6df941dae0d26a9c181c26f1a80f86eaeb12eed786b4c9715b5b55-000", "kind": { "Write": { "CLValue": { @@ -151,7 +153,7 @@ } }, { - "key": "uref-5b2eb4a8703d23be50b30625811388876b10ea57c6f79e613a144b59bc8eea1d-000", + "key": "uref-411a53953e73ddd23a115ad96e7ccb53e1867ec4beec03e62b8c7aa400be56fe-000", "kind": { "Write": { "CLValue": { @@ -163,19 +165,19 @@ } }, { - "key": "uref-08f9c3e110c4d5cbc6e8ce71dd0cd535e4f41b34fe88c26cf3cd222004373db3-000", + "key": "uref-a0cb023abb00bf87f9898b5fdce36569d5b87b7891e2b5023e663a5bc78134e0-000", "kind": { "Write": { "CLValue": { "cl_type": "U8", - "bytes": "05", - "parsed": 5 + "bytes": "02", + "parsed": 2 } } } }, { - "key": "uref-ed2804ba22d80b1cc8abb02f72e1d87e93b3186d1225cf286b733e29c4df61e8-000", + "key": "uref-c09b022180e6a9221dfefe6ae62c6c8a93e09031742f284ffb64c5c1ddd23395-000", "kind": { "Write": { "CLValue": { @@ -187,7 +189,7 @@ } }, { - "key": "uref-5ef62926d2a73b5982cab9cf546b59e75cd72b1c57c5eaaf2a01c90705fb6b9b-000", + "key": "uref-d8a4e0ed98096e0df3263828e46c1f6758255853d3abcb32ebaf0776483a46bb-000", "kind": { "Write": { "CLValue": { @@ -199,10 +201,11 @@ } }, { - "key": "package-ab86f3895a5b0d8cd15113ec159f425037aceb9bb1b464affd9db54b592accf4", + "key": "hash-976b060d3ae59125f3521c5dd16ca5f55c9862b37a9effa05c3770a9a4d7b870", "kind": { "Write": { - "Package": { + "ContractPackage": { + "access_key": "uref-d8a4e0ed98096e0df3263828e46c1f6758255853d3abcb32ebaf0776483a46bb-007", "versions": [], "disabled_versions": [], "groups": [], @@ -212,710 +215,390 @@ } }, { - "key": "named-key-entity-account-e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f-fc71cc1c9046f7ac32c20c9f9897c6c3a0b6bb288e9e54eb29202867ca9b0d94", + "key": "account-hash-9fa1fc0808d3a5b9ea9f3af4ca7c8c3655568fdf378d8afdf8a7e56e58abbfd4", "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "10ab86f3895a5b0d8cd15113ec159f425037aceb9bb1b464affd9db54b592accf4", - "parsed": "package-ab86f3895a5b0d8cd15113ec159f425037aceb9bb1b464affd9db54b592accf4" - }, - "name": { - "cl_type": "String", - "bytes": "2200000063657031385f636f6e74726163745f7061636b6167655f434c49434b312054657374", - "parsed": "cep18_contract_package_CLICK1 Test" - } + "AddKeys": [ + { + "name": "cep18_contract_package_CLICKT Test", + "key": "package-976b060d3ae59125f3521c5dd16ca5f55c9862b37a9effa05c3770a9a4d7b870" } - } + ] } }, { - "key": "named-key-entity-account-e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f-715bf96dd4d151db8e1135387b051ea188d8fc85ca004740d4f181c6ad038731", + "key": "account-hash-9fa1fc0808d3a5b9ea9f3af4ca7c8c3655568fdf378d8afdf8a7e56e58abbfd4", "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "025ef62926d2a73b5982cab9cf546b59e75cd72b1c57c5eaaf2a01c90705fb6b9b07", - "parsed": "uref-5ef62926d2a73b5982cab9cf546b59e75cd72b1c57c5eaaf2a01c90705fb6b9b-007" - }, - "name": { - "cl_type": "String", - "bytes": "2900000063657031385f636f6e74726163745f7061636b6167655f6163636573735f434c49434b312054657374", - "parsed": "cep18_contract_package_access_CLICK1 Test" - } + "AddKeys": [ + { + "name": "cep18_contract_package_access_CLICKT Test", + "key": "uref-d8a4e0ed98096e0df3263828e46c1f6758255853d3abcb32ebaf0776483a46bb-007" } - } + ] } }, { - "key": "package-ab86f3895a5b0d8cd15113ec159f425037aceb9bb1b464affd9db54b592accf4", - "kind": "Identity" - }, - { - "key": "entity-system-989625d28e779749e3cacc7367403dd459c8e7082937436f16d5dbff7aec8292", - "kind": "Identity" - }, - { - "key": "package-b94115849598c8b83bb94dd7ea211630a9e23827ceb089a8674e1518a8257a1a", - "kind": "Identity" - }, - { - "key": "entry-point-v1-entity-system-989625d28e779749e3cacc7367403dd459c8e7082937436f16d5dbff7aec8292-21bddc7e4379ba445c7118cb51962954e0d1e5aa5cacc0c4ff6095b57eb9fb33", + "key": "hash-976b060d3ae59125f3521c5dd16ca5f55c9862b37a9effa05c3770a9a4d7b870", "kind": "Identity" }, { - "key": "uref-2b130d8c617d24bd5366bdd2843db98a5e93e594ed827ace443b4ea6e4772f01-000", - "kind": { - "Write": { - "CLValue": { - "cl_type": "Unit", - "bytes": "", - "parsed": null - } - } - } - }, - { - "key": "balance-2b130d8c617d24bd5366bdd2843db98a5e93e594ed827ace443b4ea6e4772f01", + "key": "message-topic-783ac85c80ca97c0a3f699fedbde796c548e3cd0f8d015c3f3158090272eebd4-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1", "kind": { "Write": { - "CLValue": { - "cl_type": "U512", - "bytes": "00", - "parsed": "0" + "MessageTopic": { + "message_count": 0, + "blocktime": 1734512599230, + "topic_name": "events" } } } }, { - "key": "byte-code-v1-wasm-800e35cfd87b0f36479afdaf68725cd7ef0f503e8d541ed33afad4a18c7fa6eb", + "key": "hash-feb66b9d1f45bf0a4c11c2048c2b5c839f191128f883ad24d1c2508fc6ad285d", "kind": { "Write": { - "ByteCode": { - "kind": "V1CasperWasm", + "ContractWasm": { "bytes": "01020304" } } } }, { - "key": "named-key-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-be138e764d5f26cd174471e18c82a7bef961da4c7e7ade7df068038aebdda9bf", - "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "0263c283118dd23b4ceb6fb4eabe219941ca795a9588f5e09c1438cf7e4904d28507", - "parsed": "uref-63c283118dd23b4ceb6fb4eabe219941ca795a9588f5e09c1438cf7e4904d285-007" - }, - "name": { - "cl_type": "String", - "bytes": "08000000646563696d616c73", - "parsed": "decimals" - } - } - } - } - }, - { - "key": "named-key-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-f26520fac960fb1abac44a358923ab6a064baffb1707c885886d157f66c55209", - "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "02ed2804ba22d80b1cc8abb02f72e1d87e93b3186d1225cf286b733e29c4df61e807", - "parsed": "uref-ed2804ba22d80b1cc8abb02f72e1d87e93b3186d1225cf286b733e29c4df61e8-007" - }, - "name": { - "cl_type": "String", - "bytes": "10000000656e61626c655f6d696e745f6275726e", - "parsed": "enable_mint_burn" - } - } - } - } - }, - { - "key": "named-key-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-7114a751e72d65a0290c975396374e0120ac8f3ddbb6e4e21e3c6810135b40d0", - "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "0208f9c3e110c4d5cbc6e8ce71dd0cd535e4f41b34fe88c26cf3cd222004373db307", - "parsed": "uref-08f9c3e110c4d5cbc6e8ce71dd0cd535e4f41b34fe88c26cf3cd222004373db3-007" - }, - "name": { - "cl_type": "String", - "bytes": "0b0000006576656e74735f6d6f6465", - "parsed": "events_mode" - } - } - } - } - }, - { - "key": "named-key-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-69cade231fc487185af830cfe041ce668a4763ab02ee5989b8baac6bee7e1a22", + "key": "hash-783ac85c80ca97c0a3f699fedbde796c548e3cd0f8d015c3f3158090272eebd4", "kind": { "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "025aa675065318455e193fc341bb4750174283add94ca195f71e4b4104e4c84b1a07", - "parsed": "uref-5aa675065318455e193fc341bb4750174283add94ca195f71e4b4104e4c84b1a-007" - }, - "name": { - "cl_type": "String", - "bytes": "040000006e616d65", - "parsed": "name" - } - } - } - } - }, - { - "key": "named-key-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-eef0c71bbea5a76f1da01cb395e12bc0388bec279852100e17e3843b3e559999", - "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "02977f30046644e5c7a7e8cb297e5f8971a1680543dc31d1066ab4870c575b8a0d07", - "parsed": "uref-977f30046644e5c7a7e8cb297e5f8971a1680543dc31d1066ab4870c575b8a0d-007" - }, - "name": { - "cl_type": "String", - "bytes": "0600000073796d626f6c", - "parsed": "symbol" - } - } - } - } - }, - { - "key": "named-key-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-f99c57f016ee238df5bcdf8bec27869b1ba087a415050a9c6668644eeda11af0", - "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "025b2eb4a8703d23be50b30625811388876b10ea57c6f79e613a144b59bc8eea1d07", - "parsed": "uref-5b2eb4a8703d23be50b30625811388876b10ea57c6f79e613a144b59bc8eea1d-007" - }, - "name": { - "cl_type": "String", - "bytes": "0c000000746f74616c5f737570706c79", - "parsed": "total_supply" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-1e3c8f46f39b1ee1cbadb774ffaf842226b7cbf1fef3bbc04abfa80b86daca11", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "allowance", - "args": [ - { - "name": "owner", - "cl_type": "Key" - }, - { - "name": "spender", - "cl_type": "Key" + "Contract": { + "contract_package_hash": "contract-package-976b060d3ae59125f3521c5dd16ca5f55c9862b37a9effa05c3770a9a4d7b870", + "contract_wasm_hash": "contract-wasm-feb66b9d1f45bf0a4c11c2048c2b5c839f191128f883ad24d1c2508fc6ad285d", + "named_keys": [ + { + "name": "decimals", + "key": "uref-127a8c723a6df941dae0d26a9c181c26f1a80f86eaeb12eed786b4c9715b5b55-007" + }, + { + "name": "enable_mint_burn", + "key": "uref-c09b022180e6a9221dfefe6ae62c6c8a93e09031742f284ffb64c5c1ddd23395-007" + }, + { + "name": "events_mode", + "key": "uref-a0cb023abb00bf87f9898b5fdce36569d5b87b7891e2b5023e663a5bc78134e0-007" + }, + { + "name": "name", + "key": "uref-6702ca24ad114bf8fe2e7e2169461b98e11f12ad7ad191d6e4b6594183f64ecf-007" + }, + { + "name": "symbol", + "key": "uref-644d8cce1ad2d0fb9a783a72e9542a4edc3e88e62f13e55d3d6a2899cd205619-007" + }, + { + "name": "total_supply", + "key": "uref-411a53953e73ddd23a115ad96e7ccb53e1867ec4beec03e62b8c7aa400be56fe-007" + } + ], + "entry_points": [ + { + "name": "allowance", + "entry_point": { + "name": "allowance", + "args": [ + { + "name": "owner", + "cl_type": "Key" + }, + { + "name": "spender", + "cl_type": "Key" + } + ], + "ret": "U256", + "access": "Public", + "entry_point_type": "Called" } - ], - "ret": "U256", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-44528c1898e30df62037a76e0c45123f4f4437336ca63236b10ebfc16a5edb78", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "approve", - "args": [ - { - "name": "spender", - "cl_type": "Key" - }, - { - "name": "amount", - "cl_type": "U256" + }, + { + "name": "approve", + "entry_point": { + "name": "approve", + "args": [ + { + "name": "spender", + "cl_type": "Key" + }, + { + "name": "amount", + "cl_type": "U256" + } + ], + "ret": "Unit", + "access": "Public", + "entry_point_type": "Called" } - ], - "ret": "Unit", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-fcc296caa05679d0d11121e7629b29f222a857018f50985046b73a56e9a10701", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "balance_of", - "args": [ - { - "name": "address", - "cl_type": "Key" + }, + { + "name": "balance_of", + "entry_point": { + "name": "balance_of", + "args": [ + { + "name": "address", + "cl_type": "Key" + } + ], + "ret": "U256", + "access": "Public", + "entry_point_type": "Called" } - ], - "ret": "U256", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-768c370eb010604bd19029a409dca8b5fbf9af9bc14a36c2b294a2a7a922161e", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "burn", - "args": [ - { - "name": "owner", - "cl_type": "Key" - }, - { - "name": "amount", - "cl_type": "U256" + }, + { + "name": "burn", + "entry_point": { + "name": "burn", + "args": [ + { + "name": "owner", + "cl_type": "Key" + }, + { + "name": "amount", + "cl_type": "U256" + } + ], + "ret": "Unit", + "access": "Public", + "entry_point_type": "Called" } - ], - "ret": "Unit", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-bab8615f758ed79acb7dd7577b1a6c12d625d1a19592a2b1ded0dc352407e4d5", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "change_events_mode", - "args": [ - { - "name": "events_mode", - "cl_type": "U8" + }, + { + "name": "change_events_mode", + "entry_point": { + "name": "change_events_mode", + "args": [ + { + "name": "events_mode", + "cl_type": "U8" + } + ], + "ret": "Unit", + "access": "Public", + "entry_point_type": "Called" } - ], - "ret": "Unit", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-82a811993cf9ccb5e46c9608c69d86e3c9b7b499520fd48cdca1424f2a08efdc", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "change_security", - "args": [], - "ret": "Unit", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-45ffbf1854843af5eeec6b167e14a9e97bdb526e66205b07559d4fb3928fb11e", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "condor", - "args": [], - "ret": "String", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-be138e764d5f26cd174471e18c82a7bef961da4c7e7ade7df068038aebdda9bf", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "decimals", - "args": [], - "ret": "U8", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-ac07c23dc90a33282d553af890e30e62335c5ae986629d643778e2d4516f26ad", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "decrease_allowance", - "args": [ - { - "name": "spender", - "cl_type": "Key" - }, - { - "name": "amount", - "cl_type": "U256" + }, + { + "name": "change_security", + "entry_point": { + "name": "change_security", + "args": [], + "ret": "Unit", + "access": "Public", + "entry_point_type": "Called" } - ], - "ret": "Unit", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-a7e05838c728d16c4ba3e1980b6729c857ef4c21d1b0c34e6eefbb486cdc2b89", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "increase_allowance", - "args": [ - { - "name": "spender", - "cl_type": "Key" - }, - { - "name": "amount", - "cl_type": "U256" + }, + { + "name": "condor", + "entry_point": { + "name": "condor", + "args": [], + "ret": "String", + "access": "Public", + "entry_point_type": "Called" } - ], - "ret": "Unit", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-4ca60287ae6129662475a8ce0d41c450d072b2430a8759f6178adeeff38523da", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "init", - "args": [], - "ret": "Unit", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-fc79236fd0e4521c8feddcc2094c6a0ea04fcaafb17fef63ef060744a6bab401", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "migrate_sec_keys", - "args": [ - { - "name": "events", - "cl_type": "Bool" - }, - { - "name": "revert", - "cl_type": "Bool" + }, + { + "name": "decimals", + "entry_point": { + "name": "decimals", + "args": [], + "ret": "U8", + "access": "Public", + "entry_point_type": "Called" } - ], - "ret": "Unit", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-18bff854e9d908cf20fb1db53a47ab69968917b53b8c71371e7dd0f88b363e60", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "migrate_user_allowance_keys", - "args": [ - { - "name": "events", - "cl_type": "Bool" - }, - { - "name": "revert", - "cl_type": "Bool" + }, + { + "name": "decrease_allowance", + "entry_point": { + "name": "decrease_allowance", + "args": [ + { + "name": "spender", + "cl_type": "Key" + }, + { + "name": "amount", + "cl_type": "U256" + } + ], + "ret": "Unit", + "access": "Public", + "entry_point_type": "Called" } - ], - "ret": "Unit", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-1e7babf918642bd9636d3c121691bd85534b41084a5c22fe1e2bf196224dade6", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "migrate_user_balance_keys", - "args": [ - { - "name": "events", - "cl_type": "Bool" - }, - { - "name": "revert", - "cl_type": "Bool" + }, + { + "name": "increase_allowance", + "entry_point": { + "name": "increase_allowance", + "args": [ + { + "name": "spender", + "cl_type": "Key" + }, + { + "name": "amount", + "cl_type": "U256" + } + ], + "ret": "Unit", + "access": "Public", + "entry_point_type": "Called" } - ], - "ret": "Unit", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-233964bb1dc667b37a8abbb938d7647b2c4ab41f0c26dbbcd26c62e7870f72ba", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "mint", - "args": [ - { - "name": "owner", - "cl_type": "Key" - }, - { - "name": "amount", - "cl_type": "U256" + }, + { + "name": "init", + "entry_point": { + "name": "init", + "args": [], + "ret": "Unit", + "access": "Public", + "entry_point_type": "Called" } - ], - "ret": "Unit", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-69cade231fc487185af830cfe041ce668a4763ab02ee5989b8baac6bee7e1a22", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "name", - "args": [], - "ret": "String", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-eef0c71bbea5a76f1da01cb395e12bc0388bec279852100e17e3843b3e559999", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "symbol", - "args": [], - "ret": "String", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-f99c57f016ee238df5bcdf8bec27869b1ba087a415050a9c6668644eeda11af0", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "total_supply", - "args": [], - "ret": "U256", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-3820ce25e54df0470fb738e3e0f63ee50b2719cf2680da2bdb579e21aebc8f63", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "transfer", - "args": [ - { - "name": "recipient", - "cl_type": "Key" - }, - { - "name": "amount", - "cl_type": "U256" + }, + { + "name": "migrate_sec_keys", + "entry_point": { + "name": "migrate_sec_keys", + "args": [], + "ret": "Unit", + "access": "Public", + "entry_point_type": "Called" } - ], - "ret": "Unit", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-44208043191e40d3417df6878e1a23894172cf37cf2e4444384ada99e25430e7", - "kind": { - "Write": { - "EntryPoint": { - "V1CasperVm": { - "name": "transfer_from", - "args": [ - { - "name": "owner", - "cl_type": "Key" - }, - { - "name": "recipient", - "cl_type": "Key" - }, - { - "name": "amount", - "cl_type": "U256" + }, + { + "name": "migrate_user_allowance_keys", + "entry_point": { + "name": "migrate_user_allowance_keys", + "args": [], + "ret": "Unit", + "access": "Public", + "entry_point_type": "Called" } - ], - "ret": "Unit", - "access": "Public", - "entry_point_type": "Called", - "entry_point_payment": "Caller" - } - } - } - } - }, - { - "key": "entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58", - "kind": { - "Write": { - "AddressableEntity": { - "protocol_version": "2.0.0", - "entity_kind": { - "SmartContract": "VmCasperV1" - }, - "package_hash": "package-ab86f3895a5b0d8cd15113ec159f425037aceb9bb1b464affd9db54b592accf4", - "byte_code_hash": "byte-code-800e35cfd87b0f36479afdaf68725cd7ef0f503e8d541ed33afad4a18c7fa6eb", - "main_purse": "uref-2b130d8c617d24bd5366bdd2843db98a5e93e594ed827ace443b4ea6e4772f01-007", - "associated_keys": [ + }, { - "account_hash": "account-hash-e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f", - "weight": 1 - } - ], - "action_thresholds": { - "deployment": 1, - "upgrade_management": 1, - "key_management": 1 - }, - "message_topics": [ + "name": "migrate_user_balance_keys", + "entry_point": { + "name": "migrate_user_balance_keys", + "args": [], + "ret": "Unit", + "access": "Public", + "entry_point_type": "Called" + } + }, + { + "name": "mint", + "entry_point": { + "name": "mint", + "args": [ + { + "name": "owner", + "cl_type": "Key" + }, + { + "name": "amount", + "cl_type": "U256" + } + ], + "ret": "Unit", + "access": "Public", + "entry_point_type": "Called" + } + }, + { + "name": "name", + "entry_point": { + "name": "name", + "args": [], + "ret": "String", + "access": "Public", + "entry_point_type": "Called" + } + }, + { + "name": "symbol", + "entry_point": { + "name": "symbol", + "args": [], + "ret": "String", + "access": "Public", + "entry_point_type": "Called" + } + }, + { + "name": "total_supply", + "entry_point": { + "name": "total_supply", + "args": [], + "ret": "U256", + "access": "Public", + "entry_point_type": "Called" + } + }, { - "topic_name": "errors", - "topic_name_hash": "b38b3a8f7a7cb169b9869f1b660e328df63941f4f078d284a0058140375ec7fc" + "name": "transfer", + "entry_point": { + "name": "transfer", + "args": [ + { + "name": "recipient", + "cl_type": "Key" + }, + { + "name": "amount", + "cl_type": "U256" + } + ], + "ret": "Unit", + "access": "Public", + "entry_point_type": "Called" + } }, { - "topic_name": "events", - "topic_name_hash": "5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1" + "name": "transfer_from", + "entry_point": { + "name": "transfer_from", + "args": [ + { + "name": "owner", + "cl_type": "Key" + }, + { + "name": "recipient", + "cl_type": "Key" + }, + { + "name": "amount", + "cl_type": "U256" + } + ], + "ret": "Unit", + "access": "Public", + "entry_point_type": "Called" + } } - ] + ], + "protocol_version": "2.0.0" } } } }, { - "key": "package-ab86f3895a5b0d8cd15113ec159f425037aceb9bb1b464affd9db54b592accf4", + "key": "hash-976b060d3ae59125f3521c5dd16ca5f55c9862b37a9effa05c3770a9a4d7b870", "kind": { "Write": { - "Package": { + "ContractPackage": { + "access_key": "uref-d8a4e0ed98096e0df3263828e46c1f6758255853d3abcb32ebaf0776483a46bb-007", "versions": [ { - "entity_version_key": { - "protocol_version_major": 2, - "entity_version": 1 - }, - "addressable_entity_hash": "addressable-entity-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58" + "protocol_version_major": 2, + "contract_version": 1, + "contract_hash": "contract-783ac85c80ca97c0a3f699fedbde796c548e3cd0f8d015c3f3158090272eebd4" } ], "disabled_versions": [], @@ -926,48 +609,18 @@ } }, { - "key": "message-topic-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-b38b3a8f7a7cb169b9869f1b660e328df63941f4f078d284a0058140375ec7fc", + "key": "account-hash-9fa1fc0808d3a5b9ea9f3af4ca7c8c3655568fdf378d8afdf8a7e56e58abbfd4", "kind": { - "Write": { - "MessageTopic": { - "message_count": 0, - "blocktime": 1721206325167 + "AddKeys": [ + { + "name": "cep18_contract_hash_CLICKT Test", + "key": "entity-contract-783ac85c80ca97c0a3f699fedbde796c548e3cd0f8d015c3f3158090272eebd4" } - } + ] } }, { - "key": "message-topic-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1", - "kind": { - "Write": { - "MessageTopic": { - "message_count": 0, - "blocktime": 1721206325167 - } - } - } - }, - { - "key": "named-key-entity-account-e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f-1b97fc9e53ff59b389432fd44a90c5d773bb65a2933b8196a5c441724819f8d6", - "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "1102d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58", - "parsed": "entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58" - }, - "name": { - "cl_type": "String", - "bytes": "1f00000063657031385f636f6e74726163745f686173685f434c49434b312054657374", - "parsed": "cep18_contract_hash_CLICK1 Test" - } - } - } - } - }, - { - "key": "uref-a6b391748c16be8f8c000b5658884cea53332255596e0537667e71f2d358af90-000", + "key": "uref-e2e2f2ee35996daeb226a3d756bc1bd245e635c2f66ea6c0acd15859bc543519-000", "kind": { "Write": { "CLValue": { @@ -979,26 +632,18 @@ } }, { - "key": "named-key-entity-account-e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f-50e82d25e72fda1f67a69b3ac3a3a56565971c80577ba72df18d6fbd73f2bb1d", + "key": "account-hash-9fa1fc0808d3a5b9ea9f3af4ca7c8c3655568fdf378d8afdf8a7e56e58abbfd4", "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "02a6b391748c16be8f8c000b5658884cea53332255596e0537667e71f2d358af9007", - "parsed": "uref-a6b391748c16be8f8c000b5658884cea53332255596e0537667e71f2d358af90-007" - }, - "name": { - "cl_type": "String", - "bytes": "2200000063657031385f636f6e74726163745f76657273696f6e5f434c49434b312054657374", - "parsed": "cep18_contract_version_CLICK1 Test" - } + "AddKeys": [ + { + "name": "cep18_contract_version_CLICKT Test", + "key": "uref-e2e2f2ee35996daeb226a3d756bc1bd245e635c2f66ea6c0acd15859bc543519-007" } - } + ] } }, { - "key": "uref-419179eebe4ea6427e77a58aae6fac945c4d4135d042ff800d0be71ac17d7a8d-000", + "key": "uref-11aa02dd78243651d098b056c7a3761c9ba2024da11df432b350c36d6bc15d33-000", "kind": { "Write": { "CLValue": { @@ -1010,80 +655,52 @@ } }, { - "key": "named-key-entity-account-e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f-45ffbf1854843af5eeec6b167e14a9e97bdb526e66205b07559d4fb3928fb11e", + "key": "account-hash-9fa1fc0808d3a5b9ea9f3af4ca7c8c3655568fdf378d8afdf8a7e56e58abbfd4", "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "02419179eebe4ea6427e77a58aae6fac945c4d4135d042ff800d0be71ac17d7a8d07", - "parsed": "uref-419179eebe4ea6427e77a58aae6fac945c4d4135d042ff800d0be71ac17d7a8d-007" - }, - "name": { - "cl_type": "String", - "bytes": "06000000636f6e646f72", - "parsed": "condor" - } + "AddKeys": [ + { + "name": "condor", + "key": "uref-11aa02dd78243651d098b056c7a3761c9ba2024da11df432b350c36d6bc15d33-007" } - } + ] } }, { - "key": "entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58", + "key": "hash-783ac85c80ca97c0a3f699fedbde796c548e3cd0f8d015c3f3158090272eebd4", "kind": "Identity" }, { - "key": "package-ab86f3895a5b0d8cd15113ec159f425037aceb9bb1b464affd9db54b592accf4", + "key": "hash-976b060d3ae59125f3521c5dd16ca5f55c9862b37a9effa05c3770a9a4d7b870", "kind": "Identity" }, { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-4ca60287ae6129662475a8ce0d41c450d072b2430a8759f6178adeeff38523da", + "key": "hash-feb66b9d1f45bf0a4c11c2048c2b5c839f191128f883ad24d1c2508fc6ad285d", "kind": "Identity" }, { - "key": "byte-code-v1-wasm-800e35cfd87b0f36479afdaf68725cd7ef0f503e8d541ed33afad4a18c7fa6eb", - "kind": "Identity" - }, - { - "key": "named-key-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-c45567f4859db5b100d4c45a9638973ccdf0a7068a2a50f7a1c8709d5e84fbd2", + "key": "hash-783ac85c80ca97c0a3f699fedbde796c548e3cd0f8d015c3f3158090272eebd4", "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "10ab86f3895a5b0d8cd15113ec159f425037aceb9bb1b464affd9db54b592accf4", - "parsed": "package-ab86f3895a5b0d8cd15113ec159f425037aceb9bb1b464affd9db54b592accf4" - }, - "name": { - "cl_type": "String", - "bytes": "0c0000007061636b6167655f68617368", - "parsed": "package_hash" - } + "AddKeys": [ + { + "name": "package_hash", + "key": "package-976b060d3ae59125f3521c5dd16ca5f55c9862b37a9effa05c3770a9a4d7b870" } - } + ] } }, { - "key": "named-key-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-d447c1e29c0d374421e2c3f290c580a73aa748eba54e1b6bb3da0acdd4cdcee5", + "key": "hash-783ac85c80ca97c0a3f699fedbde796c548e3cd0f8d015c3f3158090272eebd4", "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "1102d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58", - "parsed": "entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58" - }, - "name": { - "cl_type": "String", - "bytes": "0d000000636f6e74726163745f68617368", - "parsed": "contract_hash" - } + "AddKeys": [ + { + "name": "contract_hash", + "key": "entity-contract-783ac85c80ca97c0a3f699fedbde796c548e3cd0f8d015c3f3158090272eebd4" } - } + ] } }, { - "key": "uref-e164c15c5fb035160a0d105a467fa4b6e7562746ffd2bdad6e5e3220878df19a-000", + "key": "uref-5014b553c6c195c6327fdbdf4c6f411cd1ad99aecaa1add06d6459b9452d66f5-000", "kind": { "Write": { "CLValue": { @@ -1095,26 +712,18 @@ } }, { - "key": "named-key-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-bce0df2b23ec57062235795dd9b7a1a6dc07885918c6cee5c5859a9df3d498e0", + "key": "hash-783ac85c80ca97c0a3f699fedbde796c548e3cd0f8d015c3f3158090272eebd4", "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "02e164c15c5fb035160a0d105a467fa4b6e7562746ffd2bdad6e5e3220878df19a07", - "parsed": "uref-e164c15c5fb035160a0d105a467fa4b6e7562746ffd2bdad6e5e3220878df19a-007" - }, - "name": { - "cl_type": "String", - "bytes": "0a000000616c6c6f77616e636573", - "parsed": "allowances" - } + "AddKeys": [ + { + "name": "allowances", + "key": "uref-5014b553c6c195c6327fdbdf4c6f411cd1ad99aecaa1add06d6459b9452d66f5-007" } - } + ] } }, { - "key": "uref-f032be9ae9bd295ec0403aa886d7247d27c296751176bd88d3b02c996626fd05-000", + "key": "uref-85a731470d19fb7c4986f85f8bc889aec3bd578c5e3f499ce8ff3311fde230dc-000", "kind": { "Write": { "CLValue": { @@ -1126,38 +735,30 @@ } }, { - "key": "named-key-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-058ed80a0c85bcf8470ac5b8ca4c14f1086c3cd5ae00f1f0592fee3addf4073c", + "key": "hash-783ac85c80ca97c0a3f699fedbde796c548e3cd0f8d015c3f3158090272eebd4", "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "02f032be9ae9bd295ec0403aa886d7247d27c296751176bd88d3b02c996626fd0507", - "parsed": "uref-f032be9ae9bd295ec0403aa886d7247d27c296751176bd88d3b02c996626fd05-007" - }, - "name": { - "cl_type": "String", - "bytes": "0800000062616c616e636573", - "parsed": "balances" - } + "AddKeys": [ + { + "name": "balances", + "key": "uref-85a731470d19fb7c4986f85f8bc889aec3bd578c5e3f499ce8ff3311fde230dc-007" } - } + ] } }, { - "key": "dictionary-ede600b099900d357796a3e23eecb1e5277bdfb93297c36f0c039d2c3a5c6557", + "key": "dictionary-02af2d6b9eb8e3c6c5e7403f44e01766ef86516bc40e674b360ea6d1c8ae21af", "kind": { "Write": { "CLValue": { "cl_type": "Any", - "bytes": "08000000070080c6a47e8d030720000000f032be9ae9bd295ec0403aa886d7247d27c296751176bd88d3b02c996626fd053000000045514869587777376d477171476d7946376a5672365a7a5449506f66664f72356b6f6f2f765146647352386b44773d3d", + "bytes": "08000000070080c6a47e8d03072000000085a731470d19fb7c4986f85f8bc889aec3bd578c5e3f499ce8ff3311fde230dc2c000000414a2b682f4167493036573536703836394d70386a445a56566f2f664e34324b2f66696e3557355971372f55", "parsed": null } } } }, { - "key": "uref-6e6c902ff1c50971ab62f788d0fe0171ebffceb91be9861c02ce55993ae6bcdc-000", + "key": "uref-f9afa20f6ac96ed3aac01ddeecfef4067aee7ad0b90ba12ce76a02cf29557817-000", "kind": { "Write": { "CLValue": { @@ -1169,199 +770,52 @@ } }, { - "key": "named-key-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5f4fd818ad44d4ae056e151759a8585de97a1c7c4d53ceecac6631f9fbb39ab6", + "key": "hash-783ac85c80ca97c0a3f699fedbde796c548e3cd0f8d015c3f3158090272eebd4", "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "026e6c902ff1c50971ab62f788d0fe0171ebffceb91be9861c02ce55993ae6bcdc07", - "parsed": "uref-6e6c902ff1c50971ab62f788d0fe0171ebffceb91be9861c02ce55993ae6bcdc-007" - }, - "name": { - "cl_type": "String", - "bytes": "0f00000073656375726974795f626164676573", - "parsed": "security_badges" - } + "AddKeys": [ + { + "name": "security_badges", + "key": "uref-f9afa20f6ac96ed3aac01ddeecfef4067aee7ad0b90ba12ce76a02cf29557817-007" } - } + ] } }, { - "key": "dictionary-30b94b42bb8ec2d32652ac73cf74031df44c1327c946924c5c9ffe82a94b3dd0", + "key": "dictionary-a083f799ef84f75134c43548f59d20a3fb41c9993ba5295b000c1541c929ae98", "kind": { "Write": { "CLValue": { "cl_type": "Any", - "bytes": "010000000003200000006e6c902ff1c50971ab62f788d0fe0171ebffceb91be9861c02ce55993ae6bcdc3000000045514869587777376d477171476d7946376a5672365a7a5449506f66664f72356b6f6f2f765146647352386b44773d3d", - "parsed": null - } - } - } - }, - { - "key": "uref-08f9c3e110c4d5cbc6e8ce71dd0cd535e4f41b34fe88c26cf3cd222004373db3-000", - "kind": "Identity" - }, - { - "key": "uref-9d1bc561e4c28250e3595b12b78989409f69ad336a8e398b4e9f6b91b3c28317-000", - "kind": { - "Write": { - "CLValue": { - "cl_type": "Unit", - "bytes": "", - "parsed": null - } - } - } - }, - { - "key": "named-key-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-0c12f81c2baaa55048b1b7f396d105681463f5ce8f43e9de903369fb55f29947", - "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "029d1bc561e4c28250e3595b12b78989409f69ad336a8e398b4e9f6b91b3c2831707", - "parsed": "uref-9d1bc561e4c28250e3595b12b78989409f69ad336a8e398b4e9f6b91b3c28317-007" - }, - "name": { - "cl_type": "String", - "bytes": "080000005f5f6576656e7473", - "parsed": "__events" - } - } - } - } - }, - { - "key": "uref-ab3e2fffdfad1bea4c6cea416dc7b820f769dc1ce9071d524d63e704ff0c3ae4-000", - "kind": { - "Write": { - "CLValue": { - "cl_type": "U32", - "bytes": "00000000", - "parsed": 0 - } - } - } - }, - { - "key": "named-key-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-dd93feca0896fb86350700d69861072bad6eae9c93e5f2ffeb43f2daa4f6fcc1", - "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "02ab3e2fffdfad1bea4c6cea416dc7b820f769dc1ce9071d524d63e704ff0c3ae407", - "parsed": "uref-ab3e2fffdfad1bea4c6cea416dc7b820f769dc1ce9071d524d63e704ff0c3ae4-007" - }, - "name": { - "cl_type": "String", - "bytes": "0f0000005f5f6576656e74735f6c656e677468", - "parsed": "__events_length" - } - } - } - } - }, - { - "key": "uref-8f51f4b1f048ba99b5b14e1021cfdb743af05c5c4452dd0350c5649a48cd3d09-000", - "kind": { - "Write": { - "CLValue": { - "cl_type": { - "Map": { - "key": "String", - "value": { - "List": { - "Tuple2": [ - "String", - "Any" - ] - } - } - } - }, - "bytes": "09000000040000004275726e02000000050000006f776e65720b06000000616d6f756e7407100000004368616e67654576656e74734d6f6465010000000b0000006576656e74735f6d6f6465030e0000004368616e67655365637572697479020000000500000061646d696e0b0e0000007365635f6368616e67655f6d6170110b03110000004465637265617365416c6c6f77616e636504000000050000006f776e65720b070000007370656e6465720b09000000616c6c6f77616e63650707000000646563725f62790711000000496e637265617365416c6c6f77616e636504000000050000006f776e65720b070000007370656e6465720b09000000616c6c6f77616e63650706000000696e635f627907040000004d696e740200000009000000726563697069656e740b06000000616d6f756e74070c000000536574416c6c6f77616e636503000000050000006f776e65720b070000007370656e6465720b09000000616c6c6f77616e636507080000005472616e73666572030000000600000073656e6465720b09000000726563697069656e740b06000000616d6f756e74070c0000005472616e7366657246726f6d04000000070000007370656e6465720b050000006f776e65720b09000000726563697069656e740b06000000616d6f756e7407", + "bytes": "01000000000320000000f9afa20f6ac96ed3aac01ddeecfef4067aee7ad0b90ba12ce76a02cf295578172c000000414a2b682f4167493036573536703836394d70386a445a56566f2f664e34324b2f66696e3557355971372f55", "parsed": null } } } }, { - "key": "named-key-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-1668218bcb4abcca6eb423a234252322df6319372653092475d173c00714a089", - "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "028f51f4b1f048ba99b5b14e1021cfdb743af05c5c4452dd0350c5649a48cd3d0907", - "parsed": "uref-8f51f4b1f048ba99b5b14e1021cfdb743af05c5c4452dd0350c5649a48cd3d09-007" - }, - "name": { - "cl_type": "String", - "bytes": "0f0000005f5f6576656e74735f736368656d61", - "parsed": "__events_schema" - } - } - } - } - }, - { - "key": "uref-8474015e6fe46390ce16ebe4f7f6dd9d88b9a1def98ae4c32f8808b53f66d582-000", - "kind": { - "Write": { - "CLValue": { - "cl_type": "String", - "bytes": "03000000312e31", - "parsed": "1.1" - } - } - } - }, - { - "key": "named-key-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-6cb1f5fa1d62a0d84f41d492ee1526320c547fd54ef072398e9aec731475e9d0", - "kind": { - "Write": { - "NamedKey": { - "named_key": { - "cl_type": "Key", - "bytes": "028474015e6fe46390ce16ebe4f7f6dd9d88b9a1def98ae4c32f8808b53f66d58207", - "parsed": "uref-8474015e6fe46390ce16ebe4f7f6dd9d88b9a1def98ae4c32f8808b53f66d582-007" - }, - "name": { - "cl_type": "String", - "bytes": "140000005f5f6576656e74735f6365735f76657273696f6e", - "parsed": "__events_ces_version" - } - } - } - } - }, - { - "key": "uref-08f9c3e110c4d5cbc6e8ce71dd0cd535e4f41b34fe88c26cf3cd222004373db3-000", + "key": "uref-a0cb023abb00bf87f9898b5fdce36569d5b87b7891e2b5023e663a5bc78134e0-000", "kind": "Identity" }, { - "key": "message-topic-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1", + "key": "message-topic-783ac85c80ca97c0a3f699fedbde796c548e3cd0f8d015c3f3158090272eebd4-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1", "kind": "Identity" }, { - "key": "message-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1-0", + "key": "message-783ac85c80ca97c0a3f699fedbde796c548e3cd0f8d015c3f3158090272eebd4-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1-0", "kind": { "Write": { - "Message": "message-checksum-de44efda117cc02be18edf564107308f982498f7a781e7496f7f20d05957bb3c" + "Message": "message-checksum-4f9c3b0e96c2fd77a8a0d11c123c23ee4251c183707307205ae02ecd29c3385e" } } }, { - "key": "message-topic-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1", + "key": "message-topic-783ac85c80ca97c0a3f699fedbde796c548e3cd0f8d015c3f3158090272eebd4-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1", "kind": { "Write": { "MessageTopic": { "message_count": 1, - "blocktime": 1721206325167 + "blocktime": 1734512599230, + "topic_name": "events" } } } @@ -1377,9 +831,9 @@ "U64" ] }, - "bytes": "af3fe4bf900100000100000000000000", + "bytes": "bee001d9930100000100000000000000", "parsed": [ - 1721206325167, + 1734512599230, 1 ] } @@ -1387,41 +841,13 @@ } }, { - "key": "uref-ab3e2fffdfad1bea4c6cea416dc7b820f769dc1ce9071d524d63e704ff0c3ae4-000", - "kind": "Identity" - }, - { - "key": "dictionary-17125c888001cf5f36a03240f55838b5d9e09172292589fff4a7b25ae6e6c5b2", + "key": "balance-hold-01e542fb9f5dc6d06d849e2ac3ad6cc5cd4b7c71392dc8759c0898f4ab04439520bee001d993010000", "kind": { - "Write": { - "CLValue": { - "cl_type": "Any", - "bytes": "3c000000380000000a0000006576656e745f4d696e741101e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f070080c6a47e8d030e03200000009d1bc561e4c28250e3595b12b78989409f69ad336a8e398b4e9f6b91b3c283170100000030", - "parsed": null - } - } + "Prune": "balance-hold-01e542fb9f5dc6d06d849e2ac3ad6cc5cd4b7c71392dc8759c0898f4ab04439520bee001d993010000" } }, { - "key": "uref-ab3e2fffdfad1bea4c6cea416dc7b820f769dc1ce9071d524d63e704ff0c3ae4-000", - "kind": { - "Write": { - "CLValue": { - "cl_type": "U32", - "bytes": "01000000", - "parsed": 1 - } - } - } - }, - { - "key": "balance-hold-016f8eee1d8ea5eee794ffe69a9008c9c8620eea284ee2c49bf686ae8eee042215af3fe4bf90010000", - "kind": { - "Prune": "balance-hold-016f8eee1d8ea5eee794ffe69a9008c9c8620eea284ee2c49bf686ae8eee042215af3fe4bf90010000" - } - }, - { - "key": "balance-hold-006f8eee1d8ea5eee794ffe69a9008c9c8620eea284ee2c49bf686ae8eee042215af3fe4bf90010000", + "key": "balance-hold-00e542fb9f5dc6d06d849e2ac3ad6cc5cd4b7c71392dc8759c0898f4ab04439520bee001d993010000", "kind": { "Write": { "CLValue": { @@ -1433,29 +859,17 @@ } }, { - "key": "entity-system-8499396a854bbe7e172a5ab675caf3c7b944f57e43cee5b7563971678f8650b2", - "kind": "Identity" - }, - { - "key": "entity-system-989625d28e779749e3cacc7367403dd459c8e7082937436f16d5dbff7aec8292", - "kind": "Identity" - }, - { - "key": "entity-system-da2faf76ab117ec370d10f994e9407ff014ab974bedc50e58425a9e35428dd0c", - "kind": "Identity" - }, - { - "key": "bid-addr-011c50d14ca563d5afe0399a3da010bac01383f502bc7cce774cc03d858a94cf06", + "key": "bid-addr-01dcd0c38c46c9d5c7083aa1a46b430e8e460f97f8f0bf8444776ac925187acfcc", "kind": "Identity" }, { - "key": "bid-addr-041c50d14ca563d5afe0399a3da010bac01383f502bc7cce774cc03d858a94cf06a700000000000000", + "key": "bid-addr-04dcd0c38c46c9d5c7083aa1a46b430e8e460f97f8f0bf8444776ac925187acfcc0800000000000000", "kind": { "Write": { "BidKind": { "Credit": { - "validator_public_key": "01f58b94526d280881f79744effebc555426190950d5dfdd2f8aaf10ceaec010c6", - "era_id": 167, + "validator_public_key": "01509254f22690fbe7fb6134be574c4fbdb060dfa699964653b99753485e518ea6", + "era_id": 8, "amount": "1000000000000" } } diff --git a/Casper.Network.SDK.Test/TestData/get-transaction-stored-v200.json b/Casper.Network.SDK.Test/TestData/get-transaction-stored-v200.json index 7fed4b1..db6c83d 100644 --- a/Casper.Network.SDK.Test/TestData/get-transaction-stored-v200.json +++ b/Casper.Network.SDK.Test/TestData/get-transaction-stored-v200.json @@ -2,271 +2,125 @@ "api_version": "2.0.0", "transaction": { "Version1": { - "hash": "3fe455e770f5464234b1321bcb6bd02c553649f9a8a468e5a37570f24631968d", - "header": { - "chain_name": "casper-net-1", - "timestamp": "2024-07-17T09:03:11.866Z", + "hash": "173251b375edd42e3ee43a05ff7d1996380c59192a785884a8cfdd574d86aa9a", + "payload": { + "initiator_addr": { + "PublicKey": "01a5a5b7328118681638be3e06c8749609280dba4c9daf9aeb3d3464b8839b018a" + }, + "timestamp": "2024-12-18T10:27:48.633Z", "ttl": "30m", - "body_hash": "07ed52f990a206153d2a29f6a42eb754009c4b120981dd3fd0842d4057ee7484", + "chain_name": "casper-net-1", "pricing_mode": { - "Fixed": { - "gas_price_tolerance": 1 + "PaymentLimited": { + "payment_amount": 3000000000, + "gas_price_tolerance": 1, + "standard_payment": true } }, - "initiator_addr": { - "AccountHash": "account-hash-e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f" - } - }, - "body": { - "args": [ - [ - "recipient", - { - "cl_type": "Key", - "bytes": "00e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f", - "parsed": "account-hash-e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f" - } - ], - [ - "amount", - { - "cl_type": "U256", - "bytes": "02d930", - "parsed": "12505" + "fields": { + "args": { + "Named": [ + [ + "recipient", + { + "cl_type": "Key", + "bytes": "00e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f", + "parsed": "account-hash-e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f" + } + ], + [ + "amount", + { + "cl_type": "U256", + "bytes": "02a861", + "parsed": "25000" + } + ] + ] + }, + "entry_point": { + "Custom": "transfer" + }, + "scheduling": "Standard", + "target": { + "Stored": { + "id": { + "ByPackageName": { + "name": "cep18_contract_package_CLICKT Test", + "version": null + } + }, + "runtime": "VmCasperV1" } - ] - ], - "target": { - "Stored": { - "id": { - "ByPackageName": { - "name": "cep18_contract_package_CLICK1 Test", - "version": null - } - }, - "runtime": "VmCasperV1" } - }, - "entry_point": { - "Custom": "transfer" - }, - "transaction_category": 4, - "scheduling": "Standard" + } }, "approvals": [ { - "signer": "0106ed45915392c02b37136618372ac8dde8e0e3b8ee6190b2ca6db539b354ede4", - "signature": "010641446be631a751415fd88827bd0c804a390824c48b7f1272f37b827853dcf3ae5710e662570d28dab8a283994f4f096cbd1d4ebb2f7fd24fb05b2b9b61640f" + "signer": "01a5a5b7328118681638be3e06c8749609280dba4c9daf9aeb3d3464b8839b018a", + "signature": "01b39caf891bbac7902078222651a6158bc7aa387355b8d37c70289f58330bc86ab920afcf51be5a523d2be30427150c228ba08aafb45ba927f762a270bdd8f006" } ] } }, "execution_info": { - "block_hash": "b6446a0508cbf2bffdf855213ea6eb43267c4dfacd667b50cf8d8f0098112a3b", - "block_height": 1984, + "block_hash": "5fd0ee0a8929245148a87cfe57355bf3762dbeabdef91155e1e13f23954d3f92", + "block_height": 1400, "execution_result": { "Version2": { "initiator": { - "AccountHash": "account-hash-e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f" + "PublicKey": "01a5a5b7328118681638be3e06c8749609280dba4c9daf9aeb3d3464b8839b018a" }, - "error_message": null, - "limit": "50000000000", - "consumed": "763310980", - "cost": "50000000000", - "payment": [], + "error_message": "ApiError::Formatting [18]", + "limit": "3000000000", + "consumed": "1241925", + "cost": "3000000000", "transfers": [], - "size_estimate": 363, + "size_estimate": 591, "effects": [ { - "key": "balance-hold-016f8eee1d8ea5eee794ffe69a9008c9c8620eea284ee2c49bf686ae8eee0422150b78eebf90010000", + "key": "balance-hold-01e542fb9f5dc6d06d849e2ac3ad6cc5cd4b7c71392dc8759c0898f4ab04439520b1414fd993010000", "kind": { "Write": { "CLValue": { "cl_type": "U512", - "bytes": "0500743ba40b", - "parsed": "50000000000" + "bytes": "04005ed0b2", + "parsed": "3000000000" } } } }, { - "key": "package-ab86f3895a5b0d8cd15113ec159f425037aceb9bb1b464affd9db54b592accf4", - "kind": "Identity" - }, - { - "key": "entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58", - "kind": "Identity" - }, - { - "key": "package-ab86f3895a5b0d8cd15113ec159f425037aceb9bb1b464affd9db54b592accf4", - "kind": "Identity" - }, - { - "key": "entry-point-v1-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-3820ce25e54df0470fb738e3e0f63ee50b2719cf2680da2bdb579e21aebc8f63", - "kind": "Identity" - }, - { - "key": "byte-code-v1-wasm-800e35cfd87b0f36479afdaf68725cd7ef0f503e8d541ed33afad4a18c7fa6eb", - "kind": "Identity" - }, - { - "key": "dictionary-ede600b099900d357796a3e23eecb1e5277bdfb93297c36f0c039d2c3a5c6557", - "kind": "Identity" - }, - { - "key": "dictionary-b25d5021fc15e97434b4e8128804f5c8e7ce21e65bbe80d0ec344c23f93c7582", - "kind": "Identity" - }, - { - "key": "dictionary-ede600b099900d357796a3e23eecb1e5277bdfb93297c36f0c039d2c3a5c6557", + "key": "balance-hold-01e542fb9f5dc6d06d849e2ac3ad6cc5cd4b7c71392dc8759c0898f4ab04439520b1414fd993010000", "kind": { - "Write": { - "CLValue": { - "cl_type": "Any", - "bytes": "0800000007c38bc5a47e8d030720000000f032be9ae9bd295ec0403aa886d7247d27c296751176bd88d3b02c996626fd053000000045514869587777376d477171476d7946376a5672365a7a5449506f66664f72356b6f6f2f765146647352386b44773d3d", - "parsed": null - } - } + "Prune": "balance-hold-01e542fb9f5dc6d06d849e2ac3ad6cc5cd4b7c71392dc8759c0898f4ab04439520b1414fd993010000" } }, { - "key": "dictionary-b25d5021fc15e97434b4e8128804f5c8e7ce21e65bbe80d0ec344c23f93c7582", - "kind": { - "Write": { - "CLValue": { - "cl_type": "Any", - "bytes": "03000000023df40720000000f032be9ae9bd295ec0403aa886d7247d27c296751176bd88d3b02c996626fd052c000000414f4a664444755961716f61624958754e5776706e4e4d672b68393836766d53696a2b394156327848795150", - "parsed": null - } - } - } - }, - { - "key": "uref-08f9c3e110c4d5cbc6e8ce71dd0cd535e4f41b34fe88c26cf3cd222004373db3-000", - "kind": "Identity" - }, - { - "key": "message-topic-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1", - "kind": "Identity" - }, - { - "key": "block-message-count-00000000000000000000000000000000000000000000000000000000000000", - "kind": "Identity" - }, - { - "key": "message-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1-1", - "kind": { - "Write": { - "Message": "message-checksum-f6a3531f88cf8e763916a16e95a64e2ef93b0567064830ad5912523fad71fbe2" - } - } - }, - { - "key": "message-topic-entity-contract-d8850e3227ce97cdb21a3e266fe360a196ec6c97058ee1ea242da0d03aa51c58-5721a6d9d7a9afe5dfdb35276fb823bed0f825350e4d865a5ec0110c380de4e1", - "kind": { - "Write": { - "MessageTopic": { - "message_count": 2, - "blocktime": 1721206994955 - } - } - } - }, - { - "key": "block-message-count-00000000000000000000000000000000000000000000000000000000000000", - "kind": { - "Write": { - "CLValue": { - "cl_type": { - "Tuple2": [ - "U64", - "U64" - ] - }, - "bytes": "0b78eebf900100000200000000000000", - "parsed": [ - 1721206994955, - 2 - ] - } - } - } - }, - { - "key": "uref-ab3e2fffdfad1bea4c6cea416dc7b820f769dc1ce9071d524d63e704ff0c3ae4-000", - "kind": "Identity" - }, - { - "key": "dictionary-55775426d9d4425e15abc8f1e7241ef945379bf5037bb346e3ca15a4fe1ccb50", - "kind": { - "Write": { - "CLValue": { - "cl_type": "Any", - "bytes": "5c000000580000000e0000006576656e745f5472616e736665721101e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f00e25f0c3b986aaa1a6c85ee356be99cd320fa1f7ceaf9928a3fbd015db11f240f02d9300e03200000009d1bc561e4c28250e3595b12b78989409f69ad336a8e398b4e9f6b91b3c283170100000035", - "parsed": null - } - } - } - }, - { - "key": "uref-ab3e2fffdfad1bea4c6cea416dc7b820f769dc1ce9071d524d63e704ff0c3ae4-000", - "kind": { - "Write": { - "CLValue": { - "cl_type": "U32", - "bytes": "06000000", - "parsed": 6 - } - } - } - }, - { - "key": "balance-hold-016f8eee1d8ea5eee794ffe69a9008c9c8620eea284ee2c49bf686ae8eee0422150b78eebf90010000", - "kind": { - "Prune": "balance-hold-016f8eee1d8ea5eee794ffe69a9008c9c8620eea284ee2c49bf686ae8eee0422150b78eebf90010000" - } - }, - { - "key": "balance-hold-006f8eee1d8ea5eee794ffe69a9008c9c8620eea284ee2c49bf686ae8eee0422150b78eebf90010000", + "key": "balance-hold-00e542fb9f5dc6d06d849e2ac3ad6cc5cd4b7c71392dc8759c0898f4ab04439520b1414fd993010000", "kind": { "Write": { "CLValue": { "cl_type": "U512", - "bytes": "0500743ba40b", - "parsed": "50000000000" + "bytes": "04005ed0b2", + "parsed": "3000000000" } } } }, { - "key": "entity-system-8499396a854bbe7e172a5ab675caf3c7b944f57e43cee5b7563971678f8650b2", - "kind": "Identity" - }, - { - "key": "entity-system-989625d28e779749e3cacc7367403dd459c8e7082937436f16d5dbff7aec8292", - "kind": "Identity" - }, - { - "key": "entity-system-da2faf76ab117ec370d10f994e9407ff014ab974bedc50e58425a9e35428dd0c", - "kind": "Identity" - }, - { - "key": "bid-addr-0165a3d53119035ffe8560a67e355a80b2edaf2673fbd2d1d90b70a033b1566213", - "kind": "Identity" - }, - { - "key": "bid-addr-0465a3d53119035ffe8560a67e355a80b2edaf2673fbd2d1d90b70a033b1566213b700000000000000", + "key": "bid-addr-01520037cd249ccbcfeb0b9feae07d8d4f7d922cf88adc4f3e8691f9d34ccc8d09", "kind": "Identity" }, { - "key": "bid-addr-0465a3d53119035ffe8560a67e355a80b2edaf2673fbd2d1d90b70a033b1566213b700000000000000", + "key": "bid-addr-04520037cd249ccbcfeb0b9feae07d8d4f7d922cf88adc4f3e8691f9d34ccc8d098100000000000000", "kind": { "Write": { "BidKind": { "Credit": { - "validator_public_key": "01c867ff3cf1d4e4e68fc00922fdcb740304def196e223091dee62012f444b9eba", - "era_id": 183, - "amount": "50000000000" + "validator_public_key": "0190664e16a17594ed2d0e3c279c4cf5894e8db0da15e3b91c938562a1caae32ab", + "era_id": 129, + "amount": "3000000000" } } } @@ -276,4 +130,4 @@ } } } -} \ No newline at end of file +} diff --git a/Casper.Network.SDK/Types/StoredValue.cs b/Casper.Network.SDK/Types/StoredValue.cs index e1afa70..1fedfa4 100644 --- a/Casper.Network.SDK/Types/StoredValue.cs +++ b/Casper.Network.SDK/Types/StoredValue.cs @@ -44,7 +44,7 @@ public class StoredValue /// /// Stores a package. /// - public Package SmartContract { get; init; } + public Package Package { get; init; } /// /// A record of byte code. @@ -107,17 +107,6 @@ JsonSerializerOptions options var propertyValue = JsonSerializer.Deserialize(ref reader, propertyInfo.PropertyType, options); propertyInfo.SetValue(storedValue, propertyValue); } - else if(propertyName.Equals("LegacyTransfer", StringComparison.InvariantCultureIgnoreCase)) - { - reader.Read(); - - var serializerOptions = new JsonSerializerOptions(options); - serializerOptions.Converters.Add(new Transfer.TransferConverter()); - - var t = JsonSerializer.Deserialize(ref reader, serializerOptions); - propertyInfo = typeof(StoredValue).GetProperty("Transfer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase); - propertyInfo?.SetValue(storedValue, t); - } else throw new JsonException($"Unknown property: {propertyName}."); } diff --git a/Casper.Network.SDK/Types/Transaction.cs b/Casper.Network.SDK/Types/Transaction.cs index 20f105a..42d2f69 100644 --- a/Casper.Network.SDK/Types/Transaction.cs +++ b/Casper.Network.SDK/Types/Transaction.cs @@ -76,14 +76,10 @@ public TransactionVersion Version public ITransactionScheduling Scheduling { get; set; } - public TransactionCategory Category { get; set; } - public ITransactionInvocation Invocation { get; init; } public interface ITransactionInvocation { - TransactionCategory Category { get; init; } - List RuntimeArgs { get; init; } CLValue GetRuntimeArgValue(string name); @@ -91,8 +87,6 @@ public interface ITransactionInvocation public abstract class TransactionInvocation : ITransactionInvocation { - public TransactionCategory Category { get; init; } - public List RuntimeArgs { get; init; } public CLValue GetRuntimeArgValue(string name) @@ -265,7 +259,6 @@ public static explicit operator Transaction(Deploy deploy) PricingMode = pricingMode, Approvals = deploy.Approvals, Scheduling = TransactionScheduling.Standard, - Category = deploy.Session is TransferDeployItem ? TransactionCategory.Mint : TransactionCategory.Large, Invocation = invocation, }; } diff --git a/Docs/Examples/NativeTransfer/Program.cs b/Docs/Examples/NativeTransfer/Program.cs index 0cfd95f..e81f4f0 100644 --- a/Docs/Examples/NativeTransfer/Program.cs +++ b/Docs/Examples/NativeTransfer/Program.cs @@ -40,7 +40,7 @@ public static async Task Main(string[] args) .Amount(25_000_000_000) .Id(DateUtils.ToEpochTime(DateTime.Now)) .ChainName(chainName) - .GasPriceTolerance(1) + .Payment(PricingMode.PaymentLimited(100_000_000, 1)) .Build(); // sign the transaction and send it to the network From 2c3699df7900555163236d7da5f65122a381bdaf Mon Sep 17 00:00:00 2001 From: David Hernando Date: Wed, 18 Dec 2024 11:35:37 +0100 Subject: [PATCH 3/3] fix test Signed-off-by: David Hernando --- Casper.Network.SDK.Test/RPCResponses/GetEntityResultTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Casper.Network.SDK.Test/RPCResponses/GetEntityResultTest.cs b/Casper.Network.SDK.Test/RPCResponses/GetEntityResultTest.cs index 6b04ddc..e8f810f 100644 --- a/Casper.Network.SDK.Test/RPCResponses/GetEntityResultTest.cs +++ b/Casper.Network.SDK.Test/RPCResponses/GetEntityResultTest.cs @@ -45,7 +45,7 @@ public void GetEntityContractTest_v200() Assert.IsNotNull(result.Entity.Package); Assert.IsNotNull(result.Entity.MainPurse); Assert.AreEqual("byte-code-85def61e3ee02e10a1e845cfb8e8b2d9640a18f605333158027a24ed8569d895", result.Entity.ByteCodeHash); - Assert.AreEqual(TransactionRuntime.VmCasperV1().ToString(), result.Entity.EntityKind.SmartContract); + Assert.AreEqual(TransactionRuntime.VmCasperV1().ToString(), result.Entity.EntityKind.SmartContract.ToString()); Assert.AreEqual(1, result.Entity.ActionThresholds.KeyManagement); Assert.AreEqual(1, result.Entity.ActionThresholds.Deployment); Assert.AreEqual(1, result.Entity.ActionThresholds.UpgradeManagement);