Skip to content

Commit

Permalink
Make token factory handle empty genesis configurations better (backport
Browse files Browse the repository at this point in the history
#1551) (#1553)

* Make token factory handle empty genesis configurations better (#1551)

* Make token factory handle empty genesis configurations better

* add start back to dockerfile

Co-authored-by: Adam Tucker <adamleetucker@outlook.com>
(cherry picked from commit d610ff3)

# Conflicts:
#	Dockerfile

* Update Dockerfile

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
Co-authored-by: Adam Tucker <adamleetucker@outlook.com>
  • Loading branch information
3 people authored May 20, 2022
1 parent 8f27627 commit 46cc167
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ EXPOSE 26657
EXPOSE 1317

ENTRYPOINT ["osmosisd"]
CMD [ "start" ]
CMD [ "start" ]
3 changes: 3 additions & 0 deletions x/tokenfactory/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (
func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) {
k.CreateModuleAccount(ctx)

if genState.Params.DenomCreationFee == nil {
genState.Params.DenomCreationFee = sdk.NewCoins()
}
k.SetParams(ctx, genState.Params)

for _, genDenom := range genState.GetFactoryDenoms() {
Expand Down
6 changes: 4 additions & 2 deletions x/tokenfactory/keeper/createdenom.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ func (k Keeper) CreateDenom(ctx sdk.Context, creatorAddr string, denomNonce stri
if err != nil {
return "", err
}
if err := k.distrKeeper.FundCommunityPool(ctx, creationFee, accAddr); err != nil {
return "", err
if len(creationFee) > 0 {
if err := k.distrKeeper.FundCommunityPool(ctx, creationFee, accAddr); err != nil {
return "", err
}
}

denom, err := types.GetTokenDenom(creatorAddr, denomNonce)
Expand Down

0 comments on commit 46cc167

Please sign in to comment.