-
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
Fix unclaimed redeemers list #210
Conversation
src/domain/proposal.ts
Outdated
@@ -204,6 +205,8 @@ export function updateCRProposal( | |||
setSchemeName(proposal.scheme, 'ContributionReward'); | |||
getProposalIPFSData(proposal); | |||
|
|||
addRedeemableRewardOwner(proposalId, beneficiary); |
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.
why is this needed ?
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.
To make sure the beneficiary is listed as a redeemer
src/domain/reward.ts
Outdated
@@ -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( |
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.
please use ContributionRewardProposal.load
src/domain/reward.ts
Outdated
@@ -81,6 +81,32 @@ export function reputationRedemption(proposalId: Bytes, beneficiary: Address, ti | |||
} | |||
|
|||
function shouldRemoveAccountFromUnclaimed(reward: GPReward): boolean { | |||
let proposal = getProposal(reward.proposal); |
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.
why need this ?
use ContributionRewardProposal.load(pid) and check if its not null.
please add tests to cover this issue. |
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.
please add tests to cover this issue.
@@ -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)) { |
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.
does this cover by any test?
Fix #206