Skip to content

Commit

Permalink
check returned tx in test
Browse files Browse the repository at this point in the history
Signed-off-by: Daisuke Kanda <[email protected]>
  • Loading branch information
Daisuke Kanda committed Feb 4, 2025
1 parent 3213c9c commit a845932
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/client/txpool/txpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ func transfer(t *testing.T, ctx context.Context, client *ethclient.Client, signe
func replace(t *testing.T, ctx context.Context, client *ethclient.Client, signer types.Signer, key *ecdsa.PrivateKey, priceBump uint64, nonce uint64, gasTipCap, gasFeeCap *big.Int, to common.Address, amount *big.Int) {
addr := crypto.PubkeyToAddress(key.PublicKey)

if _, minFeeCap, minTipCap, err := GetMinimumRequiredFee(ctx, client, addr, nonce, priceBump); err != nil {
if tx, minFeeCap, minTipCap, err := GetMinimumRequiredFee(ctx, client, addr, nonce, priceBump); err != nil {
t.Fatalf("failed to get the minimum fee required to replace tx: err=%v", err)
} else if tx == nil {
t.Fatalf("replacing tx is not found")
} else if minFeeCap.Cmp(common.Big0) == 0 {
t.Fatalf("tx to replace not found")
} else {
Expand Down

0 comments on commit a845932

Please sign in to comment.