-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
R4R: Additional gentx verfication #2971
Conversation
CLI Tests failing are the result of this change. Still more work there and we should likely add tests for this functionality as well. |
Codecov Report
@@ Coverage Diff @@
## develop #2971 +/- ##
==========================================
- Coverage 55.72% 55.53% -0.2%
==========================================
Files 120 120
Lines 8468 8494 +26
==========================================
- Hits 4719 4717 -2
- Misses 3427 3455 +28
Partials 322 322 |
Ok so I have these tests passing locally with no problem, but the new functionality I added here (validation that the account you are |
The CLI tests also fail for me locally @jackzampolin, with the same error as on CI. I wonder if you have a different |
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.
Left some minor feedback. Most importantly I think @cwgoes comments should be addressed and then it could be ready for merge.
Co-Authored-By: jackzampolin <[email protected]>
Co-Authored-By: jackzampolin <[email protected]>
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 few more tidbits ☕️
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.
CI passes and changes look reasonable. Thanks @jackzampolin. This should warrant another review or two though.
cmd/gaia/init/gentx.go
Outdated
bondDenom := genesisState.StakeData.Params.BondDenom | ||
|
||
// Check if the account is in genesis | ||
for _, acc := range genesisState.Accounts { |
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.
The contents of this for loop should probably be broken out into a seperate function, or this whole containing function restructured to reduce indentation
cmd/gaia/init/gentx.go
Outdated
return err | ||
} | ||
|
||
inGenesis := false |
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.
use of inGenesis
is confusing - I don't intuitively know what this parameter is doing
cmd/gaia/init/gentx.go
Outdated
} | ||
|
||
if !inGenesis { | ||
return fmt.Errorf( |
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.
We can eliminate use of inGenesis
by just moving this error into the above loop (which should also probably get moved to it's own funcion per my previous comment)
Ok I've addressed all the PR comments and this should be good to go! |
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.
All previous comments were addressed, nothing to add from me. Furthermore, integration tests execution went down to 1m30s!!
* Add check that account is in genesis and contains enough funds to gentx command * Fix CLI tests and make them parallel * Update makefile to take advantage of parallel tests * Add path seperator back in * Don 't check error on key delete * Add debuggin printout for debugging remote test failures * Update cmd/gaia/init/gentx.go Co-Authored-By: jackzampolin <[email protected]> * Update cmd/gaia/init/gentx.go Co-Authored-By: jackzampolin <[email protected]> * Change to bondDenom from the stake section in genesis * Add PENDING.md * Push changes * Fix CI failure * Address PR comments * Fix broken gov tests * Address PR comments * Address PR comments
Per @zmanian
This PR checks that when running
gaiad gentx
that the--from
account:stakeTypes.DefaultBondDenom
to stake themShould it additionally check that the denomination of the funds is the correct type?
Are there any additional checks we should add here?
cc @alexanderbez @cwgoes @alessio
docs/
)PENDING.md
with issue #Files changed
in the github PR explorerFor Admin Use: