From ce3511ba8084646b422a5958e8c0dfd64558c619 Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Thu, 15 Oct 2020 09:37:21 -0700 Subject: [PATCH] add account.raw() --- src/account.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/account.ts b/src/account.ts index ac94fa5d..948c1175 100644 --- a/src/account.ts +++ b/src/account.ts @@ -93,11 +93,18 @@ export class Account { } } + /** + * Returns a Buffer Array of the raw Buffers for the account, in order. + */ + raw(): Buffer[] { + return [bnToRlp(this.nonce), bnToRlp(this.balance), this.stateRoot, this.codeHash] + } + /** * Returns the RLP serialization of the account as a `Buffer`. */ serialize(): Buffer { - return rlp.encode([bnToRlp(this.nonce), bnToRlp(this.balance), this.stateRoot, this.codeHash]) + return rlp.encode(this.raw()) } /**