Skip to content

Commit 24035e7

Browse files
committed
eth/channel: Use params.TxGas for const 21000
Signed-off-by: Sebastian Stammler <seb@perun.network>
1 parent c475bc4 commit 24035e7

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

backend/ethereum/channel/contractbackend_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222

2323
"github.com/ethereum/go-ethereum/common"
2424
"github.com/ethereum/go-ethereum/core/types"
25+
"github.com/ethereum/go-ethereum/params"
2526
"github.com/stretchr/testify/assert"
2627
"github.com/stretchr/testify/require"
2728

@@ -32,8 +33,6 @@ import (
3233
pkgtest "polycry.pt/poly-go/test"
3334
)
3435

35-
const valueTxGas = 21_000
36-
3736
func fromEthAddr(a common.Address) wallet.Address {
3837
return (*ethwallet.Address)(&a)
3938
}
@@ -131,11 +130,11 @@ func Test_ConfirmTransaction(t *testing.T) {
131130
rawTx := types.NewTx(&types.DynamicFeeTx{
132131
Nonce: 0,
133132
GasFeeCap: big.NewInt(test.InitialGasBaseFee),
134-
Gas: valueTxGas,
133+
Gas: params.TxGas,
135134
To: &common.Address{},
136135
Value: big.NewInt(1),
137136
})
138-
opts, err := s.CB.NewTransactor(ctx, valueTxGas, s.TxSender.Account)
137+
opts, err := s.CB.NewTransactor(ctx, params.TxGas, s.TxSender.Account)
139138
require.NoError(t, err)
140139
signed, err := opts.Signer(s.TxSender.Account.Address, rawTx)
141140
require.NoError(t, err)

backend/ethereum/channel/test/simulated.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (s *SimulatedBackend) FundAddress(ctx context.Context, addr common.Address)
126126
txdata := &types.DynamicFeeTx{
127127
Nonce: nonce,
128128
GasFeeCap: big.NewInt(InitialGasBaseFee),
129-
Gas: 21000,
129+
Gas: params.TxGas,
130130
To: &addr,
131131
Value: test.MaxBalance,
132132
}

0 commit comments

Comments
 (0)