-
Notifications
You must be signed in to change notification settings - Fork 428
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
Improve Contract initialization in genesis and tooling #346
Conversation
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.
Nice start. I like the approach and implementation so far
050b949
to
f014acb
Compare
2cf5bd4
to
d30c41f
Compare
Codecov Report
@@ Coverage Diff @@
## master #346 +/- ##
===========================================
- Coverage 69.64% 57.08% -12.57%
===========================================
Files 28 33 +5
Lines 2425 3421 +996
===========================================
+ Hits 1689 1953 +264
- Misses 618 1318 +700
- Partials 118 150 +32
|
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.
Very nice. I think this is ready to merge. I was just a bit confused by some of the changes to cli/proposal parsing, but the genesis stuff looks solid.
One comment, which could be added later, is to add a file (REAMDE or other) that shows how to add a few items to the genesis file via cli and how to get the contract addresses that would be created. I guess contrib/local/00-genesis.sh
is a good reference, but a bit of test in the README (linking to that example) would make onboarding easier
After #358 |
3a48558
to
bac2339
Compare
Rebased |
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.
Looks good.
I will merge, but please address my comment in a follow-up PR (or let me know it is better how it is). I can now at least do last integration tests
return all | ||
} | ||
|
||
func hasAccountBalance(cmd *cobra.Command, a map[string]json.RawMessage, sender sdk.AccAddress, coins sdk.Coins) (bool, error) { |
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.
variable a
is a bit confusing.
But I would note this check is only required if ! coins.IsEmpty()
. I guess it could make sense that funded only genesis accounts send messages, but if we just want to prevent obvious errors, we can short circuit this is we are not sending any balance, so we let accounts with no balances create contracts as long as they don't interact with funds.
Resolves #326
gen_mgs
field for messages