-
Notifications
You must be signed in to change notification settings - Fork 523
Return an error in EncodeSignedTxn() and DecodeSignedTxn() if consensus protocol is unknown.
#2708
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
Return an error in EncodeSignedTxn() and DecodeSignedTxn() if consensus protocol is unknown.
#2708
Conversation
EncodeSignedTxn() and DecodeSignedTxn() if consensus protocol is unknown.
Codecov Report
@@ Coverage Diff @@
## master #2708 +/- ##
==========================================
- Coverage 47.07% 47.05% -0.02%
==========================================
Files 349 349
Lines 55858 55864 +6
==========================================
- Hits 26294 26287 -7
- Misses 26617 26623 +6
- Partials 2947 2954 +7
Continue to review full report at Codecov.
|
node/indexer/indexer_test.go
Outdated
| const genesisID string = "foo" | ||
|
|
||
| var genesisHash crypto.Digest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename these to testGenesisID and testGenesisHash.
The testGenesisHash can be defined here as
var testGenesisHash = crypto.Digest{0x1, 0x2, 0x3..}which is abit cleaner than defining it here and initializing it in init
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
node/topAccountListener_test.go
Outdated
| blk.BlockHeader.GenesisID = "foo" | ||
| blk.BlockHeader.GenesisHash[0] = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why you need to make the GenesisID/GenesisHash.. but there is nothing wrong with these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would generally be better if you were to pick a genesisHash that is really pseudo-random, i.e. crypto.Hash([]byte{1,2,3,4})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GenesisID and GenesisHash must the same in transactions and block header. Why is pseudo-random better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a true random means that the result of the test might be random.. and we don't want that.
filling up only selected bytes doesn't guarantee that the comparison was testing all the bytes.
(i.e. both me and you knows it does.. but we want to ensure we test that )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Done.
tsachiherman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good; one request for renaming global test variable names.
No description provided.