Add testcode for gasPrice is not specified

This commit is contained in:
SangIlMo 2024-07-23 15:08:19 +09:00 committed by Martin Holst Swende
parent 1280d75987
commit 3e190e95b2
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -237,6 +237,27 @@ func testAccessList(t *testing.T, client *rpc.Client) {
if al != nil {
t.Fatalf("unexpected accesslist: %v", len(*al))
}
// when gasPrice is not specified
msg = ethereum.CallMsg{
From: testAddr,
To: &common.Address{},
Gas: 21000,
Value: big.NewInt(1),
}
al, gas, vmErr, err = ec.CreateAccessList(context.Background(), msg)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if vmErr != "" {
t.Fatalf("unexpected vm error: %v", vmErr)
}
if gas != 21000 {
t.Fatalf("unexpected gas used: %v", gas)
}
if len(*al) != 0 {
t.Fatalf("unexpected length of accesslist: %v", len(*al))
}
}
func testGetProof(t *testing.T, client *rpc.Client, addr common.Address) {