From 502a039c066a6db9120848162079582ea4ffab6b Mon Sep 17 00:00:00 2001 From: Vinay Pulim Date: Wed, 24 Oct 2018 20:45:54 -0400 Subject: [PATCH] Replace toBuffer with toArrayLike --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 2e90320..6fa9f90 100644 --- a/index.js +++ b/index.js @@ -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])