Skip to content

dot/rpc, dot/types: fix RPC json header digest logs response#819

Merged
edwardmack merged 3 commits intodevelopmentfrom
ed/744-fix-digest_json
May 1, 2020
Merged

dot/rpc, dot/types: fix RPC json header digest logs response#819
edwardmack merged 3 commits intodevelopmentfrom
ed/744-fix-digest_json

Conversation

@edwardmack
Copy link
Copy Markdown
Contributor

@edwardmack edwardmack commented Apr 29, 2020

Changes

  • Fix response for RPC methods contain json header digest logs so that response is now represented as an array of strings of hex values
  • Update digest type IDs to conform to Polkadot Host Protocol Spec table 3.2.

Tests:

go test ./dot/rpc/...
go test ./dot/types/...

Checklist:

  • I have read CONTRIBUTING and CODE_OF_CONDUCT
  • I have provided as much information as possible and necessary
  • I have reviewed my own pull request before requesting a review
  • I have linked any relevant issues in my pull request comments
  • All integration tests and required coverage checks are passing

Issues:

Comment thread dot/rpc/modules/chain.go
Number *big.Int `json:"number"`
StateRoot string `json:"stateRoot"`
ExtrinsicsRoot string `json:"extrinsicsRoot"`
Digest ChainBlockHeaderDigest `json:"digest"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this in the spec? I couldn't find it anywhere

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using this as spec for JSON result: https://github.com/w3f/PSPs/blob/psp-rpc-api/psp-002.md#chain_getHeader

But I see now that I should be treating number as a hex string, so I'll update that.

Copy link
Copy Markdown
Contributor

@thomasmodeneis thomasmodeneis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@edwardmack edwardmack merged commit 774daaf into development May 1, 2020
@edwardmack edwardmack deleted the ed/744-fix-digest_json branch May 1, 2020 19:02
ryanchristo pushed a commit that referenced this pull request Jun 24, 2020
* fix formating of header digest logs

* update digest type values to conform to spec

* header number as hex string in json responses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix json output for digest from RPC calls

4 participants