add our own hive/graphql simulator into hive_integration

now we can run hive/graphql test without using hive or docker.
it's useful for debugging session. but lacking nice result report
like real hive.
This commit is contained in:
jangko 2021-05-12 19:28:04 +07:00
parent a57ac65c8c
commit 6966324f3b
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
49 changed files with 1023 additions and 0 deletions

View File

@ -0,0 +1,85 @@
import
std/[os, parseopt, json, unittest], chronicles,
eth/[p2p, trie/db], ../../../nimbus/db/db_chain,
eth/p2p/rlpx_protocols/eth_protocol,
../../../nimbus/[genesis, config, conf_utils],
../../../nimbus/graphql/ethapi, ../../../tests/test_helpers,
graphql
const
baseFolder = "hive_integration" / "nodocker" / "graphql"
blocksFile = baseFolder / "init" / "blocks.rlp"
genesisFile = baseFolder / "init" / "genesis.json"
caseFolder = baseFolder / "testcases"
proc processNode(ctx: GraphqlRef, node: JsonNode, fileName: string, testStatusIMPL: var TestStatus) =
let request = node["request"]
let responses = node["responses"]
let statusCode = node["statusCode"].getInt()
let savePoint = ctx.getNameCounter()
let res = ctx.parseQuery(request.getStr())
block:
if res.isErr:
if statusCode == 200:
debugEcho res.error
check statusCode != 200
break
let resp = JsonRespStream.new()
let r = ctx.executeRequest(respStream(resp))
if r.isErr:
if statusCode == 200:
debugEcho r.error
check statusCode != 200
break
check statusCode == 200
check r.isOk
let nimbus = resp.getString()
var resultOK = false
for x in responses:
let hive = $(x["data"])
if nimbus == hive:
resultOK = true
break
check resultOK
if not resultOK:
debugEcho "NIMBUS RESULT: ", nimbus
for x in responses:
let hive = $(x["data"])
debugEcho "HIVE RESULT: ", hive
ctx.purgeQueries()
ctx.purgeNames(savePoint)
proc main() =
var msg: string
var opt = initOptParser("--customnetwork:" & genesisFile)
let res = processArguments(msg, opt)
if res != Success:
echo msg
quit(QuitFailure)
let
conf = getConfiguration()
ethNode = setupEthNode(eth)
chainDB = newBaseChainDB(newMemoryDb(),
pruneTrie = false,
id = toPublicNetwork(conf.net.networkId)
)
initializeEmptyDb(chainDB)
importRlpBlock(blocksFile, chainDB)
let ctx = setupGraphqlContext(chainDB, ethNode)
suite "graphql":
for fileName in walkDirRec(caseFolder):
let node = parseFile(fileName)
test fileName:
ctx.processNode(node, fileName, testStatusIMPL)
main()

Binary file not shown.

View File

@ -0,0 +1,15 @@
{
"coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
"difficulty" : "0x020000",
"extraData" : "0x42",
"gasLimit" : "0x2fefd8",
"mixHash" : "0x2c85bcbce56429100b2108254bb56906257582aeafcbd682bc9af67a9f5aee46",
"nonce" : "0x78cc16f7b4f65485",
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp" : "0x54c98c81",
"alloc" : {
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b": {
"balance" : "0x09184e72a000"
}
}
}

View File

@ -0,0 +1,13 @@
{
"request":
"{ block { number } }",
"responses": [{
"data" : {
"block" : {
"number" : 32
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,16 @@
{
"request": "{block(number :8) {number call (data : {from : \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\", to: \"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\", data :\"0x12a7b914\"}){data status}}}"
,
"responses":[{
"data" : {
"block" : {
"number" : 8,
"call" : {
"data" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"status" : 1
}
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,16 @@
{
"request": "{block {number call (data : {from : \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\", to: \"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\", data :\"0x12a7b914\"}){data status}}}"
,
"responses":[{
"data" : {
"block" : {
"number" : 32,
"call" : {
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001",
"status" : 1
}
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,11 @@
{
"request" :"{block{estimateGas (data: {from :\"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\", data :\"0x608060405234801561001057600080fd5b50610157806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633bdab8bf146100515780639ae97baa14610068575b600080fd5b34801561005d57600080fd5b5061006661007f565b005b34801561007457600080fd5b5061007d6100b9565b005b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60016040518082815260200191505060405180910390a1565b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60026040518082815260200191505060405180910390a17fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60036040518082815260200191505060405180910390a15600a165627a7a7230582010ddaa52e73a98c06dbcd22b234b97206c1d7ed64a7c048e10c2043a3d2309cb0029\"})}}",
"responses":[{
"data" : {
"block" : {
"estimateGas" : 111953
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,11 @@
{
"request" :"{block{ estimateGas(data:{}) }}",
"responses":[{
"data" : {
"block" : {
"estimateGas" : 21000
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,11 @@
{
"request" :"{block{estimateGas (data: {from :\"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\", to :\"0x8888f1f195afa192cfee860698584c030f4c9db1\"})}}",
"responses":[{
"data" : {
"block" : {
"estimateGas" : 21000
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,17 @@
{
"request":
"{ gasPrice }",
"responses": [
{
"data" : {
"gasPrice" : "0x10"
}
},
{
"data" : {
"gasPrice" : "0x1"
}
}
],
"statusCode": 200
}

View File

@ -0,0 +1,14 @@
{
"request": "{block (number : 25) {account(address: \"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\") { balance } }}",
"responses": [{
"data": {
"block": {
"account": {
"balance": "0xfa"
}
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,11 @@
{
"request": "{block (number: 25) {account(address: \"0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef\") { balance } }}",
"responses": [{
"data": {
"account": {
"balance": "0x"
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,11 @@
{
"request": "{block{account(address: \"0xdeaff00ddeaff00ddeaff00ddeaff00ddeaff00d\") { balance } }}",
"responses": [{
"data": {
"account": {
"balance": "0x"
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,14 @@
{
"request": "{block{account(address: \"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\") { balance } }}",
"responses":[{
"data": {
"block": {
"account": {
"balance": "0x140"
}
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,32 @@
{
"request": "{block (number: 33) {account(address: \"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\") { balance } }}",
"responses": [{
"errors": [
{
"message": "Exception while fetching data (/account) : Invalid params",
"locations": [
{
"line": 1,
"column": 2
}
],
"path": [
"account"
],
"extensions": {
"errorCode": -32602,
"errorMessage": "Invalid params",
"classification": "DataFetchingException"
}
}
],
"data": null
},
{
"data": {
"block": null
}
}],
"statusCode": 400
}

View File

@ -0,0 +1,21 @@
{
"request": "{block{account { balance } }}",
"responses": [{
"errors": [
{
"message": "Validation error of type MissingFieldArgument: Missing field argument address @ 'account'",
"locations": [
{
"line": 1,
"column": 2
}
],
"extensions": {
"classification": "ValidationError"
}
}
]
}],
"statusCode": 400
}

View File

@ -0,0 +1,34 @@
{
"request":
"{block (hash : \"0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6\") {number transactions{hash} timestamp difficulty totalDifficulty gasUsed gasLimit hash nonce ommerCount logsBloom mixHash ommerHash extraData stateRoot receiptsRoot transactionCount transactionsRoot}} ",
"responses": [{
"data" : {
"block" : {
"number" : 30,
"transactions" : [ {
"hash" : "0x9cc6c7e602c56aa30c554bb691377f8703d778cec8845f4b88c0f72516b304f4"
} ],
"timestamp" : "0x561bc336",
"difficulty" : "0x20740",
"totalDifficulty" : "0x3e6cc0",
"gasUsed" : 23585,
"gasLimit" : 3141592,
"hash" : "0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6",
"nonce" : "0x5c321bd9e9f040f1",
"ommerCount" : 0,
"logsBloom" : "0x00000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000080000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000400000000000000000200000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000800000000040000000000000000000000000000000000000000010000000000000000000000000",
"mixHash" : "0x6ce1c4afb4f85fefd1b0ed966b20cd248f08d9a5b0df773f75c6c2f5cc237b7c",
"ommerHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"extraData" : "0x",
"stateRoot" : "0xdb46d6bb168130fe2cb60b4b24346137b5741f11283e0d7edace65c5f5466b2e",
"receiptsRoot" : "0x88b3b304b058b39791c26fdb94a05cc16ce67cf8f84f7348cb3c60c0ff342d0d",
"transactionCount" : 1,
"transactionsRoot" : "0x5a8d5d966b48e1331ae19eb459eb28882cdc7654e615d37774b79204e875dc01"
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,24 @@
{
"request": "{block (hash : \"0x123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0\") {number } }",
"responses": [{
"errors": [
{
"message": "Exception while fetching data (/block) : Block hash 0x123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0 was not found",
"locations": [
{
"line": 1,
"column": 2
}
],
"path": [
"block"
],
"extensions": {
"classification": "DataFetchingException"
}
}
],
"data": null
}],
"statusCode": 400
}

View File

@ -0,0 +1,44 @@
{
"request":
"{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} }} ",
"responses":[{
"data" : {
"block" : {
"transactions" : [ {
"hash" : "0x9cc6c7e602c56aa30c554bb691377f8703d778cec8845f4b88c0f72516b304f4"
} ],
"timestamp" : "0x561bc336",
"difficulty" : "0x20740",
"totalDifficulty" : "0x3e6cc0",
"gasUsed" : 23585,
"gasLimit" : 3141592,
"hash" : "0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6",
"nonce" : "0x5c321bd9e9f040f1",
"ommerCount" : 0,
"logsBloom" : "0x00000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000080000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000400000000000000000200000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000800000000040000000000000000000000000000000000000000010000000000000000000000000",
"mixHash" : "0x6ce1c4afb4f85fefd1b0ed966b20cd248f08d9a5b0df773f75c6c2f5cc237b7c",
"ommerHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"extraData" : "0x",
"stateRoot" : "0xdb46d6bb168130fe2cb60b4b24346137b5741f11283e0d7edace65c5f5466b2e",
"receiptsRoot" : "0x88b3b304b058b39791c26fdb94a05cc16ce67cf8f84f7348cb3c60c0ff342d0d",
"transactionCount" : 1,
"transactionsRoot" : "0x5a8d5d966b48e1331ae19eb459eb28882cdc7654e615d37774b79204e875dc01",
"ommers" : [ ],
"ommerAt" : null,
"miner" : {
"address" : "0x8888f1f195afa192cfee860698584c030f4c9db1"
},
"account" : {
"balance" : "0x12c"
},
"parent" : {
"hash" : "0xf8cfa377bd766cdf22edb388dd08cc149e85d24f2796678c835f3c54ab930803"
}
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,31 @@
{
"request": "{block (number: 88888888) {number }} ",
"responses": [
{
"errors": [
{
"message": "Exception while fetching data (/block) : Block number 88888888 was not found",
"locations": [
{
"line": 1,
"column": 2
}
],
"path": [
"block"
],
"extensions": {
"classification": "DataFetchingException"
}
}
],
"data": null
},
{
"data": {
"block": null
}
}
],
"statusCode": 400
}

View File

@ -0,0 +1,26 @@
{
"request": "{block (number: \"0x03\", hash : \"0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6\") {number transactions{hash} timestamp difficulty totalDifficulty gasUsed gasLimit hash nonce ommerCount logsBloom mixHash ommerHash extraData stateRoot receiptsRoot transactionCount transactionsRoot}} ",
"responses": [{
"errors": [
{
"message": "Exception while fetching data (/block) : Invalid params",
"locations": [
{
"line": 1,
"column": 2
}
],
"path": [
"block"
],
"extensions": {
"errorCode": -32602,
"errorMessage": "Invalid params",
"classification": "DataFetchingException"
}
}
],
"data": null
}],
"statusCode": 400
}

View File

@ -0,0 +1,15 @@
{
"request":
"{block (hash : \"0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6\") {transactionCount}} ",
"responses": [{
"data" : {
"block" : {
"transactionCount" : 1
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,33 @@
{
"request":
"{block (number : 30) {transactions{hash} timestamp difficulty totalDifficulty gasUsed gasLimit hash nonce ommerCount logsBloom mixHash ommerHash extraData stateRoot receiptsRoot transactionCount transactionsRoot}} ",
"responses": [{
"data" : {
"block" : {
"transactions" : [ {
"hash" : "0x9cc6c7e602c56aa30c554bb691377f8703d778cec8845f4b88c0f72516b304f4"
} ],
"timestamp" : "0x561bc336",
"difficulty" : "0x20740",
"totalDifficulty" : "0x3e6cc0",
"gasUsed" : 23585,
"gasLimit" : 3141592,
"hash" : "0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6",
"nonce" : "0x5c321bd9e9f040f1",
"ommerCount" : 0,
"logsBloom" : "0x00000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000080000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000400000000000000000200000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000800000000040000000000000000000000000000000000000000010000000000000000000000000",
"mixHash" : "0x6ce1c4afb4f85fefd1b0ed966b20cd248f08d9a5b0df773f75c6c2f5cc237b7c",
"ommerHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"extraData" : "0x",
"stateRoot" : "0xdb46d6bb168130fe2cb60b4b24346137b5741f11283e0d7edace65c5f5466b2e",
"receiptsRoot" : "0x88b3b304b058b39791c26fdb94a05cc16ce67cf8f84f7348cb3c60c0ff342d0d",
"transactionCount" : 1,
"transactionsRoot" : "0x5a8d5d966b48e1331ae19eb459eb28882cdc7654e615d37774b79204e875dc01"
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,14 @@
{
"request" : "{block{ account(address: \"0x8888f1f195afa192cfee860698584c030f4c9db1\") { code } }}",
"responses": [{
"data": {
"block": {
"account": {
"code": "0x"
}
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,14 @@
{
"request" : "{block{ account(address: \"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\") { code } }}",
"responses": [{
"data": {
"block": {
"account": {
"code": "0x6000357c010000000000000000000000000000000000000000000000000000000090048063102accc11461012c57806312a7b9141461013a5780631774e6461461014c5780631e26fd331461015d5780631f9030371461016e578063343a875d1461018057806338cc4831146101955780634e7ad367146101bd57806357cb2fc4146101cb57806365538c73146101e057806368895979146101ee57806376bc21d9146102005780639a19a9531461020e5780639dc2c8f51461021f578063a53b1c1e1461022d578063a67808571461023e578063b61c05031461024c578063c2b12a731461025a578063d2282dc51461026b578063e30081a01461027c578063e8beef5b1461028d578063f38b06001461029b578063f5b53e17146102a9578063fd408767146102bb57005b6101346104d6565b60006000f35b61014261039b565b8060005260206000f35b610157600435610326565b60006000f35b6101686004356102c9565b60006000f35b610176610442565b8060005260206000f35b6101886103d3565b8060ff1660005260206000f35b61019d610413565b8073ffffffffffffffffffffffffffffffffffffffff1660005260206000f35b6101c56104c5565b60006000f35b6101d36103b7565b8060000b60005260206000f35b6101e8610454565b60006000f35b6101f6610401565b8060005260206000f35b61020861051f565b60006000f35b6102196004356102e5565b60006000f35b610227610693565b60006000f35b610238600435610342565b60006000f35b610246610484565b60006000f35b610254610493565b60006000f35b61026560043561038d565b60006000f35b610276600435610350565b60006000f35b61028760043561035e565b60006000f35b6102956105b4565b60006000f35b6102a3610547565b60006000f35b6102b16103ef565b8060005260206000f35b6102c3610600565b60006000f35b80600060006101000a81548160ff021916908302179055505b50565b80600060016101000a81548160ff02191690837f01000000000000000000000000000000000000000000000000000000000000009081020402179055505b50565b80600060026101000a81548160ff021916908302179055505b50565b806001600050819055505b50565b806002600050819055505b50565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b50565b806004600050819055505b50565b6000600060009054906101000a900460ff1690506103b4565b90565b6000600060019054906101000a900460000b90506103d0565b90565b6000600060029054906101000a900460ff1690506103ec565b90565b600060016000505490506103fe565b90565b60006002600050549050610410565b90565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061043f565b90565b60006004600050549050610451565b90565b7f65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be5806000602a81526020016000a15b565b6000602a81526020016000a05b565b60017f81933b308056e7e85668661dcd102b1f22795b4431f9cf4625794f381c271c6b6000602a81526020016000a25b565b60016000602a81526020016000a15b565b3373ffffffffffffffffffffffffffffffffffffffff1660017f0e216b62efbb97e751a2ce09f607048751720397ecfb9eef1e48a6644948985b6000602a81526020016000a35b565b3373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a25b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017f317b31292193c2a4f561cc40a95ea0d97a2733f14af6d6d59522473e1f3ae65f6000602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a35b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017fd5f0a30e4be0c6be577a71eceb7464245a796a7e6a55c0d971837b250de05f4e60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff16600160007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a35b56"
}
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,22 @@
{
"request": "{ block(number: 23) { logs( filter: { topics : [[\"0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b\", \"0x65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be580\"]]}) { index topics data account{address} transaction{hash} } } }",
"responses": [{
"data" : {
"block" : {
"logs" : [ {
"index" : 0,
"topics" : [ "0x65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be580" ],
"data" : "0x000000000000000000000000000000000000000000000000000000000000002a",
"account" : {
"address" : "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f"
},
"transaction" : {
"hash" : "0x97a385bf570ced7821c6495b3877ddd2afd5c452f350f0d4876e98d9161389c6"
}
} ]
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,40 @@
{
"request": "{ logs( filter: { fromBlock:20, toBlock: 24, topics : [], addresses : []}) { index topics data account{address} transaction{hash block {number}} } }",
"responses": [{
"data": {
"logs": [
{
"index": 0,
"topics": [
"0x65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be580"
],
"data": "0x000000000000000000000000000000000000000000000000000000000000002a",
"account": {
"address": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f"
},
"transaction": {
"hash": "0x97a385bf570ced7821c6495b3877ddd2afd5c452f350f0d4876e98d9161389c6",
"block": {
"number": 23
}
}
},
{
"index": 0,
"topics": [],
"data": "0x000000000000000000000000000000000000000000000000000000000000002a",
"account": {
"address": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f"
},
"transaction": {
"hash": "0x5ecd942096ab3f70c5bcc8f3a98f88c4ff0a3bd986417df9948eb1819db76d0e",
"block": {
"number": 24
}
}
}
]
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,13 @@
{
"request" :"{ account(address: \"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\") { storage(slot: \"0x00000000000000000000000000000021\") } }",
"responses":[{
"data" : {
"account" : {
"storage" : "0x0000000000000000000000000000000000000000000000000000000000000000"
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,13 @@
{
"request" :"{ account(address: \"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\") { storage(slot: \"0x00000000000000000000000000000004\") } }",
"responses": [{
"data" : {
"account" :{
"storage" :"0xaabbccffffffffffffffffffffffffffffffffffffffffffffffffffffffffee"
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,20 @@
{
"request":
"{ block(hash: \"0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6\") { transactionAt(index: 0) {block{hash} hash } } }",
"responses":[{
"data" : {
"block" : {
"transactionAt" : {
"block" : {
"hash" : "0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6"
},
"hash" : "0x9cc6c7e602c56aa30c554bb691377f8703d778cec8845f4b88c0f72516b304f4"
}
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,20 @@
{
"request":
"{ block(number: 30) { transactionAt(index: 0) {block{hash} hash} } }",
"responses":[{
"data" : {
"block" : {
"transactionAt" : {
"block" : {
"hash" : "0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6"
},
"hash" : "0x9cc6c7e602c56aa30c554bb691377f8703d778cec8845f4b88c0f72516b304f4"
}
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,14 @@
{
"request":
"{ block(number: 30) { transactionAt(index: 1) {block{hash} hash} } }",
"responses":[{
"data" : {
"block" : {
"transactionAt" : null
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,64 @@
{
"request": "{transaction (hash : \"0x9cc6c7e602c56aa30c554bb691377f8703d778cec8845f4b88c0f72516b304f4\") { block{hash} gas gasPrice hash inputData nonce index value from {address} to {address} logs{index} status createdContract{address} } } ",
"responses": [
{
"data": {
"transaction": {
"block": {
"hash": "0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6"
},
"gas": 314159,
"gasPrice": "0x1",
"hash": "0x9cc6c7e602c56aa30c554bb691377f8703d778cec8845f4b88c0f72516b304f4",
"inputData": "0xe8beef5b",
"nonce": 29,
"index": 0,
"value": "0xa",
"from": {
"address": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b"
},
"to": {
"address": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f"
},
"logs": [
{
"index": 0
}
],
"status": null,
"createdContract": null
}
}
},
{
"data": {
"transaction": {
"block": {
"hash": "0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6"
},
"createdContract": null,
"from": {
"address": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b"
},
"gas": "0x4cb2f",
"gasPrice": "0x1",
"hash": "0x9cc6c7e602c56aa30c554bb691377f8703d778cec8845f4b88c0f72516b304f4",
"index": 0,
"inputData": "0xe8beef5b",
"logs": [
{
"index": 0
}
],
"nonce": "0x1d",
"status": 0,
"to": {
"address": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f"
},
"value": "0xa"
}
}
}
],
"statusCode": 200
}

View File

@ -0,0 +1,13 @@
{
"request":
"{transaction (hash : \"0xffc6c7e602c56aa30c554bb691377f8703d778cec8845f4b88c0f72516b304f4\") { block{hash} gas gasPrice hash inputData nonce index value }} ",
"responses": [{
"data" : {
"transaction" : null
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,13 @@
{
"request" :"{ account(address: \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\") { transactionCount } }",
"responses": [{
"data" : {
"account" :{
"transactionCount" : 32
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,27 @@
{
"request": "{ transaction(hash: \"0x812742182a79a8e67733edc58cfa3767aa2d7ad06439d156ddbbb33e3403b4ed\") {block{hash logsBloom} hash createdContract{address} cumulativeGasUsed gas gasUsed logs{topics} from{address} to{address} index } }",
"responses": [{
"data": {
"transaction": {
"block": {
"hash": "0x10aaf14a53caf27552325374429d3558398a36d3682ede6603c2c6511896e9f9",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
"createdContract": {
"address": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f"
},
"cumulativeGasUsed": 493172,
"from": {
"address": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b"
},
"gas": 3141592,
"gasUsed": 493172,
"hash": "0x812742182a79a8e67733edc58cfa3767aa2d7ad06439d156ddbbb33e3403b4ed",
"index": 0,
"logs": [],
"to": null
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,9 @@
{
"request" : "mutation { sendRawTransaction(data: \"0xf901ca3285174876e800830fffff8080b90177608060405234801561001057600080fd5b50610157806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633bdab8bf146100515780639ae97baa14610068575b600080fd5b34801561005d57600080fd5b5061006661007f565b005b34801561007457600080fd5b5061007d6100b9565b005b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60016040518082815260200191505060405180910390a1565b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60026040518082815260200191505060405180910390a17fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60036040518082815260200191505060405180910390a15600a165627a7a7230582010ddaa52e73a98c06dbcd22b234b97206c1d7ed64a7c048e10c2043a3d2309cb00291ca05d71c687073e23402e59853d85c587f6eebc735082f40a450e407451b42ee2a4a07d4f2db1717dc9be745b991962193fa0d5f6059b9c92350dba3efe3a99df6b52\") }",
"responses":[{
"data" : {
"sendRawTransaction" : "0xf9a25e1d6202e9ea1d984f76939e9bb3609bfb9aea2541ae8a629270343fbb2f"
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,27 @@
{
"request":
"{ pending { transactionCount transactions { nonce gas } account(address:\"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\") { balance} estimateGas(data:{}) call (data : {from : \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\", to: \"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\", data :\"0x12a7b914\"}){data status}} }",
"responses": [{
"data": {
"pending": {
"transactionCount": 1,
"transactions": [
{
"nonce": 50,
"gas": 1048575
}
],
"account": {
"balance": "0x140"
},
"estimateGas": 21000,
"call": {
"data": "0x0000000000000000000000000000000000000000000000000000000000000001",
"status": 1
}
}
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,10 @@
{
"request" : "mutation { sendRawTransaction(data: \"0xf8693785174876e800830fffff94450b61224a7df4d8a70f3e20d4fd6a6380b920d180843bdab8bf1ba054b00220864ab58246bbe0a6f6d50166f9bd0ba3f1711912f79c073da6368ca5a04f84bc3231ee4406b8ceb8740d6d8d1900f87b67b9f4a0a38bc55062121a94c6\") }",
"responses":[{
"data" : {
"sendRawTransaction" : "0x6ad12f495251471d1834852623c2eeb2cb04d2fb9e1a5d6cff481cfec7b233a8"
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,26 @@
{
"request": "mutation { sendRawTransaction(data: \"0xf86410018304cb2f946295ee1b4f6dd65047762f924ecd367c17eabf8f0a8457cb2fc41ca0060dc80554e845b572ab6b88dab08f7491f83b4405fea2f067a80b3742127fb0a0246160f01d027a0335be590d443335ecb2cf5d9f9589c8efffa4acbda4acafea\") }",
"responses": [{
"errors": [
{
"message": "Exception while fetching data (/sendRawTransaction) : Nonce too low",
"locations": [
{
"line": 1,
"column": 12
}
],
"path": [
"sendRawTransaction"
],
"extensions": {
"errorCode": -32001,
"errorMessage": "Nonce too low",
"classification": "DataFetchingException"
}
}
],
"data": null
}],
"statusCode": 400
}

View File

@ -0,0 +1,9 @@
{
"request" : "mutation { sendRawTransaction(data: \"0xf86d3785174876e801830222e0945aae326516b4f8fe08074b7e972e40a713048d628829a2241af62c0000801ca077d36666ce36d433b6f1ac62eafe7a232354c83ad2293cfcc2445a86bcd08b4da04b8bd0918d440507ab81d47cf562addaa15a1d28ac701989f5141c8da49615d0\") }",
"responses":[{
"data" : {
"sendRawTransaction" : "0x772b6d5c64b9798865d6dfa35ba44d181abd96a448f8ab7ea9e9631cabb7b290"
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,26 @@
{
"request": "mutation { sendRawTransaction(data: \"0xed0a85174876e800830222e0945aae326516b4f8fe08074b7e972e40a713048d62880de0b6b3a7640000801c8080\") }",
"responses": [{
"errors": [
{
"message": "Exception while fetching data (/sendRawTransaction) : Invalid params",
"locations": [
{
"line": 1,
"column": 12
}
],
"path": [
"sendRawTransaction"
],
"extensions": {
"errorCode": -32602,
"errorMessage": "Invalid params",
"classification": "DataFetchingException"
}
}
],
"data": null
}],
"statusCode": 400
}

View File

@ -0,0 +1,11 @@
{
"request":
"{ syncing {startingBlock currentBlock highestBlock pulledStates knownStates } }",
"responses": [{
"data" : {
"syncing" : null
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,19 @@
{
"request": "{ blocks(from:30) { number } }",
"responses": [{
"data": {
"blocks": [
{
"number": 30
},
{
"number": 31
},
{
"number": 32
}
]
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,40 @@
{
"request":
"{blocks (from : 30, to: 32) { number gasUsed gasLimit hash nonce stateRoot receiptsRoot transactionCount }} ",
"responses":[{
"data" : {
"blocks" : [ {
"number" : 30,
"gasUsed" : 23585,
"gasLimit" : 3141592,
"hash" : "0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6",
"nonce" : "0x5c321bd9e9f040f1",
"stateRoot" : "0xdb46d6bb168130fe2cb60b4b24346137b5741f11283e0d7edace65c5f5466b2e",
"receiptsRoot" : "0x88b3b304b058b39791c26fdb94a05cc16ce67cf8f84f7348cb3c60c0ff342d0d",
"transactionCount" : 1
}, {
"number" : 31,
"gasUsed" : 24303,
"gasLimit" : 3141592,
"hash" : "0x0f765087745aa259d9e5ac39c367c57432a16ed98e3b0d81c5b51d10f301dc49",
"nonce" : "0xd3a27a3001616468",
"stateRoot" : "0xa80997cf804269d64f2479baf535cf8f9090b70fbf515741c6995564f1e678bd",
"receiptsRoot" : "0x2440c44a3f75ad8b0425a73e7be2f61a5171112465cfd14e62e735b56d7178e6",
"transactionCount" : 1
}, {
"number" : 32,
"gasUsed" : 23705,
"gasLimit" : 3141592,
"hash" : "0x71d59849ddd98543bdfbe8548f5eed559b07b8aaf196369f39134500eab68e53",
"nonce" : "0xdb063000b00e8026",
"stateRoot" : "0xf65f3dd13f72f5fa5607a5224691419969b4f4bae7a00a6cdb853f2ca9eeb1be",
"receiptsRoot" : "0xa50a7e67e833f4502524371ee462ccbcc6c6cabd2aeb1555c56150007a53183c",
"transactionCount" : 1
} ]
}
}],
"statusCode": 200
}

View File

@ -0,0 +1,26 @@
{
"request": "{blocks (from : \"0x1e\", to: \"0x1c\") { number gasUsed gasLimit hash nonce stateRoot receiptsRoot transactionCount }} ",
"responses": [{
"errors": [
{
"message": "Exception while fetching data (/blocks) : Invalid params",
"locations": [
{
"line": 1,
"column": 2
}
],
"path": [
"blocks"
],
"extensions": {
"errorCode": -32602,
"errorMessage": "Invalid params",
"classification": "DataFetchingException"
}
}
],
"data": null
}],
"statusCode": 400
}

View File

@ -0,0 +1,14 @@
{
"request": "{ block { transactions { block { transactions { block { number }}}}}}",
"responses": [{
"errors": [
{
"message": "maximum query complexity exceeded 204 > 200",
"extensions": {
"classification": "ExecutionAborted"
}
}
]
}],
"statusCode": 400
}

View File

@ -0,0 +1,14 @@
{
"request": "{ __schema { types { fields { type { fields { name }}}}}}",
"responses": [{
"errors": [
{
"message": "maximum query complexity exceeded 204 > 200",
"extensions": {
"classification": "ExecutionAborted"
}
}
]
}],
"statusCode": 400
}