Skip to content

Commit

Permalink
Fix #455 (#457)
Browse files Browse the repository at this point in the history
* Fix #455

* Fix
  • Loading branch information
ben-kaufman authored Jan 29, 2020
1 parent 901d947 commit 07727d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/domain/proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export function setProposalState(proposal: Proposal, state: number, gpTimes: Big
if (dao != null) {
dao.numberOfExpiredInQueueProposals = dao.numberOfExpiredInQueueProposals.plus(BigInt.fromI32(1));
}
proposal.accountsWithUnclaimedRewards = new Array<Bytes>();
} else if (state === 2) {
// Executed
proposal.stage = 'Executed';
Expand Down
5 changes: 5 additions & 0 deletions src/domain/reward.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ export function insertGPRewards(
state: number,
): void {
let proposal = getProposal(proposalId.toHex());
if (equalStrings(proposal.stage, 'ExpiredInQueue')) {
proposal.accountsWithUnclaimedRewards = new Array<Bytes>();
proposal.save();
return;
}
let genesisProtocol = GenesisProtocol.bind(gpAddress);
let i = 0;
let gpRewards: string[] = getGPRewardsHelper(proposalId.toHex()).gpRewards as string[];
Expand Down

0 comments on commit 07727d0

Please sign in to comment.