Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphql: migrate test cases from hive #470

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
24ce9c2
graphql: add schema from go-ethereum
jsvisa Sep 15, 2023
a782309
tests: add graphql tests
jsvisa Sep 15, 2023
cb71baa
graphql/tests: rename query.gql to request.gql
jsvisa Sep 15, 2023
bdd28dd
scripts: graphql schema validate
jsvisa Sep 15, 2023
412fc7f
package/lint: run graphql-schema-validate
jsvisa Sep 15, 2023
bcc830e
graphql: regenerate
jsvisa Sep 18, 2023
e9ea44b
scripts: validate schema testcases
jsvisa Sep 18, 2023
c0e25cd
Revert "package/lint: run graphql-schema-validate"
jsvisa Sep 18, 2023
540a9e5
Revert "scripts: graphql schema validate"
jsvisa Sep 18, 2023
cd27447
Revert "graphql: add schema from go-ethereum"
jsvisa Sep 18, 2023
6240dce
scripts: typo
jsvisa Sep 18, 2023
968f95b
graphql: add genesis.json chain.rlp
jsvisa Sep 18, 2023
216968e
graphql: move chain,genesis inside into tests
jsvisa Sep 19, 2023
84a2c8b
scripts/validate: don't test file
jsvisa Sep 19, 2023
0eacda2
Revert "graphql: regenerate"
jsvisa Sep 21, 2023
38cb413
tests: move jsonrpc tests
jsvisa Sep 26, 2023
80720f4
tests: move graphql tests
jsvisa Sep 26, 2023
3c11ca6
graphql: rm sequence in the tc name
jsvisa Sep 26, 2023
6eb3903
scripts: test path changed
jsvisa Sep 26, 2023
350dc0b
graphql: exclude eth_gasPrice
jsvisa Oct 17, 2023
328d7e5
graphql: drop multi responses
jsvisa Oct 17, 2023
bd2146f
tests/graphql: convert into .io format
jsvisa Oct 19, 2023
4a7b9a1
scripts: validate graphql
jsvisa Oct 19, 2023
38fdebd
github/workflows: don't check graphql spec
jsvisa Oct 19, 2023
22dda70
grqphal/block/eth_getBalance_toobig_bn.io: set a larger block number(…
jsvisa Oct 19, 2023
892c15d
graphql/blocks/graphql_blocks_byWrongRange.io: wrong range return empty
jsvisa Oct 19, 2023
be8c7c1
graphql/pending/graphql_pending.io: pending should add send a tx first
jsvisa Oct 19, 2023
f818b47
graphql/transaction/eth_getTransactionReceipt: tx.index/log.index fro…
jsvisa Oct 19, 2023
ba72a8d
graphql/transaction/eth_getTransaction_byHash.io: tx.status is null b…
jsvisa Oct 19, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
- name: Install speccheck
run: go install github.com/lightclient/rpctestgen/cmd/speccheck@latest
- name: Run speccheck
run: speccheck -v
run: speccheck -v --tests tests/jsonrpc
69 changes: 60 additions & 9 deletions scripts/graphql-validate.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import fs from 'fs';
import path from 'path';
import graphql from 'graphql';
import { diff, DiffRule } from '@graphql-inspector/core';
import { diff } from '@graphql-inspector/core';

function ignoreDirectiveChanges(obj) {
return obj.changes.filter((change) => !change.type.startsWith('DIRECTIVE'))
return obj.changes.filter((change) => !change.type.startsWith('DIRECTIVE'));
}

// Validate JSON schema
const raw = fs.readFileSync('graphql.json');
const schema = graphql.buildClientSchema(JSON.parse(raw));
graphql.assertValidSchema(schema)
console.log('GraphQL JSON schema validated successfully.')
graphql.assertValidSchema(schema);
console.log('GraphQL JSON schema validated successfully.');

// Validate standard schema
const rawStd = fs.readFileSync('schema.graphqls', 'utf8');
Expand All @@ -19,10 +20,60 @@ graphql.assertValidSchema(schemaStd);
console.log('GraphQL standard schema validated successfully.');

// Compare and make sure JSON and standard schemas match.
diff(schema, schemaStd, [ignoreDirectiveChanges]).then((changes) => {
diff(schema, schemaStd, [ignoreDirectiveChanges])
.then((changes) => {
if (changes.length === 0) {
console.log('GraphQL schemas match.')
return
console.log('GraphQL schemas match.');
return;
}
throw new Error(`Found differences between JSON and standard:\n${JSON.stringify(changes, null, 2)}`)
}).catch(console.error);
throw new Error(
`Found differences between JSON and standard:\n${JSON.stringify(
changes,
null,
2
)}`
);
})
.catch(console.error);

function validateGraphql(dir) {
fs.readdir(dir, (_, files) => {
files.forEach((file) => {
const filePath = path.join(dir, file);

console.log(`Validating file: ${filePath}`);
if (fs.statSync(filePath).isFile()) {
const lines = fs.readFileSync(filePath, 'utf8').split('\n');

let prev = null;
lines.forEach((line) => {
if (prev && prev.startsWith('>> ') && line.startsWith('<< ')) {
const output = JSON.parse(line.substring(3));

// Validate the success Query
if (!'errors' in output) {
const query = graphql.parse(line.substring(3));
const result = graphql.validate(schema, query);
if (result.length === 0) {
console.log(`GraphQL test ${file} validated successfully.`);
} else {
throw new Error(
`GraphQL query ${file} failed validation:\n${JSON.stringify(
result,
null,
2
)}`
);
}
}
}

prev = line;
});
} else {
validateGraphql(filePath);
}
});
});
}
validateGraphql('tests/graphql');
2 changes: 2 additions & 0 deletions tests/graphql/block/block_withdrawals.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: 33) {number withdrawalsRoot withdrawals {index amount validator address}}}
<< {"data":{"block":{"number":"0x21","withdrawalsRoot":"0x37945ab58d2712a26df2a38d217e822694927e29b30d5993d7a53ccea618d1f3","withdrawals":[{"index":"0x0","amount":"0x2540be400","validator":"0xa","address":"0x0000000000000000000000000000000000000dad"}]}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/block_withdrawals_pre_shanghai.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: 32) {number withdrawalsRoot withdrawals {index amount}}}
<< {"data":{"block":{"number":"0x20","withdrawalsRoot":null,"withdrawals":null}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_blockNumber.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block {number}}
<< {"data":{"block":{"number":"0x21"}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_call_Block8.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: 8) {number call(data: {from: "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" to: "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f" data: "0x12a7b914"}) {data status}}}
<< {"data":{"block":{"number":"0x8","call":{"data":"0x0000000000000000000000000000000000000000000000000000000000000000","status":"0x1"}}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_call_BlockLatest.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block {number call(data: {from: "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" to: "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f" data: "0x12a7b914"}) {data status}}}
<< {"data":{"block":{"number":"0x21","call":{"data":"0x0000000000000000000000000000000000000000000000000000000000000001","status":"0x1"}}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_estimateGas_contractDeploy.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: 32) {estimateGas(data: {from: "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f" data: "0x608060405234801561001057600080fd5b50610157806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633bdab8bf146100515780639ae97baa14610068575b600080fd5b34801561005d57600080fd5b5061006661007f565b005b34801561007457600080fd5b5061007d6100b9565b005b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60016040518082815260200191505060405180910390a1565b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60026040518082815260200191505060405180910390a17fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60036040518082815260200191505060405180910390a15600a165627a7a7230582010ddaa52e73a98c06dbcd22b234b97206c1d7ed64a7c048e10c2043a3d2309cb0029"})}}
<< {"data":{"block":{"estimateGas":"0x1b551"}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_estimateGas_noParams.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: 32) {estimateGas(data: {})}}
<< {"data":{"block":{"estimateGas":"0x5208"}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_estimateGas_transfer.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block {estimateGas(data: {from: "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f" to: "0x8888f1f195afa192cfee860698584c030f4c9db1"})}}
<< {"data":{"block":{"estimateGas":"0x5208"}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getBalance_0x19.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: 25) {account(address: "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f") {balance}}}
<< {"data":{"block":{"account":{"balance":"0xfa"}}}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: 25) {account(address: "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef") {balance}}}
<< {"data":{"block":{"account":{"balance":"0x0"}}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getBalance_invalidAccountLatest.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block {account(address: "0xdeaff00ddeaff00ddeaff00ddeaff00ddeaff00d") {balance}}}
<< {"data":{"block":{"account":{"balance":"0x0"}}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getBalance_latest.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block {account(address: "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f") {balance}}}
<< {"data":{"block":{"account":{"balance":"0x140"}}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getBalance_toobig_bn.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: 133) {account(address: "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f") {balance}}}
<< {"data":{"block":null}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getBalance_without_addr.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block {account {balance}}}
<< {"errors":[{"message":"ValidationerroroftypeMissingFieldArgument:Missingfieldargumentaddress@'account'","locations":[{"line":1,"column":2}],"extensions":{"classification":"ValidationError"}}]}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getBlockTransactionCount_byHash.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(hash: "0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6") {transactionCount}}
<< {"data":{"block":{"transactionCount":"0x1"}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getBlockTransactionCount_byNumber.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: 30) {transactions {hash} timestamp difficulty totalDifficulty gasUsed gasLimit hash nonce ommerCount logsBloom mixHash ommerHash extraData stateRoot receiptsRoot transactionCount transactionsRoot}}
<< {"data":{"block":{"transactions":[{"hash":"0x9cc6c7e602c56aa30c554bb691377f8703d778cec8845f4b88c0f72516b304f4"}],"timestamp":"0x561bc336","difficulty":"0x20740","totalDifficulty":"0x3e6cc0","gasUsed":"0x5c21","gasLimit":"0x2fefd8","hash":"0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6","nonce":"0x5c321bd9e9f040f1","ommerCount":"0x0","logsBloom":"0x00000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000080000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000400000000000000000200000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000800000000040000000000000000000000000000000000000000010000000000000000000000000","mixHash":"0x6ce1c4afb4f85fefd1b0ed966b20cd248f08d9a5b0df773f75c6c2f5cc237b7c","ommerHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","extraData":"0x","stateRoot":"0xdb46d6bb168130fe2cb60b4b24346137b5741f11283e0d7edace65c5f5466b2e","receiptsRoot":"0x88b3b304b058b39791c26fdb94a05cc16ce67cf8f84f7348cb3c60c0ff342d0d","transactionCount":"0x1","transactionsRoot":"0x5a8d5d966b48e1331ae19eb459eb28882cdc7654e615d37774b79204e875dc01"}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getBlock_byHash.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(hash: "0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6") {number transactions {hash} timestamp difficulty totalDifficulty gasUsed gasLimit hash nonce ommerCount logsBloom mixHash ommerHash extraData stateRoot receiptsRoot transactionCount transactionsRoot}}
<< {"data":{"block":{"number":"0x1e","transactions":[{"hash":"0x9cc6c7e602c56aa30c554bb691377f8703d778cec8845f4b88c0f72516b304f4"}],"timestamp":"0x561bc336","difficulty":"0x20740","totalDifficulty":"0x3e6cc0","gasUsed":"0x5c21","gasLimit":"0x2fefd8","hash":"0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6","nonce":"0x5c321bd9e9f040f1","ommerCount":"0x0","logsBloom":"0x00000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000080000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000400000000000000000200000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000800000000040000000000000000000000000000000000000000010000000000000000000000000","mixHash":"0x6ce1c4afb4f85fefd1b0ed966b20cd248f08d9a5b0df773f75c6c2f5cc237b7c","ommerHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","extraData":"0x","stateRoot":"0xdb46d6bb168130fe2cb60b4b24346137b5741f11283e0d7edace65c5f5466b2e","receiptsRoot":"0x88b3b304b058b39791c26fdb94a05cc16ce67cf8f84f7348cb3c60c0ff342d0d","transactionCount":"0x1","transactionsRoot":"0x5a8d5d966b48e1331ae19eb459eb28882cdc7654e615d37774b79204e875dc01"}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getBlock_byHashInvalid.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(hash: "0x123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0") {number}}
<< {"errors":[{"message":"Exceptionwhilefetchingdata(/block):Blockhash0x123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0wasnotfound","locations":[{"line":1,"column":2}],"path":["block"],"extensions":{"classification":"DataFetchingException"}}],"data":null}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getBlock_byNumber.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: 30) {transactions {hash} timestamp difficulty totalDifficulty gasUsed gasLimit hash nonce ommerCount logsBloom mixHash ommerHash extraData stateRoot receiptsRoot transactionCount transactionsRoot ommers {hash} ommerAt(index: 1) {hash} miner {address} account(address: "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f") {balance} parent {hash}}}
<< {"data":{"block":{"transactions":[{"hash":"0x9cc6c7e602c56aa30c554bb691377f8703d778cec8845f4b88c0f72516b304f4"}],"timestamp":"0x561bc336","difficulty":"0x20740","totalDifficulty":"0x3e6cc0","gasUsed":"0x5c21","gasLimit":"0x2fefd8","hash":"0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6","nonce":"0x5c321bd9e9f040f1","ommerCount":"0x0","logsBloom":"0x00000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000080000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000400000000000000000200000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000800000000040000000000000000000000000000000000000000010000000000000000000000000","mixHash":"0x6ce1c4afb4f85fefd1b0ed966b20cd248f08d9a5b0df773f75c6c2f5cc237b7c","ommerHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","extraData":"0x","stateRoot":"0xdb46d6bb168130fe2cb60b4b24346137b5741f11283e0d7edace65c5f5466b2e","receiptsRoot":"0x88b3b304b058b39791c26fdb94a05cc16ce67cf8f84f7348cb3c60c0ff342d0d","transactionCount":"0x1","transactionsRoot":"0x5a8d5d966b48e1331ae19eb459eb28882cdc7654e615d37774b79204e875dc01","ommers":[],"ommerAt":null,"miner":{"address":"0x8888f1f195afa192cfee860698584c030f4c9db1"},"account":{"balance":"0x12c"},"parent":{"hash":"0xf8cfa377bd766cdf22edb388dd08cc149e85d24f2796678c835f3c54ab930803"}}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getBlock_byNumberInvalid.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: 88888888) {number}}
<< {"data":{"block":null}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getBlock_shanghai.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: 33) {baseFeePerGas difficulty extraData miner {address} mixHash nonce stateRoot totalDifficulty withdrawalsRoot withdrawals {address amount index validator}}}
<< {"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"}]}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getBlock_wrongParams.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: "0x03" hash: "0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6") {number transactions {hash} timestamp difficulty totalDifficulty gasUsed gasLimit hash nonce ommerCount logsBloom mixHash ommerHash extraData stateRoot receiptsRoot transactionCount transactionsRoot}}
<< {"errors":[{"message":"Exceptionwhilefetchingdata(/block):Invalidparams","locations":[{"line":1,"column":2}],"path":["block"],"extensions":{"errorCode":-32602,"errorMessage":"Invalidparams","classification":"DataFetchingException"}}],"data":null}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getCode.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block {account(address: "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f") {code}}}
<< {"data":{"block":{"account":{"code":"0x6000357c010000000000000000000000000000000000000000000000000000000090048063102accc11461012c57806312a7b9141461013a5780631774e6461461014c5780631e26fd331461015d5780631f9030371461016e578063343a875d1461018057806338cc4831146101955780634e7ad367146101bd57806357cb2fc4146101cb57806365538c73146101e057806368895979146101ee57806376bc21d9146102005780639a19a9531461020e5780639dc2c8f51461021f578063a53b1c1e1461022d578063a67808571461023e578063b61c05031461024c578063c2b12a731461025a578063d2282dc51461026b578063e30081a01461027c578063e8beef5b1461028d578063f38b06001461029b578063f5b53e17146102a9578063fd408767146102bb57005b6101346104d6565b60006000f35b61014261039b565b8060005260206000f35b610157600435610326565b60006000f35b6101686004356102c9565b60006000f35b610176610442565b8060005260206000f35b6101886103d3565b8060ff1660005260206000f35b61019d610413565b8073ffffffffffffffffffffffffffffffffffffffff1660005260206000f35b6101c56104c5565b60006000f35b6101d36103b7565b8060000b60005260206000f35b6101e8610454565b60006000f35b6101f6610401565b8060005260206000f35b61020861051f565b60006000f35b6102196004356102e5565b60006000f35b610227610693565b60006000f35b610238600435610342565b60006000f35b610246610484565b60006000f35b610254610493565b60006000f35b61026560043561038d565b60006000f35b610276600435610350565b60006000f35b61028760043561035e565b60006000f35b6102956105b4565b60006000f35b6102a3610547565b60006000f35b6102b16103ef565b8060005260206000f35b6102c3610600565b60006000f35b80600060006101000a81548160ff021916908302179055505b50565b80600060016101000a81548160ff02191690837f01000000000000000000000000000000000000000000000000000000000000009081020402179055505b50565b80600060026101000a81548160ff021916908302179055505b50565b806001600050819055505b50565b806002600050819055505b50565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b50565b806004600050819055505b50565b6000600060009054906101000a900460ff1690506103b4565b90565b6000600060019054906101000a900460000b90506103d0565b90565b6000600060029054906101000a900460ff1690506103ec565b90565b600060016000505490506103fe565b90565b60006002600050549050610410565b90565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061043f565b90565b60006004600050549050610451565b90565b7f65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be5806000602a81526020016000a15b565b6000602a81526020016000a05b565b60017f81933b308056e7e85668661dcd102b1f22795b4431f9cf4625794f381c271c6b6000602a81526020016000a25b565b60016000602a81526020016000a15b565b3373ffffffffffffffffffffffffffffffffffffffff1660017f0e216b62efbb97e751a2ce09f607048751720397ecfb9eef1e48a6644948985b6000602a81526020016000a35b565b3373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a25b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017f317b31292193c2a4f561cc40a95ea0d97a2733f14af6d6d59522473e1f3ae65f6000602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a35b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017fd5f0a30e4be0c6be577a71eceb7464245a796a7e6a55c0d971837b250de05f4e60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff16600160007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a35b56"}}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getCode_noCode.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block {account(address: "0x8888f1f195afa192cfee860698584c030f4c9db1") {code}}}
<< {"data":{"block":{"account":{"code":"0x"}}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getLogs_matchTopic.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: 23) {logs(filter: {topics: [ [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b" "0x65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be580" ] ]}) {index topics data account {address} transaction {hash}}}}
<< {"data":{"block":{"logs":[{"index":"0x0","topics":["0x65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be580"],"data":"0x000000000000000000000000000000000000000000000000000000000000002a","account":{"address":"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f"},"transaction":{"hash":"0x97a385bf570ced7821c6495b3877ddd2afd5c452f350f0d4876e98d9161389c6"}}]}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getStorageAt.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block {account(address: "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f") {storage(slot: "0x0000000000000000000000000000000000000000000000000000000000000004")}}}
<< {"data":{"block":{"account":{"storage":"0xaabbccffffffffffffffffffffffffffffffffffffffffffffffffffffffffee"}}}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block {account(address: "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f") {storage(slot: "0x0000000000000000000000000000000000000000000000000000000000000021")}}}
<< {"data":{"block":{"account":{"storage":"0x0000000000000000000000000000000000000000000000000000000000000000"}}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getTransactionCount.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block {account(address: "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b") {transactionCount}}}
<< {"data":{"block":{"account":{"transactionCount":"0x21"}}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/eth_getTransaction_byBlockHashAndIndex.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(hash: "0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6") {transactionAt(index: 0) {block {hash} hash}}}
<< {"data":{"block":{"transactionAt":{"block":{"hash":"0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6"},"hash":"0x9cc6c7e602c56aa30c554bb691377f8703d778cec8845f4b88c0f72516b304f4"}}}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: 30) {transactionAt(index: 0) {block {hash} hash}}}
<< {"data":{"block":{"transactionAt":{"block":{"hash":"0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6"},"hash":"0x9cc6c7e602c56aa30c554bb691377f8703d778cec8845f4b88c0f72516b304f4"}}}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: 30) {transactionAt(index: 1) {block {hash} hash}}}
<< {"data":{"block":{"transactionAt":null}}}
2 changes: 2 additions & 0 deletions tests/graphql/block/getBlock_byHexNumber.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {block(number: "0x1e") {gasUsed gasLimit hash}}
<< {"data":{"block":{"gasUsed":"0x5c21","gasLimit":"0x2fefd8","hash":"0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6"}}}
2 changes: 2 additions & 0 deletions tests/graphql/blocks/graphql_blocks_byFrom.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {blocks(from: 30) {number}}
<< {"data":{"blocks":[{"number":"0x1e"},{"number":"0x1f"},{"number":"0x20"},{"number":"0x21"}]}}
Loading
Loading