@@ -72,6 +72,31 @@ contract('Disputes', ([me, other, governor, arbitrator, indexNode, fisherman]) =
72
72
} )
73
73
} )
74
74
75
+ describe ( 'minimumDeposit' , function ( ) {
76
+ it ( 'should set `minimumDeposit`' , async function ( ) {
77
+ const minimumDeposit = defaults . dispute . minimumDeposit
78
+ const newMinimumDeposit = web3 . utils . toBN ( 1 )
79
+
80
+ // Set right in the constructor
81
+ expect ( await this . disputeManager . minimumDeposit ( ) ) . to . be . bignumber . eq ( minimumDeposit )
82
+
83
+ // Set new value
84
+ await this . disputeManager . setMinimumDeposit ( newMinimumDeposit , {
85
+ from : governor ,
86
+ } )
87
+ expect ( await this . disputeManager . minimumDeposit ( ) ) . to . be . bignumber . eq ( newMinimumDeposit )
88
+ } )
89
+
90
+ it ( 'reject set `minimumDeposit` if not allowed' , async function ( ) {
91
+ await expectRevert (
92
+ this . disputeManager . setMinimumDeposit ( defaults . dispute . minimumDeposit , {
93
+ from : other ,
94
+ } ) ,
95
+ 'Only Governor can call' ,
96
+ )
97
+ } )
98
+ } )
99
+
75
100
describe ( 'rewardPercentage' , function ( ) {
76
101
it ( 'should set `rewardPercentage`' , async function ( ) {
77
102
const rewardPercentage = defaults . dispute . rewardPercentage
@@ -140,24 +165,19 @@ contract('Disputes', ([me, other, governor, arbitrator, indexNode, fisherman]) =
140
165
} )
141
166
} )
142
167
143
- describe ( 'minimumDeposit' , function ( ) {
144
- it ( 'should set `minimumDeposit`' , async function ( ) {
145
- const minimumDeposit = defaults . dispute . minimumDeposit
146
- const newMinimumDeposit = web3 . utils . toBN ( 1 )
147
-
168
+ describe ( 'staking' , function ( ) {
169
+ it ( 'should set `staking`' , async function ( ) {
148
170
// Set right in the constructor
149
- expect ( await this . disputeManager . minimumDeposit ( ) ) . to . be . bignumber . eq ( minimumDeposit )
171
+ expect ( await this . disputeManager . staking ( ) ) . to . eq ( this . staking . address )
150
172
151
- // Set new value
152
- await this . disputeManager . setMinimumDeposit ( newMinimumDeposit , {
153
- from : governor ,
154
- } )
155
- expect ( await this . disputeManager . minimumDeposit ( ) ) . to . be . bignumber . eq ( newMinimumDeposit )
173
+ // Can set if allowed
174
+ await this . disputeManager . setStaking ( this . graphToken . address , { from : governor } )
175
+ expect ( await this . disputeManager . staking ( ) ) . to . eq ( this . graphToken . address )
156
176
} )
157
177
158
- it ( 'reject set `minimumDeposit ` if not allowed' , async function ( ) {
178
+ it ( 'reject set `staking ` if not allowed' , async function ( ) {
159
179
await expectRevert (
160
- this . disputeManager . setMinimumDeposit ( defaults . dispute . minimumDeposit , {
180
+ this . disputeManager . setStaking ( this . graphToken . address , {
161
181
from : other ,
162
182
} ) ,
163
183
'Only Governor can call' ,
@@ -302,6 +322,7 @@ contract('Disputes', ([me, other, governor, arbitrator, indexNode, fisherman]) =
302
322
subgraphID : this . subgraphId ,
303
323
indexNode : indexNode ,
304
324
fisherman : fisherman ,
325
+ tokens : this . tokensForFisherman ,
305
326
attestation : this . dispute . attestation ,
306
327
} )
307
328
} )
@@ -429,7 +450,7 @@ contract('Disputes', ([me, other, governor, arbitrator, indexNode, fisherman]) =
429
450
subgraphID : this . subgraphId ,
430
451
indexNode : indexNode ,
431
452
fisherman : fisherman ,
432
- deposit : deposit . add ( reward ) ,
453
+ tokens : deposit . add ( reward ) ,
433
454
} )
434
455
} )
435
456
} )
@@ -477,7 +498,7 @@ contract('Disputes', ([me, other, governor, arbitrator, indexNode, fisherman]) =
477
498
subgraphID : this . subgraphId ,
478
499
indexNode : indexNode ,
479
500
fisherman : fisherman ,
480
- deposit : this . tokensForFisherman ,
501
+ tokens : this . tokensForFisherman ,
481
502
} )
482
503
} )
483
504
} )
@@ -520,7 +541,7 @@ contract('Disputes', ([me, other, governor, arbitrator, indexNode, fisherman]) =
520
541
subgraphID : this . subgraphId ,
521
542
indexNode : indexNode ,
522
543
fisherman : fisherman ,
523
- deposit : this . tokensForFisherman ,
544
+ tokens : this . tokensForFisherman ,
524
545
} )
525
546
} )
526
547
} )
0 commit comments