Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 37455eb

Browse files
author
Alex Luu
committed
fix test
1 parent 6d0c60c commit 37455eb

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/web3-eth/src/utils/send_tx_helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export class SendTxHelper<
123123
public async checkRevertBeforeSending(tx: TransactionCall) {
124124
if (this.options.checkRevertBeforeSending !== false) {
125125
let formatTx = tx;
126-
if (tx.data === undefined && tx.input && tx.gas === undefined) { // eth.call runs into error if data isnt filled and gas is not defined, its a simple transaction so we fill it with 21000
126+
if (isNullish(tx.data) && isNullish(tx.input) && isNullish(tx.gas)) { // eth.call runs into error if data isnt filled and gas is not defined, its a simple transaction so we fill it with 21000
127127
formatTx = {
128128
...tx,
129129
gas: 21000

packages/web3-eth/test/unit/send_tx_helper.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ describe('sendTxHelper class', () => {
162162
},
163163
returnFormat: DEFAULT_RETURN_FORMAT,
164164
});
165-
jest.spyOn(utils, 'getRevertReason').mockResolvedValue(undefined);
166165

167166
const tx = {from:"0x"} as TransactionCall
168167

@@ -172,7 +171,7 @@ describe('sendTxHelper class', () => {
172171
...tx,
173172
gas: 21000,
174173
};
175-
expect(utils.getRevertReason).toHaveBeenCalledWith(web3Context, expectedTx);
174+
expect(utils.getRevertReason).toHaveBeenCalledWith(web3Context, expectedTx, undefined);
176175

177176
});
178177
it('emit handleError with handleRevert', async () => {

0 commit comments

Comments
 (0)