@@ -32,7 +32,7 @@ const IColony = artifacts.require("IColony");
32
32
const IMetaColony = artifacts . require ( "IMetaColony" ) ;
33
33
const IColonyNetwork = artifacts . require ( "IColonyNetwork" ) ;
34
34
const ITokenLocking = artifacts . require ( "ITokenLocking" ) ;
35
- const DSToken = artifacts . require ( "DSToken " ) ;
35
+ const Token = artifacts . require ( "Token " ) ;
36
36
const DSRoles = artifacts . require ( "DSRoles" ) ;
37
37
38
38
const contractLoader = new TruffleLoader ( {
@@ -75,7 +75,8 @@ contract("Colony Reward Payouts", accounts => {
75
75
await colony . setRewardInverse ( 100 ) ;
76
76
77
77
const otherTokenArgs = getTokenArgs ( ) ;
78
- otherToken = await DSToken . new ( otherTokenArgs [ 0 ] ) ;
78
+ otherToken = await Token . new ( ...otherTokenArgs ) ;
79
+ await otherToken . unlock ( ) ;
79
80
80
81
await fundColonyWithTokens ( colony , otherToken , initialFunding ) ;
81
82
await colony . mintTokens ( initialFunding . muln ( 100 ) . divn ( 99 ) ) ; // Tke in to account 1% being siphoned off for rewards
@@ -144,7 +145,8 @@ contract("Colony Reward Payouts", accounts => {
144
145
145
146
it ( "should not be able to create reward payout if passed reputation is not from the correct colony" , async ( ) => {
146
147
const tokenArgs = getTokenArgs ( ) ;
147
- const newToken = await DSToken . new ( tokenArgs [ 1 ] ) ;
148
+ const newToken = await Token . new ( ...tokenArgs ) ;
149
+ await newToken . unlock ( ) ;
148
150
const { logs } = await colonyNetwork . createColony ( newToken . address ) ;
149
151
const { colonyAddress } = logs [ 0 ] . args ;
150
152
const newColony = await IColony . at ( colonyAddress ) ;
@@ -262,7 +264,8 @@ contract("Colony Reward Payouts", accounts => {
262
264
263
265
it ( "should not be able to start a reward payout if no one holds colony tokens" , async ( ) => {
264
266
const tokenArgs = getTokenArgs ( ) ;
265
- const newToken = await DSToken . new ( tokenArgs [ 1 ] ) ;
267
+ const newToken = await Token . new ( ...tokenArgs ) ;
268
+ await newToken . unlock ( ) ;
266
269
const { logs } = await colonyNetwork . createColony ( newToken . address ) ;
267
270
const { colonyAddress } = logs [ 0 ] . args ;
268
271
const newColony = await IColony . at ( colonyAddress ) ;
@@ -298,7 +301,8 @@ contract("Colony Reward Payouts", accounts => {
298
301
299
302
it ( "should be able to collect rewards from multiple payouts of different token" , async ( ) => {
300
303
const tokenArgs = getTokenArgs ( ) ;
301
- const newToken = await DSToken . new ( tokenArgs [ 1 ] ) ;
304
+ const newToken = await Token . new ( ...tokenArgs ) ;
305
+ await newToken . unlock ( ) ;
302
306
await fundColonyWithTokens ( colony , newToken , initialFunding ) ;
303
307
304
308
const tx1 = await colony . startNextRewardPayout ( newToken . address , ...colonyWideReputationProof ) ;
@@ -313,7 +317,8 @@ contract("Colony Reward Payouts", accounts => {
313
317
314
318
it ( "should not be able to claim payout if colony-wide reputation is 0" , async ( ) => {
315
319
const tokenArgs = getTokenArgs ( ) ;
316
- const newToken = await DSToken . new ( tokenArgs [ 1 ] ) ;
320
+ const newToken = await Token . new ( ...tokenArgs ) ;
321
+ await newToken . unlock ( ) ;
317
322
const { logs } = await colonyNetwork . createColony ( newToken . address ) ;
318
323
const { colonyAddress } = logs [ 0 ] . args ;
319
324
const newColony = await IColony . at ( colonyAddress ) ;
@@ -456,7 +461,8 @@ contract("Colony Reward Payouts", accounts => {
456
461
457
462
it ( "should not be able to claim funds if previous payout is not claimed" , async ( ) => {
458
463
const tokenArgs = getTokenArgs ( ) ;
459
- const newToken = await DSToken . new ( tokenArgs [ 1 ] ) ;
464
+ const newToken = await Token . new ( ...tokenArgs ) ;
465
+ await newToken . unlock ( ) ;
460
466
await fundColonyWithTokens ( colony , newToken , initialFunding ) ;
461
467
462
468
await colony . startNextRewardPayout ( otherToken . address , ...colonyWideReputationProof ) ;
@@ -559,7 +565,8 @@ contract("Colony Reward Payouts", accounts => {
559
565
it ( "should be able to collect payout from two colonies at the same time" , async ( ) => {
560
566
// Setting up a new token and two colonies
561
567
const tokenArgs = getTokenArgs ( ) ;
562
- const newToken = await DSToken . new ( tokenArgs [ 1 ] ) ;
568
+ const newToken = await Token . new ( ...tokenArgs ) ;
569
+ await newToken . unlock ( ) ;
563
570
564
571
let { logs } = await colonyNetwork . createColony ( newToken . address ) ;
565
572
let { colonyAddress } = logs [ 0 ] . args ;
@@ -676,7 +683,8 @@ contract("Colony Reward Payouts", accounts => {
676
683
it ( "should not be able to claim reward payout from a colony that didn't create it" , async ( ) => {
677
684
// Setting up a new token and two colonies
678
685
const tokenArgs = getTokenArgs ( ) ;
679
- const newToken = await DSToken . new ( tokenArgs [ 1 ] ) ;
686
+ const newToken = await Token . new ( ...tokenArgs ) ;
687
+ await newToken . unlock ( ) ;
680
688
681
689
let { logs } = await colonyNetwork . createColony ( newToken . address ) ;
682
690
let { colonyAddress } = logs [ 0 ] . args ;
@@ -815,14 +823,16 @@ contract("Colony Reward Payouts", accounts => {
815
823
total reputation/tokens: ${ data . totalReputation . toString ( ) } ` , async ( ) => {
816
824
// Setting up a new token and colony
817
825
const tokenArgs = getTokenArgs ( ) ;
818
- const newToken = await DSToken . new ( tokenArgs [ 1 ] ) ;
826
+ const newToken = await Token . new ( ...tokenArgs ) ;
827
+ await newToken . unlock ( ) ;
819
828
let { logs } = await colonyNetwork . createColony ( newToken . address ) ;
820
829
const { colonyAddress } = logs [ 0 ] . args ;
821
830
await newToken . setOwner ( colonyAddress ) ;
822
831
const newColony = await IColony . at ( colonyAddress ) ;
823
832
824
833
const payoutTokenArgs = getTokenArgs ( ) ;
825
- const payoutToken = await DSToken . new ( payoutTokenArgs [ 0 ] ) ;
834
+ const payoutToken = await Token . new ( ...payoutTokenArgs ) ;
835
+ await payoutToken . unlock ( ) ;
826
836
await fundColonyWithTokens ( newColony , payoutToken , data . totalAmountOfPayoutTokens ) ;
827
837
// Issuing colony's internal tokens so they can be given to users in `bootstrapColony`
828
838
await newColony . mintTokens ( data . totalReputation ) ;
0 commit comments