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

fix: Evidence API does not decode the hash properly #13740

Merged
merged 12 commits into from
Nov 4, 2022
Merged

Conversation

likhita-809
Copy link
Contributor

@likhita-809 likhita-809 commented Nov 3, 2022

Description

Closes: #13444

This PR fixes the x/evidence api query which is not decoding the evidence hash properly because of its type ([]byte). We fix it with the following steps:

  1. Adds a new proto field hash of type string
  2. Make the old evidence_hash field deprecated
  3. Updates query handler

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Merging #13740 (65c1942) into main (a51aa51) will increase coverage by 0.16%.
The diff coverage is 45.45%.

❗ Current head 65c1942 differs from pull request most recent head 85e80fd. Consider uploading reports for the commit 85e80fd to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #13740      +/-   ##
==========================================
+ Coverage   55.87%   56.03%   +0.16%     
==========================================
  Files         656      646      -10     
  Lines       57164    55790    -1374     
==========================================
- Hits        31941    31264     -677     
+ Misses      22643    21984     -659     
+ Partials     2580     2542      -38     
Impacted Files Coverage Δ
x/evidence/keeper/keeper.go 84.88% <ø> (ø)
x/evidence/types/querier.go 0.00% <0.00%> (ø)
x/evidence/keeper/grpc_query.go 47.36% <50.00%> (-1.69%) ⬇️
x/evidence/client/cli/query.go 79.31% <100.00%> (+3.50%) ⬆️
x/staking/simulation/operations.go 74.54% <0.00%> (-1.38%) ⬇️
simapp/state.go
simapp/upgrades.go
simapp/genesis.go
simapp/simd/cmd/genaccounts.go
simapp/simd/cmd/testnet.go
... and 7 more

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good so far!

proto/cosmos/evidence/v1beta1/query.proto Outdated Show resolved Hide resolved
@likhita-809 likhita-809 marked this pull request as ready for review November 3, 2022 16:52
@likhita-809 likhita-809 requested a review from a team as a code owner November 3, 2022 16:52
Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Be sure to add a changelog

x/evidence/keeper/grpc_query.go Outdated Show resolved Hide resolved
Copy link
Contributor

@atheeshp atheeshp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, pending changelog.

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, +1 for the changelog

@julienrbrt julienrbrt added the A:automerge Automatically merge PR once all prerequisites pass. label Nov 4, 2022
@mergify mergify bot merged commit 2bb114a into main Nov 4, 2022
@mergify mergify bot deleted the likhita/evidence-hash branch November 4, 2022 10:08
@julienrbrt julienrbrt mentioned this pull request Nov 4, 2022
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. C:CLI C:x/evidence
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(query/evidence): Evidence CLI query does not accept flags
4 participants