@@ -17,7 +17,7 @@ const {
17
17
} = require ( "../../helpers/constants" ) ;
18
18
19
19
const { fundColonyWithTokens, setupRandomColony, makeExpenditure, setupFundedExpenditure } = require ( "../../helpers/test-data-generator" ) ;
20
- const { getTokenArgs, checkErrorRevert, web3GetBalance, removeSubdomainLimit } = require ( "../../helpers/test-helper" ) ;
20
+ const { getTokenArgs, checkErrorRevert, web3GetBalance, removeSubdomainLimit, expectEvent } = require ( "../../helpers/test-helper" ) ;
21
21
const { setupDomainTokenReceiverResolver } = require ( "../../helpers/upgradable-contracts" ) ;
22
22
23
23
const { expect } = chai ;
@@ -563,14 +563,19 @@ contract("Colony Funding", (accounts) => {
563
563
564
564
const domain = await colony . getDomain ( 2 ) ;
565
565
const domainPotBalanceBefore = await colony . getFundingPotBalance ( domain . fundingPotId , ethers . constants . AddressZero ) ;
566
+ const nonRewardPotsTotalBefore = await colony . getNonRewardPotsTotal ( ethers . constants . AddressZero ) ;
566
567
567
568
// Claim the funds
568
- await colony . claimDomainFunds ( ethers . constants . AddressZero , 2 ) ;
569
+
570
+ const tx = await colony . claimDomainFunds ( ethers . constants . AddressZero , 2 ) ;
571
+ await expectEvent ( tx , "DomainFundsClaimed" , [ MANAGER , ethers . constants . AddressZero , 2 , 1 , 99 ] ) ;
569
572
570
573
const domainPotBalanceAfter = await colony . getFundingPotBalance ( domain . fundingPotId , ethers . constants . AddressZero ) ;
574
+ const nonRewardPotsTotalAfter = await colony . getNonRewardPotsTotal ( ethers . constants . AddressZero ) ;
571
575
572
576
// Check the balance of the domain
573
- expect ( domainPotBalanceAfter . sub ( domainPotBalanceBefore ) ) . to . eq . BN ( 100 ) ;
577
+ expect ( domainPotBalanceAfter . sub ( domainPotBalanceBefore ) ) . to . eq . BN ( 99 ) ;
578
+ expect ( nonRewardPotsTotalAfter . sub ( nonRewardPotsTotalBefore ) ) . to . eq . BN ( 99 ) ;
574
579
} ) ;
575
580
576
581
it ( "should allow a token to be directly sent to a domain" , async ( ) => {
@@ -583,14 +588,18 @@ contract("Colony Funding", (accounts) => {
583
588
584
589
const domain = await colony . getDomain ( 2 ) ;
585
590
const domainPotBalanceBefore = await colony . getFundingPotBalance ( domain . fundingPotId , otherToken . address ) ;
591
+ const nonRewardPotsTotalBefore = await colony . getNonRewardPotsTotal ( otherToken . address ) ;
586
592
587
593
// Claim the funds
588
- await colony . claimDomainFunds ( otherToken . address , 2 ) ;
594
+ const tx = await colony . claimDomainFunds ( otherToken . address , 2 ) ;
595
+ await expectEvent ( tx , "DomainFundsClaimed" , [ MANAGER , otherToken . address , 2 , 1 , 99 ] ) ;
589
596
590
597
const domainPotBalanceAfter = await colony . getFundingPotBalance ( domain . fundingPotId , otherToken . address ) ;
598
+ const nonRewardPotsTotalAfter = await colony . getNonRewardPotsTotal ( otherToken . address ) ;
591
599
592
600
// Check the balance of the domain
593
- expect ( domainPotBalanceAfter . sub ( domainPotBalanceBefore ) ) . to . eq . BN ( 100 ) ;
601
+ expect ( domainPotBalanceAfter . sub ( domainPotBalanceBefore ) ) . to . eq . BN ( 99 ) ;
602
+ expect ( nonRewardPotsTotalAfter . sub ( nonRewardPotsTotalBefore ) ) . to . eq . BN ( 99 ) ;
594
603
} ) ;
595
604
596
605
it ( "should not be able to claim funds for a domain that does not exist" , async ( ) => {
0 commit comments