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);
        }
예제 #2
0
 public AccountsState Put(Address address, AccountState state)
 {
     return(new AccountsState(this.states.Put(address.ToString(), encoder.Encode(state))));
 }