public Address Decode(byte[] bytes)
        {
            byte[] addr = Rlp.Decode(bytes);

            return(new Address(addr));
        }
 public byte[] Encode(Address address)
 {
     return(Rlp.Encode(address.Bytes));
 }
Exemplo n.º 3
0
        public AccountState Decode(byte[] bytes)
        {
            IList <byte[]> list = Rlp.DecodeList(bytes);

            return(new AccountState(BigIntegerEncoder.Instance.Decode(list[0]), UnsignedLongEncoder.Instance.Decode(list[1])));
        }
Exemplo n.º 4
0
 public byte[] Encode(AccountState state)
 {
     return(Rlp.EncodeList(BigIntegerEncoder.Instance.Encode(state.Balance), UnsignedLongEncoder.Instance.Encode(state.Nonce)));
 }
 public BigInteger Decode(byte[] bytes)
 {
     return(new BigInteger(Rlp.Decode(bytes)));
 }
 public byte[] Encode(BigInteger value)
 {
     return(Rlp.Encode(value.ToByteArray()));
 }