-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat(hub-genesis): added a query to generate genesis bridge data #609
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.
LGTM
small comment
// PrepareGenesisBridgeData prepares the genesis bridge data. | ||
// Bridge data contains the genesis transfer packet data if the genesis accounts are defined, otherwise it's nil. | ||
// Additionally, the method returns the packet coin (if any) that will be used for the escrow. | ||
func (k Keeper) PrepareGenesisBridgeData(ctx sdk.Context) (types.GenesisBridgeData, sdk.Coin, 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.
why u need to return packetCoin
? it can be extracted from data.GenesisTransfer
if needed by caller
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.
good point, removed it. did a separate method:
// BaseCoinSupply returns the total supply of the base denom: the sum of all the genesis account amounts.
func (g GenesisInfo) BaseCoinSupply() sdk.Coin {
amount := sdk.ZeroInt()
for _, acc := range g.GenesisAccounts {
amount = amount.Add(acc.Amount)
}
return sdk.NewCoin(g.BaseDenom(), amount)
}
Description
Closes #XXX
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.
PR review checkboxes:
I have...
Unreleased
section inCHANGELOG.md
godoc
commentsSDK Checklist
map
time.Now()
sendCoin
and notSendCoins
Full security checklist here
For Reviewer:
After reviewer approval: