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

[RPC-Spec-V2] chainHead: Use integer for block index instead of string #1507

Closed
Tracked by #1516
lexnv opened this issue Sep 12, 2023 · 0 comments · Fixed by #1666
Closed
Tracked by #1516

[RPC-Spec-V2] chainHead: Use integer for block index instead of string #1507

lexnv opened this issue Sep 12, 2023 · 0 comments · Fixed by #1666
Assignees
Labels
I5-enhancement An additional feature request.

Comments

@lexnv
Copy link
Contributor

lexnv commented Sep 12, 2023

Ensure that chainHead emitted events contain the block index as integer:

  • bestChainBlockIncluded
  • finalized

Extracted from the spec:

@paritytech/subxt-team

@lexnv lexnv added the I5-enhancement An additional feature request. label Sep 12, 2023
@tadeohepperle tadeohepperle self-assigned this Sep 21, 2023
tadeohepperle added a commit that referenced this issue Sep 29, 2023
…meVersion JSON format (#1666)

This PR adjusts the serialized format of the the returned RuntimeVersion
in the rpc-spec-v2 methods. This is done to match the format defined
here:
https://paritytech.github.io/json-rpc-interface-spec/api/chainHead_unstable_follow.html#about-the-runtime

- ##### `apis` field as object
`apis` field of `RuntimeVersion` is now returned as an object, e.g. 
```
"apis": {
      "0xdf6acb689907609b": 3,
      "0x37e397fc7c91f5e4": 1,
}
```
instead of 
```
"apis": [
      ["0xdf6acb689907609b", 3],
      ["0x37e397fc7c91f5e4", 1],
]
```
- ##### removed `stateVersion` and `authoringVersion`
`stateVersion` and `authoringVersion` are no longer returned in the
`RuntimeVersion` JSON Object.

- ##### block index in chain head events as integer

### Related Issues

Closes: #1507
Closes: #1146

### Testing Done
Adjusted existing tests to make sure data is returned in the correct
format.
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this issue Mar 25, 2024
…meVersion JSON format (paritytech#1666)

This PR adjusts the serialized format of the the returned RuntimeVersion
in the rpc-spec-v2 methods. This is done to match the format defined
here:
https://paritytech.github.io/json-rpc-interface-spec/api/chainHead_unstable_follow.html#about-the-runtime

- ##### `apis` field as object
`apis` field of `RuntimeVersion` is now returned as an object, e.g. 
```
"apis": {
      "0xdf6acb689907609b": 3,
      "0x37e397fc7c91f5e4": 1,
}
```
instead of 
```
"apis": [
      ["0xdf6acb689907609b", 3],
      ["0x37e397fc7c91f5e4", 1],
]
```
- ##### removed `stateVersion` and `authoringVersion`
`stateVersion` and `authoringVersion` are no longer returned in the
`RuntimeVersion` JSON Object.

- ##### block index in chain head events as integer

### Related Issues

Closes: paritytech#1507
Closes: paritytech#1146

### Testing Done
Adjusted existing tests to make sure data is returned in the correct
format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request.
Projects
None yet
2 participants