Skip to content

Commit

Permalink
feat(schema): add eth_getAddressesInBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
perama-v committed Aug 10, 2023
1 parent 9c873c2 commit 3cd2778
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/eth/block.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
- name: eth_getAddressesInBlock
summary: Returns the addresses that appear in the block and the index of each transaction they appear in.
params:
- name: Block
required: true
schema:
$ref: '#/components/schemas/BlockNumberOrTag'
result:
name: Addresses in block
schema:
oneOf:
- $ref: '#/components/schemas/notFound'
- $ref: '#/components/schemas/BlockAddresses'
- name: eth_getBlockByHash
summary: Returns information about a block by hash.
params:
Expand Down
37 changes: 37 additions & 0 deletions src/schemas/address.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
BlockAddresses:
type: object
title: Block addresses
description: Addresses that appear in a single block
required:
- addresses
- blockNumber
additionalProperties: false
properties:
addresses:
title: Block addresses
type: array
$ref: '#/components/schemas/AddressBlockAppearances'
blockNumber:
title: Block number
$ref: '#/components/schemas/uint'
AddressBlockAppearances:
type: object
title: Address appearances in a single block
description: An address that appears in one or more locations in a block
required:
- address
- indices
additionalProperties: false
properties:
address:
title: Address
$ref: '#/components/schemas/address'
indices:
title: Transaction indices
$ref: '#/components/schemas/TransactionIndices'
TransactionIndices:
title: Transaction index list
type: array
description: Indices of transactions an address appears in within a block
items:
$ref: '#/components/schemas/uint64'
2 changes: 2 additions & 0 deletions tests/eth_getAddressesInBlock/get-addresses-in-block.io

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ randao
src
https
forkchoiceupdatedresponsev

0 comments on commit 3cd2778

Please sign in to comment.