@Test public void testGetEncoded() { String expected = "de809a01000000000000000000000000000000000000000000000000008080"; AccountState acct = new AccountState(BigInteger.ZERO, BigInteger.valueOf(2).pow(200)); assertEquals(expected, Hex.toHexString(acct.getEncoded())); }
public byte[] getEncoded() { if(rlpEncoded == null) { byte[] nonce = RLP.encodeBigInteger(this.nonce); byte[] balance = RLP.encodeBigInteger(this.balance); byte[] stateRoot = RLP.encodeElement(this.stateRoot); byte[] codeHash = RLP.encodeElement(this.codeHash); this.rlpEncoded = RLP.encodeList(nonce, balance, stateRoot, codeHash); } return rlpEncoded; }
AccountState { public byte[] getEncoded() { if(rlpEncoded == null) { byte[] nonce = RLP.encodeBigInteger(this.nonce); byte[] balance = RLP.encodeBigInteger(this.balance); byte[] stateRoot = RLP.encodeElement(this.stateRoot); byte[] codeHash = RLP.encodeElement(this.codeHash); this.rlpEncoded = RLP.encodeList(nonce, balance, stateRoot, codeHash); } return rlpEncoded; } }
AccountState { public byte[] getEncoded() { if(rlpEncoded == null) { byte[] nonce = RLP.encodeBigInteger(this.nonce); byte[] balance = RLP.encodeBigInteger(this.balance); byte[] stateRoot = RLP.encodeElement(this.stateRoot); byte[] codeHash = RLP.encodeElement(this.codeHash); this.rlpEncoded = RLP.encodeList(nonce, balance, stateRoot, codeHash); } return rlpEncoded; } AccountState();  AccountState(BigInteger nonce, BigInteger balance);  AccountState(byte[] rlpData); }
AccountState { public byte[] getEncoded() { if(rlpEncoded == null) { byte[] nonce = RLP.encodeBigInteger(this.nonce); byte[] balance = RLP.encodeBigInteger(this.balance); byte[] stateRoot = RLP.encodeElement(this.stateRoot); byte[] codeHash = RLP.encodeElement(this.codeHash); this.rlpEncoded = RLP.encodeList(nonce, balance, stateRoot, codeHash); } return rlpEncoded; } AccountState();  AccountState(BigInteger nonce, BigInteger balance);  AccountState(byte[] rlpData); BigInteger getNonce(); byte[] getStateRoot(); void setStateRoot(byte[] stateRoot); void incrementNonce(); byte[] getCodeHash(); void setCodeHash(byte[] codeHash); BigInteger getBalance(); BigInteger addToBalance(BigInteger value); void subFromBalance(BigInteger value); byte[] getEncoded(); String toString(); }
AccountState { public byte[] getEncoded() { if(rlpEncoded == null) { byte[] nonce = RLP.encodeBigInteger(this.nonce); byte[] balance = RLP.encodeBigInteger(this.balance); byte[] stateRoot = RLP.encodeElement(this.stateRoot); byte[] codeHash = RLP.encodeElement(this.codeHash); this.rlpEncoded = RLP.encodeList(nonce, balance, stateRoot, codeHash); } return rlpEncoded; } AccountState();  AccountState(BigInteger nonce, BigInteger balance);  AccountState(byte[] rlpData); BigInteger getNonce(); byte[] getStateRoot(); void setStateRoot(byte[] stateRoot); void incrementNonce(); byte[] getCodeHash(); void setCodeHash(byte[] codeHash); BigInteger getBalance(); BigInteger addToBalance(BigInteger value); void subFromBalance(BigInteger value); byte[] getEncoded(); String toString();  }