-
Notifications
You must be signed in to change notification settings - Fork 36
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
WIP: Support Competition Scheme #408
Conversation
src/mappings/Competition/mapping.ts
Outdated
@@ -0,0 +1,87 @@ | |||
import 'allocator/arena'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant
src/mappings/Competition/mapping.ts
Outdated
competitionSuggestion.descriptionHash = event.params._descriptionHash; | ||
let ipfsData = ipfs.cat('/ipfs/' + event.params._descriptionHash.toHex()); | ||
if (ipfsData != null) { | ||
competitionSuggestion.description = ipfsData.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should have title as well( same as normal proposal IPFS data).
I guess we should use the same code as in proposal Entity for that. even just call it to parse the ipfs data to title
and description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jellegerbrandy specification does not include a title property. Are you sure it's part of this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry I missed that, i changed the issue. A "suggestion" has a title, a description, and a URL, all optional, and all stored on IPFS, under "descriptionHash"
@@ -0,0 +1,187 @@ | |||
import 'allocator/arena'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as i'm concerned, what we'd need for a first iteration is to populate the fields
nativeTokenRewardLeft;
reputationChangeLeft;
ethRewardLeft;
externalTokenRewardLeft;
We could also use a marker to recognize if a (winning) suggestion has been redeemed. In the contract, this is done by settings suggestor
to 0
. That is not something we'd like to do like this in the subgraph. Adding a Suggestion.redeemedAt
would be an easy way and add useful data...
ent.ethReward = rewards.shift(); // eth | ||
ent.externalTokenReward = rewards.shift(); // external tokens | ||
ent.periods = BigInt.fromI32(1); // number of periods | ||
store.set('ContributionRewardProposal', ent.id, ent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ContributionReward and ContributionRewardExt are different schemes - are you sure you want to use the same entitites here?
For example, the Ext version has fields like reputationRewardLeft
, where are these going to be stored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, they're essentially the same, and this is the approach we took with the U/GenericScheme.
@@ -0,0 +1 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this empty ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes like the GenericScheme
src/mappings/Competition/mapping.ts
Outdated
competitionSuggestion.save(); | ||
} | ||
} | ||
|
||
export function getSuggestionIPFSData(suggestion: CompetitionSuggestion): CompetitionSuggestion { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the same as getting proposal ipfs data.
why not use the same code base ? https://github.com/daostack/subgraph/blob/master/src/domain/proposal.ts#L56
* Add architecture image of Subgraph (#328) * Add files via upload * Create images * Delete images * Create create * Add files via upload * Delete 190910_DS_SUBGAPH_DIAGRAM_V01-2.jpg * Delete create * Update README.md * Add files via upload * Update README.md * Update README.md * Delete 190910_DS_SUBGAPH_DIAGRAM_V01-2.jpg * Index v33 on rinkeby (#401) * Use migration v34 (#402) * Use migration v34 * Fix * lint * Fix * Deprecate UGenericScheme * Index mainnet and Rinkeby v34 * Fix contracts info generator (#404) * genesis alpha workaround (#405) * WIP: Support Competition Scheme (#408) * Support competition scheme * Fix test (wip) * Competition test get proposal * Add competition redeem * Update mapping.ts * Support descriptionHash * fix * Bump version * fix ipfs test * Fix 407 (#410) * Fix #407 * Fix #409 * lint * Update tests * Update graph node to v0.16.1 (#411) Fix #395 * fix #412 (#414) * fix #412 * Bump version to 36 * Fix 415 (#416) * Index only v16 and v36 * fix * Index v33 * Fix and bump version * Return v19 * Index v32 (#418) * Fix #417 * Bump version * Fix #406 (#413) * Fix #406 * use fixJsonQuotes instead of replace * add package-lock.json * updsate package-lock.json * bump v to 0.0.36-3 * Fix #420 (#421) * Fix #420 * lint * Fix * Add standalone contracts to contractsInfo * Fix contracts info ganache * Fix bug * Fix tests * Fix (#422) * Fix * Bump version * Create nectardao.json (#423) * Create nectardao.json * Delete necdao.json * New nec (#424) * New nec * Create dummydao.json * New necdao (and dummy rinkeby dao) (#426) * Update nectardao.json (#428) * New Nectar (#431) * Fix reptutation typo in Competition (#433) * Index mainnet v31, v32, v33 (#432) * Fix stupid mistake in ContributionRewardExt (#434) * Fix stupid mistake in ContributionRewardExt * Bump version * Support migration v36-2 (rinkeby v36 contracts) (#435) * Support migration v36-2 (rinkeby v36 contracts) * Update docker ganche * Remove mistake mappings entry (#436) * graphnode v0.17.0 (#437) * graphnode v0.17.0 * fix daotoken test * support xdai (#443) * support xdai * update docker migration * fix sanity test * tests * index dxdao ens generic schemes (#444) * Competition suggestion extras (#440) * Add suggestion fields Fix #438 #439 * lint * fix test * bump version * Bump migration version * return migration to original version * sort suggestions * Revert "sort suggestions" This reverts commit 081c950. * Sort Co-authored-by: orenyodfat <orenyodfat@users.noreply.github.com> * Bump version (#445) * Fix #447 (#449) * Fix #447 * Add test * Update Competition.spec.ts * Update Competition.spec.ts * Update Competition.spec.ts * Update Competition.spec.ts * Update Competition.spec.ts * Fix #446 * Fix * Fix * Update Competition.spec.ts * migration v38-2 * Update Competition.spec.ts * lint * Update mappings.json * Create model-ethdenver.json (#451) Co-authored-by: orenyodfat <orenyodfat@users.noreply.github.com> * Competition ties (#453) * Fix competition ties handling * Fix * Fix * Revert "Fix" This reverts commit 5fe0be0. * Fix * Bump version * v37-1 (#454) * v37-1 * v39-2 * Update dummydao.json * migration v39-2 * Ethdenver bounty (#456) * Create ethdenver-bounty.json * Update ethdenver-bounty.json * add signal dao * remove ethdenver rionkeby Co-authored-by: benk10 <ben.kaufman10@gmail.com> * Fix dxdao (#458) * workaround for dxdao * comment * Fix #455 (#457) * Fix #455 * Fix * Fix #459 (#460) * Fix #459 * Bump version * Update Competition.spec.ts * remove bitfwd,ethberlin,ethindia daos (#461) * remove bitfwd,ethberlin,ethidia daos * add jelle dao * spelling * BuffiDAO (#462) * BuffiDAO * sokol support * Update migration * Fix competition issue (#464) * Fix competition issue * bump version * v38-0 (#466) * v37-4 * Update migration * Update mappings.json * Update buffidao.json * Sponsor daos xdai * Fix #455 * Fix competition test * Update Competition.spec.ts * New sponsor daos (#471) * New sponsor daos * version tweak * More new daos * Tweak versions * New daos * Version tweak * Update migration and graph node versions (#472) * Update migration and graph node versions * Update compeition test version * Lint * Patch (#473) * Patch * Update mapping.ts * FIx * Fix test * Fix #468 (#475) Add "totalVotes" and "totalSubmissions" to CompetitionProposal * Fix #468 * Bump version * Adding 1 instead of 0 * Fix test string to number * Fix broken quey * New Ethdenver DAOs (#477) * New Ethdenver DAOs * More daos * Competition indexing (#478) * Fix #476 * Fix #470 * Bump version * Fix * Rename subbmisions -> suggestions * Rename * Rename * New fortmatic (#479) * New fortmatic * Update ethdenver-ethermint.json * Create _protocol.json (#480) Co-authored-by: benk10 <ben.kaufman10@gmail.com> * Sportscasle dao (#481) * add sports castle dao * sportscastle dao * Delete _protocol.json * use try_parameters(... (#482) * use try_parameters(... * Add error field Co-authored-by: benk10 <ben.kaufman10@gmail.com> * Update of _protocol.json (#484) * Create _protocol.json * generic scheme address updated (previous had wrong parameters) Co-authored-by: orenyodfat <orenyodfat@users.noreply.github.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> * Update dorg.json (#474) * Update dorg.json * update to new dao deployment Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: orenyodfat <orenyodfat@users.noreply.github.com> * Create long-dao.json (#485) * init (#487) * Update long-dao.json (#486) * Add dxdao genericscheme ens .eth (#490) * Update of generic scheme on rinkeby by for undescore protocol (#489) * Create _protocol.json * generic scheme address updated (previous had wrong parameters) * new generic scheme with right params hash Co-authored-by: orenyodfat <orenyodfat@users.noreply.github.com> Co-authored-by: benk10 <ben@daostack.io> * Create cryptochicks.json (#488) * Create cryptochicks.json * Create cozdao.json * Create cryptochicks.json * Update utils * Updates * Update mappings * Update tests * Update tests * Fixed crash * More fixes * Fix competition test * Update Competition.spec.ts * Bump version Co-authored-by: pat-daostack <42677601+pat-daostack@users.noreply.github.com> Co-authored-by: orenyodfat <orenyodfat@users.noreply.github.com> Co-authored-by: Cesar Brazon <cesarbrazon10@gmail.com> Co-authored-by: orishim <shimonyori@gmail.com> Co-authored-by: Jordan Ellis <5522128+dOrgJelli@users.noreply.github.com>
No description provided.