Skip to content

Commit

Permalink
fix(connector-xdai): web3.eth.estimateGas, works considering called s…
Browse files Browse the repository at this point in the history
…olidity 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 <pkspritam16@gmail.com>
  • Loading branch information
Zzocker authored and petermetz committed Jun 25, 2021
1 parent 70f4005 commit 63f5ff6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 63f5ff6

Please sign in to comment.