-
Notifications
You must be signed in to change notification settings - Fork 115
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/consensus/api: Change Block's Hash field type to common Hash type #4281
Conversation
481aca6
to
7a56ead
Compare
7a56ead
to
26cfca4
Compare
Codecov Report
@@ Coverage Diff @@
## master #4281 +/- ##
==========================================
- Coverage 68.92% 68.75% -0.17%
==========================================
Files 411 411
Lines 47208 47211 +3
==========================================
- Hits 32536 32460 -76
- Misses 10632 10733 +101
+ Partials 4040 4018 -22
Continue to review full report at Codecov.
|
It can use used a stable method for obtaining the hex-encoded representation of a hash in case String() method is changed to something else in the future.
Also change the type of Status' hash-related field (LatestHash, GenesisHash, LastRetainedHash) to the common Hash type (go/common/crypto/hash.Hash) to allow nicer text/JSON serialization.
26cfca4
to
613e1c8
Compare
Also change the type of
Status
' hash-related field (LatestHash
,GenesisHash
,LastRetainedHash
) to the commonHash
type.This will make all hash-related fields in the
"consensus"
part ofoasis-node control status
's output use hex-encoding rather than Base64-encoding.It follows a similar change for textual representation of runtime IDs and runtime state roots which was done in #4279.
The motivation for this change is to unify:
oasis-node control status
's block hash representation with OASIS SCAN's and Oasis Monitor's representations which use the hex-encoding: [1] [2]consensus.tendermint.state_sync.trusted_hash
flag) expects the hex-encoded representation of block's hash.Example of previous
"consensus"
part ofoasis-node control status
:Example of new
"consensus"
part ofoasis-node control status
: