diff --git a/testutils/evm.go b/testutils/evm.go index 039dfce0..a6917d01 100644 --- a/testutils/evm.go +++ b/testutils/evm.go @@ -9,6 +9,10 @@ import ( "crypto/ecdsa" "encoding/hex" "errors" + "log" + "math/big" + "strings" + "github.com/Qitmeer/qng/meerevm/params" "github.com/Qitmeer/qng/testutils/swap/factory" "github.com/Qitmeer/qng/testutils/swap/router" @@ -17,9 +21,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" - "log" - "math/big" - "strings" ) var CHAIN_ID = params.QngPrivnetChainConfig.ChainID @@ -89,7 +90,12 @@ func (w *testWallet) CreateRouter(factory, weth common.Address) (string, error) func (w *testWallet) AuthTrans(privatekeybyte []byte) (*bind.TransactOpts, error) { privateKey := crypto.ToECDSAUnsafe(privatekeybyte) - return bind.NewKeyedTransactorWithChainID(privateKey, CHAIN_ID) + authCaller, err := bind.NewKeyedTransactorWithChainID(privateKey, CHAIN_ID) + if err != nil { + return nil, err + } + authCaller.GasLimit = uint64(GAS_LIMIT) + return authCaller, nil } func (w *testWallet) CreateLegacyTx(fromPkByte []byte, to *common.Address, nonce uint64, gas uint64, val *big.Int, d []byte) (string, error) { diff --git a/testutils/harness_test.go b/testutils/harness_test.go index 215256a0..45771697 100644 --- a/testutils/harness_test.go +++ b/testutils/harness_test.go @@ -5,12 +5,13 @@ package testutils_test import ( - "github.com/Qitmeer/qng/core/types" - "github.com/Qitmeer/qng/params" - . "github.com/Qitmeer/qng/testutils" "sync" "testing" "time" + + "github.com/Qitmeer/qng/core/types" + "github.com/Qitmeer/qng/params" + . "github.com/Qitmeer/qng/testutils" ) func TestHarness(t *testing.T) {