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

Replace uses of deprecated new Buffer with Buffer.from #80

Merged
merged 1 commit into from
Dec 7, 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
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const rlp = ethUtil.rlp
// geth compatible db keys
const headHeaderKey = 'LastHeader' // current canonical head for light sync
const headBlockKey = 'LastBlock' // current canonical head for full sync
const headerPrefix = new Buffer('h') // headerPrefix + number + hash -> header
const tdSuffix = new Buffer('t') // headerPrefix + number + hash + tdSuffix -> td
const numSuffix = new Buffer('n') // headerPrefix + number + numSuffix -> hash
const blockHashPrefix = new Buffer('H') // blockHashPrefix + hash -> number
const bodyPrefix = new Buffer('b') // bodyPrefix + number + hash -> block body
const headerPrefix = Buffer.from('h') // headerPrefix + number + hash -> header
const tdSuffix = Buffer.from('t') // headerPrefix + number + hash + tdSuffix -> td
const numSuffix = Buffer.from('n') // headerPrefix + number + numSuffix -> hash
const blockHashPrefix = Buffer.from('H') // blockHashPrefix + hash -> number
const bodyPrefix = Buffer.from('b') // bodyPrefix + number + hash -> block body

// utility functions
const bufBE8 = n => n.toArrayLike(Buffer, 'be', 8) // convert BN to big endian Buffer
Expand Down