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

Fix: Replace toBuffer with toArrayLike #73

Merged
merged 1 commit into from
Oct 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const blockHashPrefix = new Buffer('H') // blockHashPrefix + hash -> number
const bodyPrefix = new Buffer('b') // bodyPrefix + number + hash -> block body

// utility functions
const bufBE8 = n => n.toBuffer('be', 8) // convert BN to big endian Buffer
const bufBE8 = n => n.toArrayLike(Buffer, 'be', 8) // convert BN to big endian Buffer
const tdKey = (n, hash) => Buffer.concat([headerPrefix, bufBE8(n), hash, tdSuffix])
const headerKey = (n, hash) => Buffer.concat([headerPrefix, bufBE8(n), hash])
const bodyKey = (n, hash) => Buffer.concat([bodyPrefix, bufBE8(n), hash])
Expand Down