Skip to content
Merged
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
20 changes: 17 additions & 3 deletions simulators/ethereum/graphql/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,23 @@ and reads the test case files. The individual test cases are run as sub-tests ag
the client launched by this test.`,
Parameters: hivesim.Params{
// The graphql chain comes from the Besu codebase, and is built on Frontier.
"HIVE_CHAIN_ID": "1",
"HIVE_GRAPHQL_ENABLED": "1",
"HIVE_ALLOW_UNPROTECTED_TX": "1",
"HIVE_CHAIN_ID": "1",
"HIVE_GRAPHQL_ENABLED": "1",
"HIVE_ALLOW_UNPROTECTED_TX": "1",
"HIVE_FORK_FRONTIER": "0",
"HIVE_FORK_HOMESTEAD": "33",
"HIVE_FORK_TANGERINE": "33",
"HIVE_FORK_SPURIOUS": "33",
"HIVE_FORK_BYZANTIUM": "33",
"HIVE_FORK_CONSTANTINOPLE": "33",
"HIVE_FORK_PETERSBURG": "33",
"HIVE_FORK_ISTANBUL": "33",
"HIVE_FORK_MUIR_GLACIER": "33",
"HIVE_FORK_BERLIN": "33",
"HIVE_FORK_LONDON": "33",
"HIVE_MERGE_BLOCK_ID": "33",
"HIVE_TERMINAL_TOTAL_DIFFICULTY": "4357120",
"HIVE_SHANGHAI_TIMESTAMP": "1444660030",
},
Files: map[string]string{
"/genesis.json": "./init/testGenesis.json",
Expand Down
Binary file modified simulators/ethereum/graphql/init/testBlockchain.blocks
100644 → 100755
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"responses": [{
"data" : {
"block" : {
"number" : "0x20"
"number" : "0x21"
}
}
}],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"responses":[{
"data" : {
"block" : {
"number" : "0x20",
"number" : "0x21",
"call" : {
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001",
"status" : "0x1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"request" :"{block{estimateGas (data: {from :\"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\", data :\"0x608060405234801561001057600080fd5b50610157806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633bdab8bf146100515780639ae97baa14610068575b600080fd5b34801561005d57600080fd5b5061006661007f565b005b34801561007457600080fd5b5061007d6100b9565b005b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60016040518082815260200191505060405180910390a1565b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60026040518082815260200191505060405180910390a17fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60036040518082815260200191505060405180910390a15600a165627a7a7230582010ddaa52e73a98c06dbcd22b234b97206c1d7ed64a7c048e10c2043a3d2309cb0029\"})}}",
"request" :"{block(number: 32) {estimateGas (data: {from :\"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\", data :\"0x608060405234801561001057600080fd5b50610157806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633bdab8bf146100515780639ae97baa14610068575b600080fd5b34801561005d57600080fd5b5061006661007f565b005b34801561007457600080fd5b5061007d6100b9565b005b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60016040518082815260200191505060405180910390a1565b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60026040518082815260200191505060405180910390a17fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60036040518082815260200191505060405180910390a15600a165627a7a7230582010ddaa52e73a98c06dbcd22b234b97206c1d7ed64a7c048e10c2043a3d2309cb0029\"})}}",
"responses":[{
"data" : {
"block" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"request" :"{block{ estimateGas(data:{}) }}",
"request" :"{block(number: 32) { estimateGas(data:{}) }}",
"responses":[{
"data" : {
"block" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
{
"request": "{block{ account(address: \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\") { transactionCount } }}",
"responses": [
{
"data": {
"block": {
"account": {
"transactionCount": "0x20"
}
}
}
},
{
"data": {
"block": {
"account": {
"transactionCount": "0x20"
}
"responses": [{
"data": {
"block": {
"account": {
"transactionCount": "0x21"
}
}
}
],
}],
"statusCode": 200
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
},
{
"number": "0x20"
},
{
"number": "0x21"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"request":
"{ block (number: 32) { number withdrawalsRoot withdrawals { index amount } } }",

"responses": [{
"data" : {
"block" : {
"number" : "0x20",
"withdrawalsRoot": null,
"withdrawals": null
}
}
}],
"statusCode": 200
}
20 changes: 20 additions & 0 deletions simulators/ethereum/graphql/testcases/48_block_withdrawals.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"request":
"{ block (number: 33) { number withdrawalsRoot withdrawals { index amount validator address } } }",

"responses": [{
"data" : {
"block" : {
"number" : "0x21",
"withdrawalsRoot": "0x37945ab58d2712a26df2a38d217e822694927e29b30d5993d7a53ccea618d1f3",
"withdrawals": [{
"index": "0x0",
"amount": "0x2540be400",
"validator": "0xa",
"address": "0x0000000000000000000000000000000000000dad"
}]
}
}
}],
"statusCode": 200
}
19 changes: 19 additions & 0 deletions simulators/ethereum/graphql/testcases/49_get_type2Transaction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"request": "{transaction (hash : \"0x3ecd2ca6cf26c864d0ea5f038a58d4cd4a46a3e242fe92f446f392fdc232dd98\") { accessList { address storageKeys } maxFeePerGas maxPriorityFeePerGas nonce type status } } ",
"responses": [{
"data": {
"transaction": {
"accessList": [{
"address": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"storageKeys": ["0x0000000000000000000000000000000000000000000000000000000000000000"]
}],
"maxFeePerGas": "0xb2d05e00",
"maxPriorityFeePerGas": "0x3b9aca00",
"nonce": "0x20",
"type": "0x2",
"status": "0x1"
}
}
}],
"statusCode": 200
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"request": "{block (number : 33) { baseFeePerGas difficulty extraData miner { address } mixHash nonce stateRoot totalDifficulty withdrawalsRoot withdrawals { address amount index validator } }} ",
"responses":[{
"data" : {
"block" : {
"baseFeePerGas": "0x3b9aca00",
"difficulty": "0x0",
"extraData": "0x",
"miner": {
"address": "0x0000000000000000000000000000000000000000"
},
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"stateRoot": "0x0d3c456bb68669bad05da3a1a766daab236c9df1da8f74edf5ebe9383f00084c",
"totalDifficulty": "0x427c00",
"withdrawalsRoot": "0x37945ab58d2712a26df2a38d217e822694927e29b30d5993d7a53ccea618d1f3",
"withdrawals": [
{
"address": "0x0000000000000000000000000000000000000dad",
"amount": "0x2540be400",
"index": "0x0",
"validator": "0xa"
}
]
}
}
}],
"statusCode": 200
}