Skip to content

Commit

Permalink
fix: NoOpMsg for disabled pair
Browse files Browse the repository at this point in the history
  • Loading branch information
poorphd committed Jul 9, 2024
1 parent 447a4d7 commit fe7b5b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions x/erc20/simulation/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ func SimulateMsgConvertCoin(k keeper.Keeper, ak types.AccountKeeper, bk types.Ba

// randomly pick one pair
pair := pairs[r.Intn(len(pairs))]
if !pair.Enabled {
return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgConvertCoin, "token pair is not enabled"), nil, nil
}
baseDenom := pair.GetDenom()

// select random account that has coins baseDenom
Expand Down Expand Up @@ -142,6 +145,9 @@ func SimulateMsgConvertErc20(k keeper.Keeper, ak types.AccountKeeper, bk types.B

// randomly pick one pair
pair := pairs[r.Intn(len(pairs))]
if !pair.Enabled {
return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgConvertCoin, "token pair is not enabled"), nil, nil
}

erc20ABI := contracts.ERC20MinterBurnerDecimalsContract.ABI
deployer := types.ModuleAddress
Expand Down

0 comments on commit fe7b5b8

Please sign in to comment.