Skip to content

Commit

Permalink
fix: create basket simulation (#1505)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
  • Loading branch information
aleem1314 and ryanchristo authored Oct 5, 2022
1 parent cae3e43 commit 887b825
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion x/ecocredit/basket/simulation/msg_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func SimulateMsgCreate(ak ecocredit.AccountKeeper, bk ecocredit.BankKeeper,
}

if result != nil {
return simtypes.NoOpMsg(ecocredit.ModuleName, TypeMsgCreate, fmt.Sprintf("basket with name %s already exists", basketName)), nil, nil
return simtypes.NoOpMsg(ecocredit.ModuleName, TypeMsgCreate, fmt.Sprintf("basket with denom %s already exists", denom)), nil, nil
}

dateCriteria := randomDateCriteria(r, sdkCtx)
Expand Down Expand Up @@ -122,6 +122,10 @@ func SimulateMsgCreate(ak ecocredit.AccountKeeper, bk ecocredit.BankKeeper,
return simtypes.NoOpMsg(ecocredit.ModuleName, TypeMsgCreate, err.Error()), nil, nil
}

if strings.Contains(err.Error(), fmt.Sprintf("basket with name %s already exists", basketName)) {
return simtypes.NoOpMsg(ecocredit.ModuleName, TypeMsgCreate, err.Error()), nil, nil
}

if strings.Contains(err.Error(), "insufficient funds") {
return simtypes.NoOpMsg(ecocredit.ModuleName, TypeMsgCreate, err.Error()), nil, nil
}
Expand Down

0 comments on commit 887b825

Please sign in to comment.