From 63f5ff62b20aaf4dfdb5dd48a24dabc3342a0868 Mon Sep 17 00:00:00 2001 From: Pritam Singh Date: Mon, 21 Jun 2021 15:41:13 +0530 Subject: [PATCH] fix(connector-xdai): web3.eth.estimateGas, works considering called solidity method do not throw an exception. So, for method having modifier with access control on msg.sender calling estimateGas without from field throws error.to make it work ,transactionConfig.from = web3SigningCredential.ethAccount before calling estimateGas Signed-off-by: Pritam Singh --- .../src/main/typescript/plugin-ledger-connector-xdai.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/plugin-ledger-connector-xdai.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/plugin-ledger-connector-xdai.ts index 3d09dac332..ec682f65a8 100644 --- a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/plugin-ledger-connector-xdai.ts +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/plugin-ledger-connector-xdai.ts @@ -292,10 +292,10 @@ export class PluginLedgerConnectorXdai const payload = (method.send as any).request(); const { params } = payload; const [transactionConfig] = params; + transactionConfig.from = web3SigningCredential.ethAccount; if (req.gas == undefined) { req.gas = await this.web3.eth.estimateGas(transactionConfig); } - transactionConfig.from = web3SigningCredential.ethAccount; transactionConfig.gas = req.gas; transactionConfig.gasPrice = req.gasPrice; transactionConfig.value = req.value;