1
1
const helpers = require ( "./helpers" ) ;
2
- const JoinAndQuit = artifacts . require ( "./JoinAndQuit .sol" ) ;
2
+ const Join = artifacts . require ( "./Join .sol" ) ;
3
3
const FundingRequest = artifacts . require ( "./FundingRequest.sol" ) ;
4
4
const ERC20Mock = artifacts . require ( './test/ERC20Mock.sol' ) ;
5
5
const Redeemer = artifacts . require ( "./Redeemer.sol" ) ;
6
6
7
- class JoinAndQuitParams {
7
+ class JoinParams {
8
8
constructor ( ) {
9
9
}
10
10
}
@@ -14,7 +14,7 @@ class FundingRequestParams {
14
14
}
15
15
}
16
16
17
- const setupJoinAndQuit = async function (
17
+ const setupJoin = async function (
18
18
accounts ,
19
19
genesisProtocol ,
20
20
token ,
@@ -24,42 +24,40 @@ const setupJoinAndQuit = async function(
24
24
_fundingGoal ,
25
25
_fundingGoalDeadline
26
26
) {
27
- var joinAndQuitParams = new JoinAndQuitParams ( ) ;
27
+ var joinParams = new JoinParams ( ) ;
28
28
29
29
if ( genesisProtocol === true ) {
30
- joinAndQuitParams . votingMachine = await helpers . setupGenesisProtocol ( accounts , token , helpers . NULL_ADDRESS ) ;
31
- joinAndQuitParams . initdata = await new web3 . eth . Contract ( registration . joinAndQuit . abi )
30
+ joinParams . votingMachine = await helpers . setupGenesisProtocol ( accounts , token , helpers . NULL_ADDRESS ) ;
31
+ joinParams . initdata = await new web3 . eth . Contract ( registration . join . abi )
32
32
. methods
33
33
. initialize ( helpers . NULL_ADDRESS ,
34
- joinAndQuitParams . votingMachine . genesisProtocol . address ,
35
- joinAndQuitParams . votingMachine . uintArray ,
36
- joinAndQuitParams . votingMachine . voteOnBehalf ,
34
+ joinParams . votingMachine . genesisProtocol . address ,
35
+ joinParams . votingMachine . uintArray ,
36
+ joinParams . votingMachine . voteOnBehalf ,
37
37
helpers . NULL_HASH ,
38
38
_fundingToken ,
39
39
_minFeeToJoin ,
40
40
_memberReputation ,
41
41
_fundingGoal ,
42
- _fundingGoalDeadline ,
43
- false )
42
+ _fundingGoalDeadline )
44
43
. encodeABI ( ) ;
45
44
} else {
46
- joinAndQuitParams . votingMachine = await helpers . setupAbsoluteVote ( helpers . NULL_ADDRESS , 50 ) ;
47
- joinAndQuitParams . initdata = await new web3 . eth . Contract ( registration . joinAndQuit . abi )
45
+ joinParams . votingMachine = await helpers . setupAbsoluteVote ( helpers . NULL_ADDRESS , 50 ) ;
46
+ joinParams . initdata = await new web3 . eth . Contract ( registration . join . abi )
48
47
. methods
49
48
. initialize ( helpers . NULL_ADDRESS ,
50
- joinAndQuitParams . votingMachine . absoluteVote . address ,
49
+ joinParams . votingMachine . absoluteVote . address ,
51
50
[ 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ] ,
52
51
helpers . NULL_ADDRESS ,
53
- joinAndQuitParams . votingMachine . params ,
52
+ joinParams . votingMachine . params ,
54
53
_fundingToken ,
55
54
_minFeeToJoin ,
56
55
_memberReputation ,
57
56
_fundingGoal ,
58
- _fundingGoalDeadline ,
59
- false )
57
+ _fundingGoalDeadline )
60
58
. encodeABI ( ) ;
61
59
}
62
- return joinAndQuitParams ;
60
+ return joinParams ;
63
61
} ;
64
62
65
63
@@ -125,7 +123,7 @@ const setup = async function (accounts,
125
123
fundPath = helpers . NULL_ADDRESS ;
126
124
}
127
125
128
- testSetup . joinAndQuitParams = await setupJoinAndQuit (
126
+ testSetup . joinParams = await setupJoin (
129
127
accounts ,
130
128
genesisProtocol ,
131
129
tokenAddress ,
@@ -151,32 +149,32 @@ const setup = async function (accounts,
151
149
[ 1000 , 0 , 0 ] ,
152
150
testSetup . reputationArray ,
153
151
0 ,
154
- [ web3 . utils . fromAscii ( "JoinAndQuit " ) , web3 . utils . fromAscii ( "FundingRequest" ) ] ,
155
- helpers . concatBytes ( testSetup . joinAndQuitParams . initdata , testSetup . fundingRequestParams . initdata ) ,
156
- [ helpers . getBytesLength ( testSetup . joinAndQuitParams . initdata ) , helpers . getBytesLength ( testSetup . fundingRequestParams . initdata ) ] ,
152
+ [ web3 . utils . fromAscii ( "Join " ) , web3 . utils . fromAscii ( "FundingRequest" ) ] ,
153
+ helpers . concatBytes ( testSetup . joinParams . initdata , testSetup . fundingRequestParams . initdata ) ,
154
+ [ helpers . getBytesLength ( testSetup . joinParams . initdata ) , helpers . getBytesLength ( testSetup . fundingRequestParams . initdata ) ] ,
157
155
[ permissions , permissions ] ,
158
156
"metaData" ) ;
159
157
160
- testSetup . joinAndQuit = await JoinAndQuit . at ( tx . logs [ 6 ] . args . _scheme ) ;
158
+ testSetup . join = await Join . at ( tx . logs [ 6 ] . args . _scheme ) ;
161
159
testSetup . fundingRequest = await FundingRequest . at ( tx . logs [ 8 ] . args . _scheme ) ;
162
160
163
161
164
162
if ( setupJAQProposal ) {
165
163
await testSetup . standardTokenMock . transfer ( accounts [ 3 ] , 10000 ) ;
166
- await testSetup . standardTokenMock . approve ( testSetup . joinAndQuit . address , testSetup . fundingGoal , { from :accounts [ 3 ] } ) ;
164
+ await testSetup . standardTokenMock . approve ( testSetup . join . address , testSetup . fundingGoal , { from :accounts [ 3 ] } ) ;
167
165
let value = 0 ;
168
166
if ( ethFunding ) {
169
167
value = testSetup . fundingGoal ;
170
168
}
171
- tx = await testSetup . joinAndQuit . proposeToJoin (
169
+ tx = await testSetup . join . proposeToJoin (
172
170
"description-hash" ,
173
171
testSetup . fundingGoal ,
174
172
{ value, from :accounts [ 3 ] } ) ;
175
173
var proposalId = await helpers . getValueFromLogs ( tx , '_proposalId' , 1 ) ;
176
174
if ( genesisProtocol === false ) {
177
- await testSetup . joinAndQuitParams . votingMachine . absoluteVote . vote ( proposalId , 1 , 0 , helpers . NULL_ADDRESS , { from :accounts [ 2 ] } ) ;
175
+ await testSetup . joinParams . votingMachine . absoluteVote . vote ( proposalId , 1 , 0 , helpers . NULL_ADDRESS , { from :accounts [ 2 ] } ) ;
178
176
} else {
179
- await testSetup . joinAndQuitParams . votingMachine . genesisProtocol . vote ( proposalId , 1 , 0 , helpers . NULL_ADDRESS , { from :accounts [ 2 ] } ) ;
177
+ await testSetup . joinParams . votingMachine . genesisProtocol . vote ( proposalId , 1 , 0 , helpers . NULL_ADDRESS , { from :accounts [ 2 ] } ) ;
180
178
}
181
179
}
182
180
return testSetup ;
0 commit comments