Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/eth/execute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
- name: Block
required: false
schema:
$ref: '#/components/schemas/BlockNumberOrTag'
$ref: '#/components/schemas/BlockNumberOrTagOrHash'
result:
name: Gas used
schema:
Expand Down Expand Up @@ -75,7 +75,7 @@
- name: Block
required: false
schema:
$ref: '#/components/schemas/BlockNumberOrTag'
$ref: '#/components/schemas/BlockNumberOrTagOrHash'
result:
name: Gas used
schema:
Expand Down
3 changes: 3 additions & 0 deletions tests/eth_createAccessList/create-al-blockhash.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// creates an access list for a simple transfer at a specific block hash
>> {"jsonrpc":"2.0","id":1,"method":"eth_createAccessList","params":[{"from":"0x0c2c51a0990aee1d73c1228de158688341557508","nonce":"0x0","to":"0x0100000000000000000000000000000000000000","value":"0xa"},"0xd226371d0b1551adb03fb52b71f08e3e11247fe9b1af994768af8cdaa8e7dcd7"]}
<< {"jsonrpc":"2.0","id":1,"result":{"accessList":[],"gasUsed":"0x5208"}}
3 changes: 3 additions & 0 deletions tests/eth_estimateGas/estimate-blockhash.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// estimates a simple transfer at a specific block hash
>> {"jsonrpc":"2.0","id":1,"method":"eth_estimateGas","params":[{"from":"0xaa00000000000000000000000000000000000000","to":"0x0100000000000000000000000000000000000000"},"0xd226371d0b1551adb03fb52b71f08e3e11247fe9b1af994768af8cdaa8e7dcd7"]}
<< {"jsonrpc":"2.0","id":1,"result":"0x5208"}
33 changes: 33 additions & 0 deletions tools/testgen/generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,24 @@ var EthEstimateGas = MethodTests{
return nil
},
},
{
Name: "estimate-blockhash",
About: "estimates a simple transfer at a specific block hash",
Run: func(ctx context.Context, t *T) error {
msg := map[string]any{
"from": common.Address{0xaa},
"to": common.Address{0x01},
}
var got hexutil.Uint64
if err := t.rpc.CallContext(ctx, &got, "eth_estimateGas", msg, t.chain.Head().Hash()); err != nil {
return err
}
if uint64(got) != params.TxGas {
return fmt.Errorf("unexpected return value (got: %d, want: %d)", got, params.TxGas)
}
return nil
},
},
{
Name: "estimate-successful-call",
About: "estimates a successful contract call",
Expand Down Expand Up @@ -1029,6 +1047,21 @@ var EthCreateAccessList = MethodTests{
return nil
},
},
{
Name: "create-al-blockhash",
About: "creates an access list for a simple transfer at a specific block hash",
Run: func(ctx context.Context, t *T) error {
sender, nonce := t.chain.GetSender(0)
msg := map[string]any{
"from": sender,
"to": common.Address{0x01},
"value": hexutil.Uint64(10),
"nonce": hexutil.Uint64(nonce),
}
result := make(map[string]any)
return t.rpc.CallContext(ctx, &result, "eth_createAccessList", msg, t.chain.Head().Hash())
},
},
{
Name: "create-al-contract",
About: "creates an access list for a contract invocation that accesses storage",
Expand Down