diff --git a/x/collection/genesis.go b/x/collection/genesis.go index ac08c34fe0..028101b3f7 100644 --- a/x/collection/genesis.go +++ b/x/collection/genesis.go @@ -64,8 +64,11 @@ func ValidateGenesis(data GenesisState) error { if len(contractNextTokenIDs.TokenIds) == 0 { return sdkerrors.ErrInvalidRequest.Wrap("next token ids cannot be empty") } - for _, nextTokenIDs := range contractNextTokenIDs.TokenIds { - if err := ValidateClassID(nextTokenIDs.ClassId); err != nil { + for _, nextTokenID := range contractNextTokenIDs.TokenIds { + if nextTokenID.Id.IsZero() { + return sdkerrors.ErrInvalidRequest.Wrap("nextTokenID.Id is not supposed to be zero") + } + if err := ValidateClassID(nextTokenID.ClassId); err != nil { return err } } diff --git a/x/collection/keeper/genesis.go b/x/collection/keeper/genesis.go index 0b786c78e6..01330383cc 100644 --- a/x/collection/keeper/genesis.go +++ b/x/collection/keeper/genesis.go @@ -97,9 +97,6 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data *collection.GenesisState) { contractID := contractNextTokenIDs.ContractId for _, nextTokenID := range contractNextTokenIDs.TokenIds { - if nextTokenID.Id.IsZero() { - panic("nextTokenID.Id is not supposed to be zero") - } k.setNextTokenID(ctx, contractID, nextTokenID.ClassId, nextTokenID.Id) }