-
Notifications
You must be signed in to change notification settings - Fork 23
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
chore: upgrade token distribution #103
Conversation
…ure it rebuilds and do not use the cached one
|
||
amount := sdk.NewCoin(appparams.BaseCoinUnit, sdkmath.NewInt(td.Amount)) | ||
if err := bankK.SendCoins(ctx, sender, receiver, sdk.NewCoins(amount)); err != nil { | ||
return err |
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.
Just few quesation for better understanding:
- what happens if this returns and error ? does upgrade stop ?
- I imagine
bankK.SendCoins
does all necessary validation if sender have enough coins etc?
I am just thinking of the scenario if by mistake we have some invalid account as sender and what will happen then. I imagine upgrade will happen on chain which is priavate yet and it will fails, so we will be able easily to re-do it.
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.
yes, if it fails it is going to panic and stop the upgrade
The upgrade is called during PreBlocker
I expect that the context is handled with commit and rollback in case of failures, but in our case, since it is all private we will be able to run it again
…upgrade-token-distribution
type PreUpgradeFunc func([]*chain.Config)