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

feat(claim): add hooks for delegation and vote mission claim #871

Merged
merged 7 commits into from
Jun 15, 2022

Conversation

lumtis
Copy link
Contributor

@lumtis lumtis commented Jun 14, 2022

Implement hooks for staking and gov modules that allow to complete claim mission on the events:

  • Delegating funds for staking
  • Voting on proposal for gov

Set hooks in app.go as a sample implementation.

Security mechanism remains to be designed: locking a specific mission ID for a specific module

Add event on mission completion

To test:

Serve:

ignite chain serve -r

Claim for delegation mission:

spnd tx staking delegate spnvaloper1ezptsm3npn54qx9vvpah4nymre59ykr9mx22g4 1500uspn --from bob -y

Claim for voting proposal:

spnd tx gov submit-proposal cancel-software-upgrade --title foo --description bar --from alice -y
spnd tx gov deposit 1 1uspn --from alice -y
spnd tx gov vote 1 yes --from bob -y

Check balance for drop token:

spnd q bank balances spn1aqn8ynvr3jmq67879qulzrwhchq5dtrvtx0nhe

Check claim records:

spnd q claim list-claim-record

@codecov
Copy link

codecov bot commented Jun 14, 2022

Codecov Report

Merging #871 (8c7a657) into develop (6bbb406) will decrease coverage by 0.02%.
The diff coverage is 3.19%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #871      +/-   ##
===========================================
- Coverage    10.42%   10.39%   -0.03%     
===========================================
  Files          322      325       +3     
  Lines        75407    75688     +281     
===========================================
+ Hits          7862     7869       +7     
- Misses       67356    67630     +274     
  Partials       189      189              
Impacted Files Coverage Δ
x/claim/keeper/mission_delegation_hooks.go 0.00% <0.00%> (ø)
x/claim/keeper/mission_vote_hooks.go 0.00% <0.00%> (ø)
x/claim/types/events.pb.go 1.18% <1.18%> (ø)
x/claim/keeper/mission.go 96.20% <100.00%> (+0.25%) ⬆️
x/campaign/simulation/store.go 82.43% <0.00%> (-0.68%) ⬇️

Pantani
Pantani previously approved these changes Jun 15, 2022
@Pantani
Copy link
Collaborator

Pantani commented Jun 15, 2022

the simulation test is broken

@lumtis
Copy link
Contributor Author

lumtis commented Jun 15, 2022

Yep there was a bug! Not sure why it was only triggered in simulation and not on serve

@Pantani Pantani merged commit 493526b into develop Jun 15, 2022
@Pantani Pantani deleted the feat/hook-claim branch June 15, 2022 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement solution to bridge claim mission with Cosmos-SDK module event
3 participants