Skip to content

Commit

Permalink
re-add max commision rate check
Browse files Browse the repository at this point in the history
  • Loading branch information
danflo27 committed Nov 21, 2024
1 parent 7ae7bb5 commit a662ce8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x/reporter/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ func (k msgServer) CreateReporter(goCtx context.Context, msg *types.MsgCreateRep
return nil, errors.New("address already exists")
}

// if msg.CommissionRate.GT(math.NewUint(1e6)) {
// return nil, errors.New("commission rate must be below 1000000 as that is a 100 percent commission rate")
// }
if msg.CommissionRate.GT(math.LegacyNewDec(100)) {
return nil, errors.New("commission rate must be LTE 100 as that is a 100 percent commission rate")
}
// set the reporter and set the self selector
if err := k.Keeper.Reporters.Set(goCtx, addr.Bytes(), types.NewReporter(msg.CommissionRate, msg.MinTokensRequired)); err != nil {
return nil, err
Expand Down

0 comments on commit a662ce8

Please sign in to comment.