Skip to content
This repository was archived by the owner on Apr 6, 2020. It is now read-only.

Commit c46ae2f

Browse files
authored
Merge pull request #73 from ethereumjs/toarray-fix
Fix: Replace toBuffer with toArrayLike
2 parents d64c302 + 502a039 commit c46ae2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const blockHashPrefix = new Buffer('H') // blockHashPrefix + hash -> number
2424
const bodyPrefix = new Buffer('b') // bodyPrefix + number + hash -> block body
2525

2626
// utility functions
27-
const bufBE8 = n => n.toBuffer('be', 8) // convert BN to big endian Buffer
27+
const bufBE8 = n => n.toArrayLike(Buffer, 'be', 8) // convert BN to big endian Buffer
2828
const tdKey = (n, hash) => Buffer.concat([headerPrefix, bufBE8(n), hash, tdSuffix])
2929
const headerKey = (n, hash) => Buffer.concat([headerPrefix, bufBE8(n), hash])
3030
const bodyKey = (n, hash) => Buffer.concat([bodyPrefix, bufBE8(n), hash])

0 commit comments

Comments
 (0)