diff --git a/src/eth/state.yaml b/src/eth/state.yaml index 08929db6b..2868d0b4f 100644 --- a/src/eth/state.yaml +++ b/src/eth/state.yaml @@ -84,3 +84,22 @@ name: Account schema: $ref: '#/components/schemas/AccountProof' +- name: eth_getAccount + summary: Returns the account at given address, or 'null' if the account does not exist in the state. + params: + - name: Address + required: true + schema: + $ref: '#/components/schemas/address' + - name: Block + required: false + schema: + $ref: '#/components/schemas/BlockNumberOrTag' + result: + name: Account + schema: + oneOf: + - $ref: '#/components/schemas/Account' + - name: Null + type: "null" + diff --git a/src/schemas/state.yaml b/src/schemas/state.yaml index e50a968b3..ad0108d37 100644 --- a/src/schemas/state.yaml +++ b/src/schemas/state.yaml @@ -54,3 +54,24 @@ StorageProof: type: array items: $ref: '#/components/schemas/bytes' +Account: + title: Account + type: object + required: + - storageRoot + - balance + - nonce + - codeHash + properties: + storageRoot: + title: storage root + $ref: '#/components/schemas/hash32' + balance: + title: balance + $ref: '#/components/schemas/uint256' + codeHash: + title: codeHash + $ref: '#/components/schemas/hash32' + nonce: + title: nonce + $ref: '#/components/schemas/uint64' diff --git a/tests/eth_getAccount/get-account.io b/tests/eth_getAccount/get-account.io new file mode 100644 index 000000000..ab480f609 --- /dev/null +++ b/tests/eth_getAccount/get-account.io @@ -0,0 +1,6 @@ +>> {"jsonrpc":"2.0","id":9,"method":"eth_getAccount","params":["0x000000000000000000000000000000000000dead","latest"]} +<< {"jsonrpc":"2.0","id":9,"result": null} +>> {"jsonrpc":"2.0","id":10,"method":"eth_getAccount","params":["0xaa00000000000000000000000000000000000000","latest"]} +<< {"jsonrpc":"2.0","id":10,"result": { "codeHash": "0xce92c756baff35fa740c3557c1a971fd24d2d35b7c8e067880d50cd86bb0bc99", "storageRoot": "0x8afc95b7d18a226944b9c2070b6bda1c3a36afcc3730429d47579c94b9fe5850", "balance": "0x1", "nonce": "0x1"}} +>> {"jsonrpc":"2.0","id":11,"method":"eth_getAccount","params":["0xaa00000000000000000000000000000000000000","0xffff"]} +<< {"jsonrpc":"2.0","id":11,"error":{"code":-32000,"message":"header not found"}}