예제 #1
0
        public void Conversions()
        {
            EthereumAddress a = new EthereumAddress(Constants.TestEthereumAddress);

            Assert.AreEqual(Constants.TestEthereumAddress, a.ToString());

            // Tests explicit cast operator
            Assert.AreEqual(a, (EthereumAddress)Constants.TestEthereumAddress);
            // Tests implicit cast operator
            string aStr = a;

            Assert.AreEqual(Constants.TestEthereumAddress, aStr);

            byte[] expectedBytes = a.Bytes;
            CollectionAssert.AreEqual(Constants.TestEthereumAddress.HexToByteArray(), a.Bytes);
            Assert.AreEqual(a, EthereumAddress.FromByteArray(a.Bytes));
        }
예제 #2
0
파일: ERC721Asset.cs 프로젝트: bojan96/0x
 private ERC721Asset(byte[] assetData)
     : base(assetData, EthereumAddress.FromByteArray(assetData.Slice(16, 36)))
 {
     // Reversing due to fact that BigInteger expects little endian order
     TokenId = new BigInteger(assetData.Slice(36).Reverse().ToArray());
 }
예제 #3
0
파일: ERC20Asset.cs 프로젝트: bojan96/0x
 private ERC20Asset(byte[] assetData)
     : base(assetData, EthereumAddress.FromByteArray(assetData.Slice(16)))
 {
 }