You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no check for duplicate name value when creating private plans. This bug is found during simulation test.
Version
master branch
Steps to Reproduce
Send MsgCreateFixedAmountPlan transaction to the network with the plan name simulation.
Send MsgCreateRatioPlan transaction to the network with the same plan name simulation.
Send PublicPlanProposal to the network with any plan name.
You will encounter an error: duplicate plan name: invalid proposal content
Proposal
ValidateRatioPlans checks duplicate name value; however, we can't use the function for private plans since private plans have two different messages to handle and the function handles total epoch ratio and name checks. Therefore, I suggest to have the function broken down into two different functions; ValidateTotalEpochRatio and ValidateName.
jaybxyz
changed the title
Add check for duplicate name value when creating public plans
Add check for duplicate name value when creating private plans
Sep 8, 2021
jaybxyz
added a commit
to jaybxyz/farming
that referenced
this issue
Sep 8, 2021
* test: add sim_test
* test: add decoder and its unit tests
* test: add randomized genesis params
* test: add params and unit tests
* chore: adding operations
* test: add operations and tests
* fix: lint checks
* fix: nolint check for interBlockCacheOpt
* test: nolint unused code
* lint: last test
* chore: fix broken test and add todo for public plan proposal
* chore: fix param changes, randomize epoch days, add farming fee collector, add workflow
* fix: broken test
* docs: fix backticks location
* chore: add migration tests, sort imports, fix db to newDB, update Makefile
* chore: fix simulation logic, add minter permission to module account, work in progress to solve harvest issue
* feat: adding public plan proposals
* chore: adding simulation for public plan proposals work in progress
* fix: add check for duplicate name value when creating private plans #101
* test: fix broken tests
* chore: remove comments, refactor logic, fixing harvest
* build: update github workflow to split simulation jobs
* chore: add public plans, remove unused test codes and clean up logics
- add request public plan proposal
- update request public plan proposal
- delete request public plan proposal
- comment TODO to improve public plans logic
* chore: debugging export and import simulation
* fix: update simulation logics for f1 spec
* fix: fix test plan dates and expected codes, lint
* fix: lint and validation logic of simulation
* fix: revert test plan and add validation logic for unstake
* chore: remove unused test functions
* fix: apply suggested reviews
* chore: fix lint
Co-authored-by: dongsam <dongsamb@gmail.com>
Summary of Bug
There is no check for duplicate name value when creating private plans. This bug is found during simulation test.
Version
master
branchSteps to Reproduce
simulation
.simulation
.duplicate plan name: invalid proposal content
Proposal
ValidateRatioPlans
checks duplicate name value; however, we can't use the function for private plans since private plans have two different messages to handle and the function handles total epoch ratio and name checks. Therefore, I suggest to have the function broken down into two different functions;ValidateTotalEpochRatio
andValidateName
.farming/x/farming/keeper/proposal_handler.go
Lines 30 to 33 in 72748af
farming/x/farming/types/plan.go
Lines 254 to 291 in 72748af
For Admin Use
The text was updated successfully, but these errors were encountered: