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

Voting connector: Support vote statuses and rewards #32

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

PJColombo
Copy link
Member

@PJColombo PJColombo commented Apr 4, 2022

This PR builds on top of #31. It updates both the Voting connector and subgraph in order to expose the vote status

The vote status can be one of the following:

-Ongoing: The vote hasn't ended.
-Accepted: The vote ended and it's waiting to be executed (pending).
-Rejected: The vote ended and it didn't reach the minimum accepted quorum nor minimum support.
-Executed: The vote was enacted.

It also adds a new functionality to the Vote model that allows you to get all the actions inside the vote script which is a set of codified DAO's app contract calls that are executed once the vote is enacted.

An action has the following fields:

to: The target contract address.
fnData: Data related to the function being called.
-- abi: the ABI function fragment.
-- roles: The ACL roles needed to execute the function.
-- sig: The function signature (e.g. transfer(address,address,uint256)).
-- params: The function parameter values.
-- notice: The function radspec description.
rewards: An array containing all the action rewards. A reward has the following fields:
-- amount: The reward's token amount.
-- receiver: The account that receives the reward.
-- token: The reward's token contract address.
If an action involves a token transfer from the DAO to an account then the rewards field is filled.

Right now, the following are considered to be token transfer actions:

Calls to the Vault/Agent's contract function transfer(address _token, address _to, uint256 _value).
Calls to the Finance's contract function newImmediatePayment(address _token, address _receiver, uint256 _amount, string _reference).

Pending tasks:

  • Update subgraph endpoint uri on the tests files to the new connector subgraph

@codecov
Copy link

codecov bot commented Apr 4, 2022

Codecov Report

Merging #32 (5c40f6d) into master (5f9ab58) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

❗ Current head 5c40f6d differs from pull request most recent head 8cbed96. Consider uploading reports for the commit 8cbed96 to get more accurate results

@@            Coverage Diff            @@
##           master     #32      +/-   ##
=========================================
- Coverage    5.90%   5.88%   -0.03%     
=========================================
  Files          50      50              
  Lines        1405    1411       +6     
  Branches      325     336      +11     
=========================================
  Hits           83      83              
+ Misses       1322    1222     -100     
- Partials        0     106     +106     
Flag Coverage Δ
unittests 5.88% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/connect-core/src/index.ts 0.00% <ø> (ø)
packages/connect-core/src/types.ts 0.00% <ø> (ø)
packages/connect-core/src/utils/app.ts 0.00% <0.00%> (ø)
packages/connect-core/src/utils/abi.ts 0.00% <0.00%> (ø)
packages/connect-core/src/utils/ipfs.ts 0.00% <0.00%> (ø)
packages/connect-core/src/utils/misc.ts 20.83% <0.00%> (ø)
packages/connect-core/src/entities/App.ts 0.00% <0.00%> (ø)
packages/connect-core/src/utils/intent.ts 0.00% <0.00%> (ø)
packages/connect-core/src/utils/kernel.ts 0.00% <0.00%> (ø)
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f9ab58...8cbed96. Read the comment docs.

@PJColombo PJColombo changed the title Voting connector: Support vote statuses Voting connector: Support vote statuses and rewards Apr 4, 2022
@PJColombo PJColombo requested a review from 0xGabi April 4, 2022 21:52
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.

None yet

2 participants