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 unclaimed redeemers list #210

Merged
merged 7 commits into from
May 1, 2019
Merged

Fix unclaimed redeemers list #210

merged 7 commits into from
May 1, 2019

Conversation

ben-kaufman
Copy link
Contributor

Fix #206

@@ -204,6 +205,8 @@ export function updateCRProposal(
setSchemeName(proposal.scheme, 'ContributionReward');
getProposalIPFSData(proposal);

addRedeemableRewardOwner(proposalId, beneficiary);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make sure the beneficiary is listed as a redeemer

@@ -81,6 +81,32 @@ export function reputationRedemption(proposalId: Bytes, beneficiary: Address, ti
}

function shouldRemoveAccountFromUnclaimed(reward: GPReward): boolean {
let proposal = getProposal(reward.proposal);
if (proposal.contributionReward !== null) {
let crProposal = store.get(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use ContributionRewardProposal.load

@@ -81,6 +81,32 @@ export function reputationRedemption(proposalId: Bytes, beneficiary: Address, ti
}

function shouldRemoveAccountFromUnclaimed(reward: GPReward): boolean {
let proposal = getProposal(reward.proposal);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why need this ?
use ContributionRewardProposal.load(pid) and check if its not null.

@orenyodfat
Copy link
Contributor

please add tests to cover this issue.

Copy link
Contributor

@orenyodfat orenyodfat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add tests to cover this issue.

@ben-kaufman ben-kaufman requested a review from orenyodfat May 1, 2019 09:53
@@ -81,6 +81,28 @@ export function reputationRedemption(proposalId: Bytes, beneficiary: Address, ti
}

function shouldRemoveAccountFromUnclaimed(reward: GPReward): boolean {
let proposal = ContributionRewardProposal.load(reward.proposal);
if (proposal !== null) {
if (equalsBytes(proposal.beneficiary, reward.beneficiary)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this cover by any test?

@ben-kaufman ben-kaufman merged commit da53888 into master May 1, 2019
@ben-kaufman ben-kaufman deleted the unclaimed-cr-rewards branch May 1, 2019 13:21
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.

accountsWithUnclaimedRewards removes addresses also when rewards are still unclaimed
2 participants