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

go/oasis-node/cmd: Show Genesis document's hash when displaying transactions #3157

Merged
merged 3 commits into from
Jul 31, 2020

Conversation

tjanez
Copy link
Member

@tjanez tjanez commented Jul 31, 2020

Show Genesis document's hash when generating staking transactions with oasis-node stake account gen_* CLI commands, e.g.:

You are about to sign the following transaction:
  Nonce:  1
  Fee:    2000 (gas limit: 1000, gas price: 2)
  Method: staking.AddEscrow
  Body:
    Account: oasis1qpl4axynedmdrrgrg7dpw3yxc4a8crevr5dkuksl
    Amount:  AMBER 208.0
Other info:
  Genesis document's hash: 0b9ddeaa80431ff3718f928e654e4b64cbd3f956d69d64e9c923e30766706a11

You may need to review the transaction on your device if you use a hardware-based signer plugin...

And when showing transactions' pretty prints with the oasis-node consensus show_tx CLI command, e.g.:

Hash: 144bf255028a13ec03c2c19879658a97de44e32adb9750690ac2579a4df81518
Signer: l+cuboPsOeuY1+kYlROrpmKgiiELmXSw9xl0WEg8cWE=
        (signature: e1Zp1ttZRlBYDGBb1hBNx4wWydn7hp/tvYpBbVLUeOP7Fqn/vQm2NL1kWbgVWVbr4QaUAWhnP/MhwfI5DpmGBg==)
Content:
  Nonce:  1
  Fee:    2000 (gas limit: 1000, gas price: 2)
  Method: staking.AddEscrow
  Body:
    Account: oasis1qpl4axynedmdrrgrg7dpw3yxc4a8crevr5dkuksl
    Amount:  DOCS 208.0
Other info:
  Genesis document's hash: 0b9ddeaa80431ff3718f928e654e4b64cbd3f956d69d64e9c923e30766706a11

Closes #2871.

Extract a transaction's body pretty-printing functionality to a separate
method to allow easier extension of the PrettyPrint() method.
If it is provided in the given context under ContextKeyGenesisHash key.
Show Genesis document's hash when generating staking transactions with
'oasis-node stake account gen_*' CLI commands and when showing
transactions' pretty prints with the 'oasis-node consensus show_tx' CLI
command.
@tjanez tjanez added c:consensus/tendermint Category: Tendermint-based consensus c:cli Category: command line interface labels Jul 31, 2020
@codecov
Copy link

codecov bot commented Jul 31, 2020

Codecov Report

Merging #3157 into master will increase coverage by 0.33%.
The diff coverage is 81.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3157      +/-   ##
==========================================
+ Coverage   68.75%   69.08%   +0.33%     
==========================================
  Files         383      383              
  Lines       37412    37445      +33     
==========================================
+ Hits        25721    25869     +148     
+ Misses       8414     8315      -99     
+ Partials     3277     3261      -16     
Impacted Files Coverage Δ
go/consensus/api/api.go 38.09% <ø> (ø)
go/consensus/api/base.go 2.77% <0.00%> (-0.08%) ⬇️
go/consensus/api/grpc.go 68.42% <71.42%> (+0.12%) ⬆️
go/consensus/api/transaction/transaction.go 56.12% <78.94%> (+2.35%) ⬆️
go/consensus/tendermint/full/light.go 63.15% <100.00%> (+2.04%) ⬆️
go/consensus/tests/tester.go 97.97% <100.00%> (+0.17%) ⬆️
go/oasis-node/cmd/consensus/consensus.go 49.46% <100.00%> (+0.54%) ⬆️
go/oasis-node/cmd/stake/account.go 60.19% <100.00%> (+0.19%) ⬆️
go/runtime/host/sandbox/sandbox.go 67.28% <0.00%> (-10.04%) ⬇️
go/consensus/tendermint/api/api.go 80.64% <0.00%> (-8.61%) ⬇️
... and 43 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5086eea...71e3a8e. Read the comment docs.

@tjanez tjanez merged commit 35b95b8 into master Jul 31, 2020
@tjanez tjanez deleted the tjanez/display-genesis-hash branch July 31, 2020 15:02
@tjanez tjanez linked an issue Aug 3, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:cli Category: command line interface c:consensus/tendermint Category: Tendermint-based consensus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display Genesis document's hash when creating transactions with the CLI
2 participants