Skip to content

Commit

Permalink
fix masterchef external incentive add
Browse files Browse the repository at this point in the history
  • Loading branch information
jelysn committed Jun 18, 2024
1 parent 8de3a89 commit 105ff81
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions x/masterchef/keeper/external_incentive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ func TestExternalIncentive(t *testing.T) {
Apr: sdk.ZeroDec(),
},
}
require.Equal(t, app.MasterchefKeeper.GetExternalIncentiveIndex(ctx), uint64(0))
for _, externalIncentive := range externalIncentives {
app.MasterchefKeeper.SetExternalIncentive(ctx, externalIncentive)
}
require.Equal(t, app.MasterchefKeeper.GetExternalIncentiveIndex(ctx), uint64(3))
for _, externalIncentive := range externalIncentives {
info, found := app.MasterchefKeeper.GetExternalIncentive(ctx, externalIncentive.Id)
require.True(t, found)
Expand Down
1 change: 1 addition & 0 deletions x/masterchef/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func (k msgServer) AddExternalIncentive(goCtx context.Context, msg *types.MsgAdd
Apr: math.LegacyZeroDec(),
}
k.Keeper.SetExternalIncentive(ctx, externalIncentive)
k.SetExternalIncentiveIndex(ctx, externalIncentive.Id+1)

ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
Expand Down

0 comments on commit 105ff81

Please sign in to comment.