Skip to content
This repository was archived by the owner on Jun 17, 2021. It is now read-only.

Commit ce3511b

Browse files
committed
add account.raw()
1 parent d5b886f commit ce3511b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/account.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,18 @@ export class Account {
9393
}
9494
}
9595

96+
/**
97+
* Returns a Buffer Array of the raw Buffers for the account, in order.
98+
*/
99+
raw(): Buffer[] {
100+
return [bnToRlp(this.nonce), bnToRlp(this.balance), this.stateRoot, this.codeHash]
101+
}
102+
96103
/**
97104
* Returns the RLP serialization of the account as a `Buffer`.
98105
*/
99106
serialize(): Buffer {
100-
return rlp.encode([bnToRlp(this.nonce), bnToRlp(this.balance), this.stateRoot, this.codeHash])
107+
return rlp.encode(this.raw())
101108
}
102109

103110
/**

0 commit comments

Comments
 (0)