Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: plan should terminate when deleting public plan proposal #161

Closed
4 tasks
jaybxyz opened this issue Oct 12, 2021 · 0 comments · Fixed by #162
Closed
4 tasks

fix: plan should terminate when deleting public plan proposal #161

jaybxyz opened this issue Oct 12, 2021 · 0 comments · Fixed by #162
Assignees
Labels
bug Something isn't working

Comments

@jaybxyz
Copy link
Contributor

jaybxyz commented Oct 12, 2021

Summary of Bug

Current logic in DeletePublicPlanProposal doesn't terminate plan. It should send all remaining coins in the pool to the termination address and mark the plan as terminated.

Tasks

  • Add TerminationPlan logic in DeletePublicPlanProposal
  • Handle an edge case where FarmingPoolAddress and TerminationAddress are equal
  • Add test code to cover this case

References

// DeletePublicPlanProposal delets public plan proposal once the governance proposal is passed.
func (k Keeper) DeletePublicPlanProposal(ctx sdk.Context, proposals []*types.DeleteRequestProposal) error {
for _, p := range proposals {
plan, found := k.GetPlan(ctx, p.GetPlanId())
if !found {
return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "plan %d is not found", p.GetPlanId())
}
k.RemovePlan(ctx, plan)
logger := k.Logger(ctx)
logger.Info("removed public ratio plan", "plan_id", plan.GetId())
}
return nil
}


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@jaybxyz jaybxyz added the bug Something isn't working label Oct 12, 2021
@jaybxyz jaybxyz added this to the Farming F1 v1.0 milestone Oct 12, 2021
@jaybxyz jaybxyz self-assigned this Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant