Esempio n. 1
0
        public AccountState Get(Address address)
        {
            var result = this.states.Get(address.ToString());

            if (result == null)
            {
                return(defaultValue);
            }

            return(encoder.Decode(result));
        }
        public void EncodeDecodeAccountStateWithBalanceOne()
        {
            AccountStateEncoder encoder = new AccountStateEncoder();

            byte[] bytes = encoder.Encode(new AccountState(BigInteger.One, 0));

            Assert.IsNotNull(bytes);
            Assert.AreNotEqual(0, bytes.Length);

            AccountState result = encoder.Decode(bytes);

            Assert.IsNotNull(result);
            Assert.AreEqual(BigInteger.One, result.Balance);
        }