From 3b4c4b77e947e1b6927516009452fc04531f40e1 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 29 Apr 2024 11:12:26 +0800 Subject: [PATCH] feat: update tests --- internal/testutils/helper.go | 5 +++-- pkg/rpc/utils_test.go | 4 +++- pkg/txlist_validator/tx_list_validator_test.go | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/testutils/helper.go b/internal/testutils/helper.go index 67449a548..fffcb9dbf 100644 --- a/internal/testutils/helper.go +++ b/internal/testutils/helper.go @@ -18,6 +18,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/go-resty/resty/v2" "github.com/phayes/freeport" @@ -130,7 +131,7 @@ func (s *ClientTestSuite) ProposeAndInsertValidBlock( common.BytesToAddress(RandomBytes(32)), common.Big1, 100000, - baseFeeInfo.Basefee, + new(big.Int).SetUint64(uint64(10*params.GWei)+baseFeeInfo.Basefee.Uint64()), []byte{}, ) signedTx, err := types.SignTx(tx, types.LatestSignerForChainID(s.RPCClient.L2.ChainID), s.TestAddrPrivKey) @@ -198,7 +199,7 @@ func (s *ClientTestSuite) ProposeValidBlock( common.BytesToAddress(RandomBytes(32)), common.Big1, 100000, - baseFeeInfo.Basefee, + new(big.Int).SetUint64(uint64(10*params.GWei)+baseFeeInfo.Basefee.Uint64()), []byte{}, ) signedTx, err := types.SignTx(tx, types.LatestSignerForChainID(s.RPCClient.L2.ChainID), s.TestAddrPrivKey) diff --git a/pkg/rpc/utils_test.go b/pkg/rpc/utils_test.go index 4512ab368..bc5d84245 100644 --- a/pkg/rpc/utils_test.go +++ b/pkg/rpc/utils_test.go @@ -2,6 +2,7 @@ package rpc import ( "context" + "math/big" "os" "strconv" "testing" @@ -9,6 +10,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" "github.com/stretchr/testify/require" ) @@ -42,7 +44,7 @@ func TestL1ContentFrom(t *testing.T) { testAddr, common.Big1, 100000, - baseFeeInfo.Basefee, + new(big.Int).SetUint64(uint64(10*params.GWei)+baseFeeInfo.Basefee.Uint64()), []byte{}, ) signedTx, err := types.SignTx(tx, types.LatestSignerForChainID(client.L2.ChainID), testAddrPrivKey) diff --git a/pkg/txlist_validator/tx_list_validator_test.go b/pkg/txlist_validator/tx_list_validator_test.go index 01b1fc896..f525bef46 100644 --- a/pkg/txlist_validator/tx_list_validator_test.go +++ b/pkg/txlist_validator/tx_list_validator_test.go @@ -91,7 +91,7 @@ func rlpEncodedTransactionBytes(l int, signed bool) []byte { tx = types.MustSignNewTx(testKey, types.LatestSigner(genesis.Config), txData) } else { - tx = types.NewTransaction(1, testAddr, common.Big1, 10, common.Big256, nil) + tx = types.NewTransaction(1, testAddr, common.Big1, 10, new(big.Int).SetUint64(10*params.GWei), nil) } txs = append( txs,