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 int overflow error for rand.Intn #5385

Merged
merged 7 commits into from
Dec 12, 2019

Conversation

noandrea
Copy link
Contributor

Closes: #5221

Description

uses instead rand.Int63n that works with
required input 1e12


For contributor use:

  • 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

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

uses instead rand.Int63n that works with
required input 1e12

ref github.com/cosmos/issues/5221
@codecov
Copy link

codecov bot commented Dec 10, 2019

Codecov Report

Merging #5385 into master will increase coverage by 0.27%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master    #5385      +/-   ##
==========================================
+ Coverage   54.51%   54.79%   +0.27%     
==========================================
  Files         311      307       -4     
  Lines       18740    18296     -444     
==========================================
- Hits        10217    10026     -191     
+ Misses       7743     7494     -249     
+ Partials      780      776       -4

Copy link
Collaborator

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

Copy link
Contributor

@alessio alessio left a comment

Choose a reason for hiding this comment

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

ACK from me.

Grazie Andrea!

@alexanderbez alexanderbez merged commit d58bf90 into cosmos:master Dec 12, 2019
xiangjianmeng pushed a commit to xiangjianmeng/cosmos-sdk that referenced this pull request Dec 18, 2019
@aaronc aaronc mentioned this pull request Jul 6, 2020
27 tasks
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
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.

simapp/state.go:81:52: constant 1000000000000 overflows int
4 participants