diff --git a/simulators/ethereum/graphql/graphql.go b/simulators/ethereum/graphql/graphql.go index 37685c0177..a517da80cc 100644 --- a/simulators/ethereum/graphql/graphql.go +++ b/simulators/ethereum/graphql/graphql.go @@ -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", diff --git a/simulators/ethereum/graphql/init/testBlockchain.blocks b/simulators/ethereum/graphql/init/testBlockchain.blocks old mode 100644 new mode 100755 index d29453d3e5..480efc87d9 Binary files a/simulators/ethereum/graphql/init/testBlockchain.blocks and b/simulators/ethereum/graphql/init/testBlockchain.blocks differ diff --git a/simulators/ethereum/graphql/testcases/01_eth_blockNumber.json b/simulators/ethereum/graphql/testcases/01_eth_blockNumber.json index 5ae54a0dc9..8ff5d2aa9e 100644 --- a/simulators/ethereum/graphql/testcases/01_eth_blockNumber.json +++ b/simulators/ethereum/graphql/testcases/01_eth_blockNumber.json @@ -5,7 +5,7 @@ "responses": [{ "data" : { "block" : { - "number" : "0x20" + "number" : "0x21" } } }], diff --git a/simulators/ethereum/graphql/testcases/03_eth_call_BlockLatest.json b/simulators/ethereum/graphql/testcases/03_eth_call_BlockLatest.json index cd51985471..b3a19b2699 100644 --- a/simulators/ethereum/graphql/testcases/03_eth_call_BlockLatest.json +++ b/simulators/ethereum/graphql/testcases/03_eth_call_BlockLatest.json @@ -4,7 +4,7 @@ "responses":[{ "data" : { "block" : { - "number" : "0x20", + "number" : "0x21", "call" : { "data" : "0x0000000000000000000000000000000000000000000000000000000000000001", "status" : "0x1" diff --git a/simulators/ethereum/graphql/testcases/04_eth_estimateGas_contractDeploy.json b/simulators/ethereum/graphql/testcases/04_eth_estimateGas_contractDeploy.json index e16a07cbe4..e478559af5 100644 --- a/simulators/ethereum/graphql/testcases/04_eth_estimateGas_contractDeploy.json +++ b/simulators/ethereum/graphql/testcases/04_eth_estimateGas_contractDeploy.json @@ -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" : { diff --git a/simulators/ethereum/graphql/testcases/05_eth_estimateGas_noParams.json b/simulators/ethereum/graphql/testcases/05_eth_estimateGas_noParams.json index a6eaa2bbc6..9eb5656b58 100644 --- a/simulators/ethereum/graphql/testcases/05_eth_estimateGas_noParams.json +++ b/simulators/ethereum/graphql/testcases/05_eth_estimateGas_noParams.json @@ -1,5 +1,5 @@ { - "request" :"{block{ estimateGas(data:{}) }}", + "request" :"{block(number: 32) { estimateGas(data:{}) }}", "responses":[{ "data" : { "block" : { diff --git a/simulators/ethereum/graphql/testcases/32_eth_getTransactionCount.json b/simulators/ethereum/graphql/testcases/32_eth_getTransactionCount.json index 675c8de0b3..7234ea96b1 100644 --- a/simulators/ethereum/graphql/testcases/32_eth_getTransactionCount.json +++ b/simulators/ethereum/graphql/testcases/32_eth_getTransactionCount.json @@ -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 } diff --git a/simulators/ethereum/graphql/testcases/41_graphql_blocks_byFrom.json b/simulators/ethereum/graphql/testcases/41_graphql_blocks_byFrom.json index 1769109a8e..020f787807 100644 --- a/simulators/ethereum/graphql/testcases/41_graphql_blocks_byFrom.json +++ b/simulators/ethereum/graphql/testcases/41_graphql_blocks_byFrom.json @@ -11,6 +11,9 @@ }, { "number": "0x20" + }, + { + "number": "0x21" } ] } diff --git a/simulators/ethereum/graphql/testcases/46_getBlock_byHexNumber.json b/simulators/ethereum/graphql/testcases/44_getBlock_byHexNumber.json similarity index 100% rename from simulators/ethereum/graphql/testcases/46_getBlock_byHexNumber.json rename to simulators/ethereum/graphql/testcases/44_getBlock_byHexNumber.json diff --git a/simulators/ethereum/graphql/testcases/47_eth_getLogs_range_hex.json b/simulators/ethereum/graphql/testcases/45_eth_getLogs_range_hex.json similarity index 100% rename from simulators/ethereum/graphql/testcases/47_eth_getLogs_range_hex.json rename to simulators/ethereum/graphql/testcases/45_eth_getLogs_range_hex.json diff --git a/simulators/ethereum/graphql/testcases/48_transaction_fromByHexBlockNumber.json b/simulators/ethereum/graphql/testcases/46_transaction_fromByHexBlockNumber.json similarity index 100% rename from simulators/ethereum/graphql/testcases/48_transaction_fromByHexBlockNumber.json rename to simulators/ethereum/graphql/testcases/46_transaction_fromByHexBlockNumber.json diff --git a/simulators/ethereum/graphql/testcases/47_block_withdrawals_pre_shanghai.json b/simulators/ethereum/graphql/testcases/47_block_withdrawals_pre_shanghai.json new file mode 100644 index 0000000000..1699f5c9d8 --- /dev/null +++ b/simulators/ethereum/graphql/testcases/47_block_withdrawals_pre_shanghai.json @@ -0,0 +1,15 @@ +{ + "request": + "{ block (number: 32) { number withdrawalsRoot withdrawals { index amount } } }", + + "responses": [{ + "data" : { + "block" : { + "number" : "0x20", + "withdrawalsRoot": null, + "withdrawals": null + } + } + }], + "statusCode": 200 +} diff --git a/simulators/ethereum/graphql/testcases/48_block_withdrawals.json b/simulators/ethereum/graphql/testcases/48_block_withdrawals.json new file mode 100644 index 0000000000..154c685f9e --- /dev/null +++ b/simulators/ethereum/graphql/testcases/48_block_withdrawals.json @@ -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 +} \ No newline at end of file diff --git a/simulators/ethereum/graphql/testcases/49_get_type2Transaction.json b/simulators/ethereum/graphql/testcases/49_get_type2Transaction.json new file mode 100644 index 0000000000..5ceb49f1f7 --- /dev/null +++ b/simulators/ethereum/graphql/testcases/49_get_type2Transaction.json @@ -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 +} \ No newline at end of file diff --git a/simulators/ethereum/graphql/testcases/50_eth_getBlock_shanghai.json b/simulators/ethereum/graphql/testcases/50_eth_getBlock_shanghai.json new file mode 100644 index 0000000000..7c7d8bd588 --- /dev/null +++ b/simulators/ethereum/graphql/testcases/50_eth_getBlock_shanghai.json @@ -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 +} \ No newline at end of file