Skip to content

Conversation

@odeke-em
Copy link
Contributor

The code in NewDecodeStore decoded the wrong proposal due
to a typographical error, but the tests used the exact same
value for the key value pairs hence the typo could never be caught.
I noticed it during an audit of the code, and I've fixed the
tests to pass in varying values for the various key value pairs.

Fixes #8570


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

… tests

The code in NewDecodeStore decoded the wrong proposal due
to a typographical error, but the tests used the exact same
value for the key value pairs hence the typo could never be caught.
I noticed it during an audit of the code, and I've fixed the
tests to pass in varying values for the various key value pairs.

Fixes #8570
Copy link
Contributor

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Feb 17, 2021

Codecov Report

Merging #8603 (0cea394) into master (f970056) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8603   +/-   ##
=======================================
  Coverage   61.47%   61.47%           
=======================================
  Files         658      658           
  Lines       37588    37588           
=======================================
  Hits        23109    23109           
  Misses      12067    12067           
  Partials     2412     2412           
Impacted Files Coverage Δ
x/gov/simulation/decoder.go 85.71% <100.00%> (ø)

@odeke-em
Copy link
Contributor Author

Thanks for the review @marbar3778 and @alessio!

@odeke-em odeke-em merged commit d56de85 into master Feb 17, 2021
@odeke-em odeke-em deleted the x-simulation-fix-wrong-ProposalDecode+tests branch February 17, 2021 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

x/gov/simulation: NewDecodeStore unmarshals wrong proposal due to typo in value source

4 participants