From ef3de76336507c0502dbd08eb7ace72b08f9647d Mon Sep 17 00:00:00 2001 From: Clark Moody Date: Wed, 12 Jun 2019 15:20:13 -0500 Subject: [PATCH] Use Buffer.from --- accounts/api-helper.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/accounts/api-helper.js b/accounts/api-helper.js index b39f561..e0c4d2b 100644 --- a/accounts/api-helper.js +++ b/accounts/api-helper.js @@ -28,10 +28,10 @@ class ApiHelper { */ parseEntities(str) { const ret = new WalletEntities() - + if (typeof str !== 'string') return ret - + for (let item of str.split('|')) { try { @@ -47,7 +47,7 @@ class ApiHelper { } else if (addrHelper.isSupportedPubKey(item) && !ret.hasPubKey(item)) { // Derive pubkey as 3 addresses (P1PKH, P2WPKH/P2SH, BECH32) - const bufItem = new Buffer(item, 'hex') + const bufItem = Buffer.from(item, 'hex') const funcs = [ addrHelper.p2pkhAddress,