Skip to content

Commit b9091d1

Browse files
authored
add latest-block tests for optional block param on state methods (#577)
Tests for erigontech/erigon#21586: eth_getBalance, eth_getCode, eth_getStorageAt, eth_getTransactionCount, eth_getProof, eth_getStorageValues now accept an omitted block parameter (defaults to latest). Each fixture omits the block param and carries metadata.latest=true so it runs under -L.
1 parent 46c95eb commit b9091d1

6 files changed

Lines changed: 140 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"request": {
4+
"id": 1,
5+
"jsonrpc": "2.0",
6+
"method": "eth_getBalance",
7+
"params": [
8+
"0x0000000000000000000000000000000000000000"
9+
]
10+
},
11+
"response": {
12+
"id": 1,
13+
"jsonrpc": "2.0"
14+
},
15+
"test": {
16+
"description": "invoke getBalance with omitted block parameter (should default to latest)",
17+
"reference": "https://github.com/erigontech/erigon/pull/21586"
18+
},
19+
"metadata": {
20+
"latest": true
21+
}
22+
}
23+
]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"request": {
4+
"id": 1,
5+
"jsonrpc": "2.0",
6+
"method": "eth_getCode",
7+
"params": [
8+
"0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"
9+
]
10+
},
11+
"response": {
12+
"id": 1,
13+
"jsonrpc": "2.0"
14+
},
15+
"test": {
16+
"description": "invoke getCode with omitted block parameter (should default to latest)",
17+
"reference": "https://github.com/erigontech/erigon/pull/21586"
18+
},
19+
"metadata": {
20+
"latest": true
21+
}
22+
}
23+
]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[
2+
{
3+
"request": {
4+
"id": 1,
5+
"jsonrpc": "2.0",
6+
"method": "eth_getProof",
7+
"params": [
8+
"0x8315177aB297bA92A06054cE80a67Ed4DBd7ed3a",
9+
[]
10+
]
11+
},
12+
"response": {
13+
"id": 1,
14+
"jsonrpc": "2.0"
15+
},
16+
"test": {
17+
"description": "invoke getProof with omitted block parameter (should default to latest)",
18+
"reference": "https://github.com/erigontech/erigon/pull/21586"
19+
},
20+
"metadata": {
21+
"latest": true
22+
}
23+
}
24+
]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[
2+
{
3+
"request": {
4+
"id": 1,
5+
"jsonrpc": "2.0",
6+
"method": "eth_getStorageAt",
7+
"params": [
8+
"0xc1cadaffffffffffffffffffffffffffffffffff",
9+
"0x0100000000000000000000000000000000000000000000000000000000000000"
10+
]
11+
},
12+
"response": {
13+
"id": 1,
14+
"jsonrpc": "2.0"
15+
},
16+
"test": {
17+
"description": "invoke getStorageAt with omitted block parameter (should default to latest)",
18+
"reference": "https://github.com/erigontech/erigon/pull/21586"
19+
},
20+
"metadata": {
21+
"latest": true
22+
}
23+
}
24+
]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"request": {
4+
"id": 1,
5+
"jsonrpc": "2.0",
6+
"method": "eth_getStorageValues",
7+
"params": [
8+
{"0x6C8f2A135f6ed072DE4503Bd7C4999a1a17F824B": ["0x0000000000000000000000000000000000000000000000000000000000000001"]}
9+
]
10+
},
11+
"response": {
12+
"id": 1,
13+
"jsonrpc": "2.0"
14+
},
15+
"test": {
16+
"description": "invoke getStorageValues with omitted block parameter (should default to latest)",
17+
"reference": "https://github.com/erigontech/erigon/pull/21586"
18+
},
19+
"metadata": {
20+
"latest": true
21+
}
22+
}
23+
]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"request": {
4+
"id": 1,
5+
"jsonrpc": "2.0",
6+
"method": "eth_getTransactionCount",
7+
"params": [
8+
"0x2Fc617E933a52713247CE25730f6695920B3befe"
9+
]
10+
},
11+
"response": {
12+
"id": 1,
13+
"jsonrpc": "2.0"
14+
},
15+
"test": {
16+
"description": "invoke getTransactionCount with omitted block parameter (should default to latest)",
17+
"reference": "https://github.com/erigontech/erigon/pull/21586"
18+
},
19+
"metadata": {
20+
"latest": true
21+
}
22+
}
23+
]

0 commit comments

Comments
 (0)