From 26ea64b9f6cadc636c036deda16eaf820faf2594 Mon Sep 17 00:00:00 2001 From: zhl Date: Sat, 8 Apr 2023 14:26:39 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=EF=BC=9A=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E9=92=B1=E5=8C=85=E5=8F=8D=E5=BA=94=E5=99=A8=E4=BB=A5=E6=94=B9?= =?UTF-8?q?=E5=96=84=E8=AE=A1=E5=88=92=E6=89=A7=E8=A1=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 `WalletReactor.ts` 中的 `executeSchedule` 方法中添加 gas 估算。 - 更新 `beginSchedule` 方法以包括返回语句。 - 删除 `genOperation` 方法中未使用的参数。 --- src/chain/WalletReactor.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chain/WalletReactor.ts b/src/chain/WalletReactor.ts index 9c13d6b..263c314 100644 --- a/src/chain/WalletReactor.ts +++ b/src/chain/WalletReactor.ts @@ -80,6 +80,10 @@ export class WalletReactor { * @returns */ async executeSchedule(operation: IOperationData) { + let gas = await this.contract.methods + .executeBatch(operation.targets, operation.values, operation.datas, operation.predecessor, operation.salt) + .estimateGas({ from: this.account.address }) + console.log(gas) let res = await this.contract.methods .executeBatch(operation.targets, operation.values, operation.datas, operation.predecessor, operation.salt) .send({ gas: 1000000 })