Skip to content
This repository was archived by the owner on Mar 23, 2020. It is now read-only.
This repository was archived by the owner on Mar 23, 2020. It is now read-only.

piston outputs invalid json #85

@sneak

Description

@sneak

The docs suggest the following:

sneak@pris:~$ pip3 install steem-piston
Collecting steem-piston
....usw....

Installed fine. Testing, per the docs:

piston -x transfer --account xeroc fabian 0.001 SBD > unsigned-transaction.json

This outputs the following to unsigned-transaction.json:

{'blockchain': {'chain_id': '0000000000000000000000000000000000000000000000000000000000000000',
                'core_symbol': 'STEEM',
                'prefix': 'STM'},
 'expiration': '2017-02-06T06:37:38',
 'extensions': [],
 'missing_signatures': ['STM6quoHiVnmiDEXyz4fAsrNd28G6q7qBCitWbZGo4pTfQn8SwkzD'],
 'operations': [['transfer',
                 {'amount': '0.001 SBD',
                  'from': 'xeroc',
                  'memo': '',
                  'to': 'fabian'}]],
 'ref_block_num': 14098,
 'ref_block_prefix': 3767381196,
 'required_authorities': {'xeroc': {'account_auths': [],
                                    'key_auths': [['STM6quoHiVnmiDEXyz4fAsrNd28G6q7qBCitWbZGo4pTfQn8SwkzD',
                                                   1]],
                                    'weight_threshold': 1}},
 'signatures': []}

Then, trying to parse:

sneak@pris:~$ jq . unsigned-transaction.json 
parse error: Invalid numeric literal at line 1, column 14

Turns out, json requires double quotes. Single-quoted keys and strings are invalid json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions