From ca79178159f26e775951cfb9265cfa5433e1ea22 Mon Sep 17 00:00:00 2001 From: Kevin Weaver Date: Tue, 10 May 2022 13:56:03 -0700 Subject: [PATCH] Add note about Arbitrum effectiveGasPrice support --- packages/interface-adapter/lib/adapter/web3/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/interface-adapter/lib/adapter/web3/index.ts b/packages/interface-adapter/lib/adapter/web3/index.ts index aff870f45bf..7f756c507f7 100644 --- a/packages/interface-adapter/lib/adapter/web3/index.ts +++ b/packages/interface-adapter/lib/adapter/web3/index.ts @@ -69,7 +69,9 @@ export class Web3InterfaceAdapter implements InterfaceAdapter { return this.web3.eth.getBlockNumber(); } - public async getTransactionCostReport(receipt: TransactionReceipt): Promise { + public async getTransactionCostReport( + receipt: TransactionReceipt + ): Promise { const tx = await this.getTransaction(receipt.transactionHash); const block = await this.getBlock(receipt.blockNumber); @@ -78,6 +80,8 @@ export class Web3InterfaceAdapter implements InterfaceAdapter { const balance = await this.getBalance(tx.from); // gasPrice has been deprecated in favor of effectiveGasPrice // via https://github.com/ethereum/execution-specs/pull/251 + // Note: this incidentally conforms to Arbitrum as well + // via https://github.com/trufflesuite/truffle/issues/4559 const gasPrice = new BN(receipt.effectiveGasPrice || tx.gasPrice); const gas = new BN(receipt.gasUsed); const value = new BN(tx.value);