Skip to content

Commit e7c8693

Browse files
internal/ethapi: fix panic in access list creation (#23133)
Fixes test failure in the last commit.
1 parent ec88bd0 commit e7c8693

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ethclient/gethclient/gethclient_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import (
4040
var (
4141
testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
4242
testAddr = crypto.PubkeyToAddress(testKey.PublicKey)
43-
testBalance = big.NewInt(2e10)
43+
testBalance = big.NewInt(2e15)
4444
)
4545

4646
func newTestBackend(t *testing.T) (*node.Node, []*types.Block) {
@@ -88,7 +88,7 @@ func generateTestChain() (*core.Genesis, []*types.Block) {
8888
return genesis, blocks
8989
}
9090

91-
func TestEthClient(t *testing.T) {
91+
func TestGethClient(t *testing.T) {
9292
backend, _ := newTestBackend(t)
9393
client, err := backend.Attach()
9494
if err != nil {
@@ -159,7 +159,7 @@ func testAccessList(t *testing.T, client *rpc.Client) {
159159
From: testAddr,
160160
To: nil,
161161
Gas: 100000,
162-
GasPrice: big.NewInt(1),
162+
GasPrice: big.NewInt(1000000000),
163163
Value: big.NewInt(1),
164164
Data: common.FromHex("0x608060806080608155fd"),
165165
}
@@ -286,7 +286,7 @@ func testCallContract(t *testing.T, client *rpc.Client) {
286286
From: testAddr,
287287
To: &common.Address{},
288288
Gas: 21000,
289-
GasPrice: big.NewInt(1),
289+
GasPrice: big.NewInt(1000000000),
290290
Value: big.NewInt(1),
291291
}
292292
// CallContract without override

internal/ethapi/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,11 +1417,11 @@ func AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrH
14171417
}
14181418
// Copy the original db so we don't modify it
14191419
statedb := db.Copy()
1420-
msg := types.NewMessage(args.from(), args.To, uint64(*args.Nonce), args.Value.ToInt(), uint64(*args.Gas), args.GasPrice.ToInt(), nil, nil, args.data(), accessList, false)
1420+
msg := types.NewMessage(args.from(), args.To, uint64(*args.Nonce), args.Value.ToInt(), uint64(*args.Gas), args.GasPrice.ToInt(), big.NewInt(0), big.NewInt(0), args.data(), accessList, false)
14211421

14221422
// Apply the transaction with the access list tracer
14231423
tracer := vm.NewAccessListTracer(accessList, args.from(), to, precompiles)
1424-
config := vm.Config{Tracer: tracer, Debug: true}
1424+
config := vm.Config{Tracer: tracer, Debug: true, NoBaseFee: true}
14251425
vmenv, _, err := b.GetEVM(ctx, msg, statedb, header, &config)
14261426
if err != nil {
14271427
return nil, 0, nil, err

0 commit comments

Comments
 (0)