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: option to render block as JSON #1740

Merged

Conversation

@cryptocode
Copy link
Collaborator

commented Feb 18, 2019

A new option json_block (bool) is added to create_block and a few other RPCs stringifying blocks.

Default is "false" (the old behavior)

If set to "true", the returned block will be proper JSON instead of being stringified with embedded escapes of newlines and quotes. This makes it easier to move offline-signed blocks for processing via the Qt wallet or websites with process functionality.

(A future PR could make process support non-stringified blocks.)

@cryptocode cryptocode self-assigned this Feb 18, 2019

@cryptocode cryptocode added this to the V19.0 milestone Feb 18, 2019

@cryptocode cryptocode added this to CP0 in V19 Feb 18, 2019

@SergiySW

This comment has been minimized.

Copy link
Collaborator

commented Feb 18, 2019

Could we add same option to other RPCs returning block content?

@cryptocode

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 18, 2019

@SergiySW that sounds like a good idea

@cryptocode cryptocode force-pushed the cryptocode:rpc/create_block-json_block branch from 1fa4c0d to 356026d Feb 18, 2019

@cryptocode cryptocode changed the title Option to render block as JSON in create_block RPC: option to render block as JSON Feb 18, 2019

@cryptocode cryptocode requested a review from SergiySW Feb 21, 2019

@SergiySW

This comment has been minimized.

Copy link
Collaborator

commented Feb 22, 2019

Probably add json check to some tests?

@cryptocode cryptocode merged commit 62914cc into nanocurrency:master Feb 23, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@cryptocode cryptocode deleted the cryptocode:rpc/create_block-json_block branch Feb 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.