diff --git a/rpc-specs-tests/schemas/eth_getStorageAt.json b/rpc-specs-tests/schemas/eth_getStorageAt.json new file mode 100644 index 0000000..95ae31b --- /dev/null +++ b/rpc-specs-tests/schemas/eth_getStorageAt.json @@ -0,0 +1,64 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "eth_getStorageAt", + "title": "eth_getStorageAt", + "description": "eth_getStorageAt JSON-RPC method request and response schema.", + + "request": { + "id": "#request", + "allOf": [ + { "$ref": "jsonrpc-request.json" }, + { "$ref": "#/definitions/request-obj" } + ], + "definitions": { + "request-obj": { + "id": "#request-obj", + "properties": { + "method": { + "type": "string", + "enum": ["eth_getStorageAt"] + }, + "params": { + "type": "array", + "items": [ + { + "type": "string", + "description": "DATA, 32 Bytes - Hash of a block." + }, + { + "type": "string", + "description": "QUANTITY- Integer position in the storage." + }, + { + "type": "string", + "description": "QUANTITY|TAG - integer block number, or the string \"latest\", \"earliest\" or \"pending\"" + } + ], + "minItems": 3, + "maxItems": 3 + } + } + } + } + }, + + + "response": { + "id": "#response", + "allOf": [ + { "$ref": "jsonrpc-response.json" }, + { "$ref": "#/definitions/response-obj" } + ], + "definitions": { + "response-obj": { + "id": "#response-obj", + "properties": { + "result": { + "type": "string" + } + } + } + } + } + +} diff --git a/rpc-specs-tests/tests/eth_getStorageAt.json b/rpc-specs-tests/tests/eth_getStorageAt.json new file mode 100644 index 0000000..6e7daad --- /dev/null +++ b/rpc-specs-tests/tests/eth_getStorageAt.json @@ -0,0 +1,45 @@ +{ + "title" : "eth_getStorageAt", + "schema": { + "$ref": "../schemas/eth_getStorageAt.json" + }, + + "chainConfig" : { + "$ref": "../configs/bcRPC_API_Test.json" + }, + + "tests": [ + { + "title": "eth_getStorageAt latest block with non-zero storage key", + "request" : { + "method" : "eth_getStorageAt", + "params" : ["0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", "0x01", "latest"] + }, + "expectedResponse" : { + "result": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee" + }, + "asserts": [ + { + "description": "response has blockHeader hash", + "program": ".receivedResponse.result != null" + } + ] + }, + { + "title": "eth_getStorageAt earliest block with zero storage key", + "request" : { + "method" : "eth_getStorageAt", + "params" : ["0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", "0x01", "earliest"] + }, + "expectedResponse" : { + "result": "0000000000000000000000000000000000000000000000000000000000000000" + }, + "asserts": [ + { + "description": "response has blockHeader hash", + "program": ".receivedResponse.result != null" + } + ] + } + ] +}