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

Commit

Permalink
add account.raw()
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanio committed Oct 15, 2020
1 parent d5b886f commit ce3511b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

/**
Expand Down

0 comments on commit ce3511b

Please sign in to comment.