-
Notifications
You must be signed in to change notification settings - Fork 31
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
chore: check blockhash/txhash length whether it is 64 #699
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tkxkd0159
changed the title
chore: check txhash length whether it is 64
chore: check block/txhash length whether it is 64
Oct 6, 2022
tkxkd0159
changed the title
chore: check block/txhash length whether it is 64
chore: check blockhash/txhash length whether it is 64
Oct 6, 2022
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #699 +/- ##
==========================================
+ Coverage 61.20% 61.37% +0.16%
==========================================
Files 874 874
Lines 98546 98553 +7
==========================================
+ Hits 60316 60483 +167
+ Misses 34659 34454 -205
- Partials 3571 3616 +45
|
zemyblue
reviewed
Oct 7, 2022
zemyblue
reviewed
Oct 7, 2022
zemyblue
approved these changes
Oct 10, 2022
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.
LGTM
4 tasks
Keep the case where txhash is empty to convey more detailed messages to the user.
Unlike gRPC, REST requests often fail. Need to understand the cause later
tkxkd0159
force-pushed
the
fix/LLN1107
branch
from
October 11, 2022 06:25
861d564
to
93583df
Compare
tnasu
reviewed
Oct 11, 2022
tnasu
approved these changes
Oct 12, 2022
5 tasks
3 tasks
96 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Keep the case where txhash is empty to convey more detailed messages to the user.
Description
Since the transaction(or block) hash is 32 bytes and the length is 64 in hex string, then the second input validation of the
req.Hash
is to check whether the length of the requested. In addition, the route was changed fromlbm/base/ostracon/v1/blocks/{hash}
tolbm/base/ostracon/v1/block/{hash}
. Because grpc-gw handler can't distinguish path parameter with same prefix url.The odd thing is that
GetBlockByHash
often fails with aNot Implemented
error when requested as REST. There is no problem with gRPC. There seems to be a bug ingrpc-gw
as it often fails. (currently, the test passed in the latest commit and the test failed in the previous commit, but there is no code change other than the markdown modification)Motivation and context
How has this been tested?
I conducted a unit test for both REST and gRPC
Screenshots (if appropriate):
Checklist:
CHANGELOG.md
client/docs/swagger-ui/swagger.yaml