Skip to content

Commit

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

* add start back to dockerfile

Co-authored-by: Adam Tucker <[email protected]>
  • Loading branch information
ValarDragon and czarcas7ic authored May 20, 2022
1 parent ba0c337 commit d610ff3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ EXPOSE 26657
EXPOSE 1317

ENTRYPOINT ["osmosisd"]
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 d610ff3

Please sign in to comment.