From a8459322e3a11aad1373d7804cd74fdcb3f586df Mon Sep 17 00:00:00 2001 From: Daisuke Kanda Date: Tue, 4 Feb 2025 00:18:13 +0000 Subject: [PATCH] check returned tx in test Signed-off-by: Daisuke Kanda --- pkg/client/txpool/txpool_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/client/txpool/txpool_test.go b/pkg/client/txpool/txpool_test.go index 30c81a7..b4821ae 100644 --- a/pkg/client/txpool/txpool_test.go +++ b/pkg/client/txpool/txpool_test.go @@ -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 {