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

Commit de0230d

Browse files
authored
Merge pull request #80 from whymarrh/new-buffer
Replace uses of deprecated `new Buffer` with Buffer.from
2 parents 4283cae + 5d014e9 commit de0230d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ const rlp = ethUtil.rlp
1616
// geth compatible db keys
1717
const headHeaderKey = 'LastHeader' // current canonical head for light sync
1818
const headBlockKey = 'LastBlock' // current canonical head for full sync
19-
const headerPrefix = new Buffer('h') // headerPrefix + number + hash -> header
20-
const tdSuffix = new Buffer('t') // headerPrefix + number + hash + tdSuffix -> td
21-
const numSuffix = new Buffer('n') // headerPrefix + number + numSuffix -> hash
22-
const blockHashPrefix = new Buffer('H') // blockHashPrefix + hash -> number
23-
const bodyPrefix = new Buffer('b') // bodyPrefix + number + hash -> block body
19+
const headerPrefix = Buffer.from('h') // headerPrefix + number + hash -> header
20+
const tdSuffix = Buffer.from('t') // headerPrefix + number + hash + tdSuffix -> td
21+
const numSuffix = Buffer.from('n') // headerPrefix + number + numSuffix -> hash
22+
const blockHashPrefix = Buffer.from('H') // blockHashPrefix + hash -> number
23+
const bodyPrefix = Buffer.from('b') // bodyPrefix + number + hash -> block body
2424

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

0 commit comments

Comments
 (0)