From 6aee59443ed9e638c78195ab3ae774cc0a3cc54e Mon Sep 17 00:00:00 2001 From: Jinghui Liao Date: Fri, 15 Dec 2023 16:33:11 +0800 Subject: [PATCH 1/6] add more storagemap get methods --- .../Services/StorageMap.cs | 212 +++++++++++++++++- .../Services/StorageTest.cs | 23 ++ .../TestClasses/Contract_Storage.cs | 44 ++++ 3 files changed, 274 insertions(+), 5 deletions(-) diff --git a/src/Neo.SmartContract.Framework/Services/StorageMap.cs b/src/Neo.SmartContract.Framework/Services/StorageMap.cs index ae979a1a3..a08dfad06 100644 --- a/src/Neo.SmartContract.Framework/Services/StorageMap.cs +++ b/src/Neo.SmartContract.Framework/Services/StorageMap.cs @@ -1,10 +1,10 @@ // Copyright (C) 2015-2023 The Neo Project. -// -// The Neo.SmartContract.Framework is free software distributed under the MIT -// software license, see the accompanying file LICENSE in the main directory -// of the project or http://www.opensource.org/licenses/mit-license.php +// +// The Neo.SmartContract.Framework is free software distributed under the MIT +// software license, see the accompanying file LICENSE in the main directory +// of the project or http://www.opensource.org/licenses/mit-license.php // for more details. -// +// // Redistribution and use in source and binary forms with or without // modifications are permitted. @@ -114,6 +114,89 @@ public class StorageMap [Syscall("System.Storage.Get")] public extern ByteString Get(ByteString key); + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + public extern ByteString GetUInt160(ByteString key); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + public extern ByteString GetUInt256(ByteString key); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + public extern ByteString GetECPoint(ByteString key); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + [OpCode(OpCode.CONVERT, StackItemType.Buffer)] + public extern byte[] GetByteArray(ByteString key); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + public extern ByteString GetString(ByteString key); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + [OpCode(OpCode.CONVERT, StackItemType.Integer)] + public extern int GetInteger(ByteString key); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + [OpCode(OpCode.NOT)] + [OpCode(OpCode.NOT)] + public extern bool GetBoolean(ByteString key); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + [OpCode(OpCode.DUP)] + [OpCode(OpCode.ISNULL)] + [OpCode(OpCode.JMPIFNOT, "0x06")] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.PUSH0)] + [OpCode(OpCode.JMP, "0x04")] + [OpCode(OpCode.CONVERT, StackItemType.Integer)] + public extern int GetIntegerOrZero(ByteString key); + [CallingConvention(CallingConvention.Cdecl)] [OpCode(OpCode.UNPACK)] [OpCode(OpCode.DROP)] @@ -123,6 +206,89 @@ public class StorageMap [Syscall("System.Storage.Get")] public extern ByteString Get(byte[] key); + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + public extern ByteString GetUInt160(byte[] key); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + public extern ByteString GetUInt256(byte[] key); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + public extern ByteString GetECPoint(byte[] key); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + [OpCode(OpCode.CONVERT, StackItemType.Buffer)] + public extern byte[] GetByteArray(byte[] key); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + public extern ByteString GetString(byte[] key); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + [OpCode(OpCode.CONVERT, StackItemType.Integer)] + public extern int GetInteger(byte[] key); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + [OpCode(OpCode.NOT)] + [OpCode(OpCode.NOT)] + public extern bool GetBoolean(byte[] key); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Get")] + [OpCode(OpCode.DUP)] + [OpCode(OpCode.ISNULL)] + [OpCode(OpCode.JMPIFNOT, "0x06")] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.PUSH0)] + [OpCode(OpCode.JMP, "0x04")] + [OpCode(OpCode.CONVERT, StackItemType.Integer)] + public extern int GetIntegerOrZero(byte[] key); + public object GetObject(ByteString key) { ByteString value = Get(key); @@ -197,6 +363,42 @@ public object GetObject(byte[] key) [Syscall("System.Storage.Put")] public extern void Put(byte[] key, BigInteger value); + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Put")] + public extern void Put(ByteString key, bool value); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Put")] + public extern void Put(byte[] key, bool value); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Put")] + public extern void Put(ByteString key, byte[] value); + + [CallingConvention(CallingConvention.Cdecl)] + [OpCode(OpCode.UNPACK)] + [OpCode(OpCode.DROP)] + [OpCode(OpCode.REVERSE3)] + [OpCode(OpCode.CAT)] + [OpCode(OpCode.SWAP)] + [Syscall("System.Storage.Put")] + public extern void Put(byte[] key, byte[] value); + public void PutObject(ByteString key, object value) { Put(key, StdLib.Serialize(value)); diff --git a/tests/Neo.SmartContract.Framework.UnitTests/Services/StorageTest.cs b/tests/Neo.SmartContract.Framework.UnitTests/Services/StorageTest.cs index 024e2e377..7823cb53d 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/Services/StorageTest.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/Services/StorageTest.cs @@ -196,5 +196,28 @@ public void Test_Index() Assert.AreEqual(VM.VMState.HALT, testengine.State); Assert.AreEqual(value, result.Pop().GetString()); } + + [TestMethod] + public void Test_NewGetMethods() + { + testengine.Reset(); + var result = testengine.ExecuteTestCaseStandard("testNewGetMethods"); + Assert.AreEqual(1, result.Count); + Assert.AreEqual(VM.VMState.HALT, testengine.State); + Assert.AreEqual(true, result.Pop().GetBoolean()); + } + + [TestMethod] + public void Test_NewGetByteArray() + { + testengine.Reset(); + var result = testengine.ExecuteTestCaseStandard("testNewGetByteArray"); + var testArr = new byte[] { 0x00, 0x01 }; + Assert.AreEqual(1, result.Count); + var res = result.Pop().GetSpan().ToArray(); + Assert.AreEqual(VM.VMState.HALT, testengine.State); + Assert.AreEqual(testArr[0], res[0]); + Assert.AreEqual(testArr[1], res[1]); + } } } diff --git a/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs b/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs index 45856db0f..a98850ebb 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs @@ -1,7 +1,9 @@ using Neo.SmartContract.Framework.Services; +using Neo.SmartContract.Framework; namespace Neo.SmartContract.Framework.UnitTests.TestClasses { + public class Contract_Storage : SmartContract { // There is no main here, it can be auto generation. @@ -93,6 +95,48 @@ public static byte[] TestGetByteArray(byte[] key) return (byte[])value; } + public static bool TestNewGetMethods() + { + var prefix = new byte[] { 0x00, 0xFF }; + var context = Storage.CurrentContext; + var storage = new StorageMap(context, prefix); + + var boolValue = true; + var intValue = 123; + var stringValue = "hello world"; + var uint160Value = UInt160.Zero; + var uint256Value = UInt256.Zero; + + storage.Put("bool", boolValue); + storage.Put("int", intValue); + storage.Put("string", stringValue); + storage.Put("uint160", uint160Value); + storage.Put("uint256", uint256Value); + + var boolValue2 = storage.GetBoolean("bool"); + var intValue2 = storage.GetInteger("int"); + var stringValue2 = storage.GetString("string"); + var uint160Value2 = storage.GetUInt160("uint160"); + var uint256Value2 = storage.GetUInt256("uint256"); + + return boolValue == boolValue2 + && intValue == intValue2 + &&stringValue == stringValue2 + && uint160Value == uint160Value2 + && uint256Value == uint256Value2; + } + + public static byte[] TestNewGetByteArray() + { + var prefix = new byte[] { 0x00, 0xFF }; + var context = Storage.CurrentContext; + var storage = new StorageMap(context, prefix); + var byteArray = new byte[] { 0x00, 0x01 }; + storage.Put("byteArray", byteArray); + var byteArray2 = storage.GetByteArray("byteArray"); + return byteArray2; + } + #endregion public static bool TestPutReadOnly(byte[] key, byte[] value) From 8aa4ac21e2345fa241410a0242c42a56a922083c Mon Sep 17 00:00:00 2001 From: Shargon Date: Fri, 15 Dec 2023 02:41:22 -0800 Subject: [PATCH 2/6] Update tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs --- .../TestClasses/Contract_Storage.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs b/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs index a98850ebb..55a11c997 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs @@ -3,7 +3,6 @@ namespace Neo.SmartContract.Framework.UnitTests.TestClasses { - public class Contract_Storage : SmartContract { // There is no main here, it can be auto generation. From 0d34cc5001919413a391578d594f55abcbc93376 Mon Sep 17 00:00:00 2001 From: Jinghui Liao Date: Fri, 15 Dec 2023 18:53:31 +0800 Subject: [PATCH 3/6] fix return type --- src/Neo.SmartContract.Framework/Services/StorageMap.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Neo.SmartContract.Framework/Services/StorageMap.cs b/src/Neo.SmartContract.Framework/Services/StorageMap.cs index a08dfad06..0ae1a3120 100644 --- a/src/Neo.SmartContract.Framework/Services/StorageMap.cs +++ b/src/Neo.SmartContract.Framework/Services/StorageMap.cs @@ -121,7 +121,7 @@ public class StorageMap [OpCode(OpCode.CAT)] [OpCode(OpCode.SWAP)] [Syscall("System.Storage.Get")] - public extern ByteString GetUInt160(ByteString key); + public extern UInt160 GetUInt160(ByteString key); [CallingConvention(CallingConvention.Cdecl)] [OpCode(OpCode.UNPACK)] @@ -130,7 +130,7 @@ public class StorageMap [OpCode(OpCode.CAT)] [OpCode(OpCode.SWAP)] [Syscall("System.Storage.Get")] - public extern ByteString GetUInt256(ByteString key); + public extern UInt256 GetUInt256(ByteString key); [CallingConvention(CallingConvention.Cdecl)] [OpCode(OpCode.UNPACK)] @@ -213,7 +213,7 @@ public class StorageMap [OpCode(OpCode.CAT)] [OpCode(OpCode.SWAP)] [Syscall("System.Storage.Get")] - public extern ByteString GetUInt160(byte[] key); + public extern UInt160 GetUInt160(byte[] key); [CallingConvention(CallingConvention.Cdecl)] [OpCode(OpCode.UNPACK)] @@ -222,7 +222,7 @@ public class StorageMap [OpCode(OpCode.CAT)] [OpCode(OpCode.SWAP)] [Syscall("System.Storage.Get")] - public extern ByteString GetUInt256(byte[] key); + public extern UInt256 GetUInt256(byte[] key); [CallingConvention(CallingConvention.Cdecl)] [OpCode(OpCode.UNPACK)] From a73491af2f2b173f79926225a59acfc9053027fe Mon Sep 17 00:00:00 2001 From: Jinghui Liao Date: Fri, 15 Dec 2023 18:56:11 +0800 Subject: [PATCH 4/6] ECPoint and BigInteger --- .../Services/StorageMap.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Neo.SmartContract.Framework/Services/StorageMap.cs b/src/Neo.SmartContract.Framework/Services/StorageMap.cs index 0ae1a3120..cadf1947b 100644 --- a/src/Neo.SmartContract.Framework/Services/StorageMap.cs +++ b/src/Neo.SmartContract.Framework/Services/StorageMap.cs @@ -15,6 +15,7 @@ using Neo.SmartContract.Framework.Native; using System.Numerics; using System.Runtime.InteropServices; +using Neo.Cryptography.ECC; namespace Neo.SmartContract.Framework.Services { @@ -139,7 +140,7 @@ public class StorageMap [OpCode(OpCode.CAT)] [OpCode(OpCode.SWAP)] [Syscall("System.Storage.Get")] - public extern ByteString GetECPoint(ByteString key); + public extern ECPoint GetECPoint(ByteString key); [CallingConvention(CallingConvention.Cdecl)] [OpCode(OpCode.UNPACK)] @@ -168,7 +169,7 @@ public class StorageMap [OpCode(OpCode.SWAP)] [Syscall("System.Storage.Get")] [OpCode(OpCode.CONVERT, StackItemType.Integer)] - public extern int GetInteger(ByteString key); + public extern BigInteger GetInteger(ByteString key); [CallingConvention(CallingConvention.Cdecl)] [OpCode(OpCode.UNPACK)] @@ -195,7 +196,7 @@ public class StorageMap [OpCode(OpCode.PUSH0)] [OpCode(OpCode.JMP, "0x04")] [OpCode(OpCode.CONVERT, StackItemType.Integer)] - public extern int GetIntegerOrZero(ByteString key); + public extern BigInteger GetIntegerOrZero(ByteString key); [CallingConvention(CallingConvention.Cdecl)] [OpCode(OpCode.UNPACK)] @@ -231,7 +232,7 @@ public class StorageMap [OpCode(OpCode.CAT)] [OpCode(OpCode.SWAP)] [Syscall("System.Storage.Get")] - public extern ByteString GetECPoint(byte[] key); + public extern ECPoint GetECPoint(byte[] key); [CallingConvention(CallingConvention.Cdecl)] [OpCode(OpCode.UNPACK)] @@ -260,7 +261,7 @@ public class StorageMap [OpCode(OpCode.SWAP)] [Syscall("System.Storage.Get")] [OpCode(OpCode.CONVERT, StackItemType.Integer)] - public extern int GetInteger(byte[] key); + public extern BigInteger GetInteger(byte[] key); [CallingConvention(CallingConvention.Cdecl)] [OpCode(OpCode.UNPACK)] @@ -287,7 +288,7 @@ public class StorageMap [OpCode(OpCode.PUSH0)] [OpCode(OpCode.JMP, "0x04")] [OpCode(OpCode.CONVERT, StackItemType.Integer)] - public extern int GetIntegerOrZero(byte[] key); + public extern BigInteger GetIntegerOrZero(byte[] key); public object GetObject(ByteString key) { From afa0505ac118669031f095df5706dc2153e7c5f2 Mon Sep 17 00:00:00 2001 From: Fernando Diaz Toledano Date: Tue, 26 Dec 2023 10:13:05 +0100 Subject: [PATCH 5/6] add ECPoint --- .../TestClasses/Contract_Storage.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs b/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs index 55a11c997..da6c85f68 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs @@ -105,24 +105,28 @@ public static bool TestNewGetMethods() var stringValue = "hello world"; var uint160Value = UInt160.Zero; var uint256Value = UInt256.Zero; + var ecPointValue = ECPoint.Zero; storage.Put("bool", boolValue); storage.Put("int", intValue); storage.Put("string", stringValue); storage.Put("uint160", uint160Value); storage.Put("uint256", uint256Value); + storage.Put("ecpoint", ecPointValue); var boolValue2 = storage.GetBoolean("bool"); var intValue2 = storage.GetInteger("int"); var stringValue2 = storage.GetString("string"); var uint160Value2 = storage.GetUInt160("uint160"); var uint256Value2 = storage.GetUInt256("uint256"); + var ecPointValue2 = storage.GetECPoint("ecpoint"); return boolValue == boolValue2 && intValue == intValue2 - &&stringValue == stringValue2 + && stringValue == stringValue2 && uint160Value == uint160Value2 - && uint256Value == uint256Value2; + && uint256Value == uint256Value2 + && ecPointValue == ecPointValue2; } public static byte[] TestNewGetByteArray() From 76b593eb325c60978579d8dc5518e69a45604153 Mon Sep 17 00:00:00 2001 From: Fernando Diaz Toledano Date: Tue, 26 Dec 2023 10:22:15 +0100 Subject: [PATCH 6/6] Fix ut --- .../TestClasses/Contract_Storage.cs | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs b/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs index da6c85f68..2492fb64a 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/TestClasses/Contract_Storage.cs @@ -1,3 +1,4 @@ +using Neo.Cryptography.ECC; using Neo.SmartContract.Framework.Services; using Neo.SmartContract.Framework; @@ -103,9 +104,22 @@ public static bool TestNewGetMethods() var boolValue = true; var intValue = 123; var stringValue = "hello world"; - var uint160Value = UInt160.Zero; - var uint256Value = UInt256.Zero; - var ecPointValue = ECPoint.Zero; + var uint160Value = (UInt160)new byte[] { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 + }; + var uint256Value = (UInt256) new byte[] { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x00, 0x01 + }; + var ecPointValue = (ECPoint)new byte[] { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x00, 0x01, 0x02 + }; storage.Put("bool", boolValue); storage.Put("int", intValue);