From dfd829a2e29626d0ed38f70d3206a3c7faad1b13 Mon Sep 17 00:00:00 2001 From: Hendrik Hofstadt Date: Mon, 10 Aug 2020 09:07:55 +0200 Subject: [PATCH] fix: fix createProgramAddress for bundled applications --- web3.js/src/publickey.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web3.js/src/publickey.js b/web3.js/src/publickey.js index 9c1e89382c..190ad910b5 100644 --- a/web3.js/src/publickey.js +++ b/web3.js/src/publickey.js @@ -110,7 +110,7 @@ export class PublicKey { Buffer.from('ProgramDerivedAddress'), ]); let hash = await sha256(new Uint8Array(buffer)); - let publicKeyBytes = new BN(hash, 16).toBuffer(); + let publicKeyBytes = new BN(hash, 16).toArray(); if (is_on_curve(publicKeyBytes)) { throw new Error(`Invalid seeds, address must fall off the curve`); }