[RPC-Spec-V2] chainHead: use integer for block index and adjust RuntimeVersion 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.
Showing
- substrate/client/rpc-spec-v2/Cargo.toml 0 additions, 1 deletionsubstrate/client/rpc-spec-v2/Cargo.toml
- substrate/client/rpc-spec-v2/src/chain_head/chain_head_follow.rs 2 additions, 2 deletions...te/client/rpc-spec-v2/src/chain_head/chain_head_follow.rs
- substrate/client/rpc-spec-v2/src/chain_head/error.rs 0 additions, 1 deletionsubstrate/client/rpc-spec-v2/src/chain_head/error.rs
- substrate/client/rpc-spec-v2/src/chain_head/event.rs 46 additions, 8 deletionssubstrate/client/rpc-spec-v2/src/chain_head/event.rs
- substrate/client/rpc-spec-v2/src/chain_head/tests.rs 5 additions, 4 deletionssubstrate/client/rpc-spec-v2/src/chain_head/tests.rs
- substrate/client/rpc-spec-v2/src/transaction/event.rs 3 additions, 21 deletionssubstrate/client/rpc-spec-v2/src/transaction/event.rs
Please register or sign in to comment