From df886a7a408f79bf253e602f0036ff3b7265d95a Mon Sep 17 00:00:00 2001 From: Parth Date: Tue, 12 Nov 2019 00:50:58 +0530 Subject: [PATCH] make to account key as signer (#550) fix: require to account sign --- web3.js/examples/budget-timestamp.js | 1 + web3.js/examples/budget-two-approvers.js | 1 + web3.js/src/loader.js | 2 +- web3.js/src/system-program.js | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web3.js/examples/budget-timestamp.js b/web3.js/examples/budget-timestamp.js index b70bd68248..10ebae80f2 100644 --- a/web3.js/examples/budget-timestamp.js +++ b/web3.js/examples/budget-timestamp.js @@ -75,6 +75,7 @@ showBalance() connection, transaction, account1, + contractState, ); }) .then(confirmTransaction) diff --git a/web3.js/examples/budget-two-approvers.js b/web3.js/examples/budget-two-approvers.js index 5d50279a96..dbacc49c09 100644 --- a/web3.js/examples/budget-two-approvers.js +++ b/web3.js/examples/budget-two-approvers.js @@ -113,6 +113,7 @@ getTransactionFee().then(feeCalculator => { connection, transaction, account1, + contractState, ); }) .then(confirmTransaction) diff --git a/web3.js/src/loader.js b/web3.js/src/loader.js index c840a99678..552231effa 100644 --- a/web3.js/src/loader.js +++ b/web3.js/src/loader.js @@ -65,7 +65,7 @@ export class Loader { data.length, programId, ); - await sendAndConfirmTransaction(connection, transaction, payer); + await sendAndConfirmTransaction(connection, transaction, payer, program); } const dataLayout = BufferLayout.struct([ diff --git a/web3.js/src/system-program.js b/web3.js/src/system-program.js index 1d843e2bdb..e1b923b8bb 100644 --- a/web3.js/src/system-program.js +++ b/web3.js/src/system-program.js @@ -184,7 +184,7 @@ export class SystemProgram { return new Transaction().add({ keys: [ {pubkey: from, isSigner: true, isWritable: true}, - {pubkey: newAccount, isSigner: false, isWritable: true}, + {pubkey: newAccount, isSigner: true, isWritable: true}, ], programId: SystemProgram.programId, data,