예제 #1
0
 private EIP712Domain GetEIP712Domain(EthereumAddress exchangeAddress)
 => new EIP712Domain
 {
     Name              = "0x Protocol",
     Version           = "2",
     VerifyingContract = exchangeAddress.ToString()
 };
예제 #2
0
        public void Construction()
        {
            EthereumAddress address = new EthereumAddress(Constants.TestEthereumAddress);

            Assert.AreEqual(Constants.TestEthereumAddress, address.ToString());
            Assert.IsTrue(address.IsChecksumAddress, "Address should be checksummed");
        }
예제 #3
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));
        }
예제 #4
0
파일: TokenAsset.cs 프로젝트: bojan96/0x
 protected static byte[] EncodeAddress(EthereumAddress address)
 // Address type encoder pads address with zeros to 32 bytes
 => new AddressTypeEncoder().Encode(address.ToString());