@@ -113,7 +113,7 @@ contract("ExpenditureUtils", (accounts) => {
113
113
} ) ;
114
114
} ) ;
115
115
116
- describe . only ( "using stakes to manage expenditures" , async ( ) => {
116
+ describe ( "using stakes to manage expenditures" , async ( ) => {
117
117
beforeEach ( async ( ) => {
118
118
await expenditureUtils . setStakeFraction ( WAD . divn ( 10 ) ) ; // Stake of .3 WADs
119
119
@@ -134,6 +134,19 @@ contract("ExpenditureUtils", (accounts) => {
134
134
expect ( obligation ) . to . eq . BN ( WAD . muln ( 3 ) . divn ( 10 ) ) ;
135
135
} ) ;
136
136
137
+ it ( "can slash the stake with the arbitration permission" , async ( ) => {
138
+ await expenditureUtils . makeExpenditureWithStake ( 1 , UINT256_MAX , 1 , domain1Key , domain1Value , domain1Mask , domain1Siblings , { from : USER0 } ) ;
139
+ const expenditureId = await colony . getExpenditureCount ( ) ;
140
+
141
+ await expenditureUtils . slashStake ( 1 , UINT256_MAX , expenditureId ) ;
142
+
143
+ const obligation = await tokenLocking . getObligation ( USER0 , token . address , colony . address ) ;
144
+ expect ( obligation ) . to . be . zero ;
145
+
146
+ const userLock = await tokenLocking . getUserLock ( token . address , USER0 ) ;
147
+ expect ( userLock . balance ) . to . eq . BN ( WAD . sub ( WAD . muln ( 3 ) . divn ( 10 ) ) ) ;
148
+ } ) ;
149
+
137
150
it ( "can reclaim the stake by cancelling the expenditure" , async ( ) => {
138
151
await expenditureUtils . makeExpenditureWithStake ( 1 , UINT256_MAX , 1 , domain1Key , domain1Value , domain1Mask , domain1Siblings , { from : USER0 } ) ;
139
152
const expenditureId = await colony . getExpenditureCount ( ) ;
@@ -144,6 +157,9 @@ contract("ExpenditureUtils", (accounts) => {
144
157
145
158
const obligation = await tokenLocking . getObligation ( USER0 , token . address , colony . address ) ;
146
159
expect ( obligation ) . to . be . zero ;
160
+
161
+ const userLock = await tokenLocking . getUserLock ( token . address , USER0 ) ;
162
+ expect ( userLock . balance ) . to . eq . BN ( WAD ) ;
147
163
} ) ;
148
164
149
165
it ( "can reclaim the stake by finalizing the expenditure" , async ( ) => {
@@ -156,6 +172,9 @@ contract("ExpenditureUtils", (accounts) => {
156
172
157
173
const obligation = await tokenLocking . getObligation ( USER0 , token . address , colony . address ) ;
158
174
expect ( obligation ) . to . be . zero ;
175
+
176
+ const userLock = await tokenLocking . getUserLock ( token . address , USER0 ) ;
177
+ expect ( userLock . balance ) . to . eq . BN ( WAD ) ;
159
178
} ) ;
160
179
161
180
it ( "cannot reclaim the stake while the expenditure is in progress" , async ( ) => {
0 commit comments