@@ -183,7 +183,7 @@ describe("Staking", async () => {
183
183
await pnk . connect ( juror ) . approve ( core . target , PNK ( 1000 ) ) ;
184
184
await expect ( await core . connect ( juror ) . setStake ( 1 , PNK ( 1000 ) ) )
185
185
. to . emit ( sortition , "StakeSet" )
186
- . withArgs ( juror . address , 1 , PNK ( 1000 ) ) ;
186
+ . withArgs ( juror . address , 1 , PNK ( 1000 ) , PNK ( 1000 ) ) ;
187
187
expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 1000 ) ) ;
188
188
} ) ;
189
189
} ) ;
@@ -201,17 +201,17 @@ describe("Staking", async () => {
201
201
it ( "Should be able to unstake" , async ( ) => {
202
202
expect ( await core . connect ( juror ) . setStake ( 1 , PNK ( 500 ) ) )
203
203
. to . emit ( sortition , "StakeSet" )
204
- . withArgs ( juror . address , 1 , PNK ( 500 ) ) ;
204
+ . withArgs ( juror . address , 1 , PNK ( 500 ) , PNK ( 500 ) ) ;
205
205
expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 500 ) ) ;
206
206
207
207
expect ( await core . connect ( juror ) . setStake ( 1 , PNK ( 1001 ) ) )
208
208
. to . emit ( sortition , "StakeSet" )
209
- . withArgs ( juror . address , 1 , PNK ( 1001 ) ) ;
209
+ . withArgs ( juror . address , 1 , PNK ( 1001 ) , PNK ( 1001 ) ) ;
210
210
expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 1001 ) ) ;
211
211
212
212
expect ( await core . connect ( juror ) . setStake ( 1 , PNK ( 0 ) ) )
213
213
. to . emit ( sortition , "StakeSet" )
214
- . withArgs ( juror . address , 1 , PNK ( 0 ) ) ;
214
+ . withArgs ( juror . address , 1 , PNK ( 0 ) , PNK ( 0 ) ) ;
215
215
expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 0 ) ) ;
216
216
} ) ;
217
217
} ) ;
@@ -230,7 +230,7 @@ describe("Staking", async () => {
230
230
await drawAndReachStakingPhaseFromGenerating ( ) ;
231
231
expect ( await sortition . executeDelayedStakes ( 10 ) )
232
232
. to . emit ( sortition , "StakeSet" )
233
- . withArgs ( juror . address , 1 , PNK ( 0 ) ) ;
233
+ . withArgs ( juror . address , 1 , PNK ( 0 ) , PNK ( 0 ) ) ;
234
234
} ) ;
235
235
} ) ;
236
236
} ) ;
@@ -279,7 +279,7 @@ describe("Staking", async () => {
279
279
await drawAndReachStakingPhaseFromGenerating ( ) ;
280
280
expect ( await sortition . executeDelayedStakes ( 10 ) )
281
281
. to . emit ( sortition , "StakeSet" )
282
- . withArgs ( juror . address , 1 , PNK ( 2000 ) ) ;
282
+ . withArgs ( juror . address , 1 , PNK ( 2000 ) , PNK ( 2000 ) ) ;
283
283
expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 2000 ) ) ;
284
284
} ) ;
285
285
} ) ;
@@ -309,7 +309,7 @@ describe("Staking", async () => {
309
309
await pnk . connect ( juror ) . approve ( core . target , PNK ( 1000 ) ) ;
310
310
await expect ( await core . connect ( juror ) . setStake ( 1 , PNK ( 1000 ) ) )
311
311
. to . emit ( sortition , "StakeSet" )
312
- . withArgs ( juror . address , 1 , PNK ( 1000 ) ) ;
312
+ . withArgs ( juror . address , 1 , PNK ( 1000 ) , PNK ( 1000 ) ) ;
313
313
expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 3000 ) ) ;
314
314
} ) ;
315
315
} ) ;
@@ -340,7 +340,7 @@ describe("Staking", async () => {
340
340
await drawAndReachStakingPhaseFromGenerating ( ) ;
341
341
await expect ( await sortition . executeDelayedStakes ( 10 ) )
342
342
. to . emit ( sortition , "StakeSet" )
343
- . withArgs ( juror . address , 1 , PNK ( 1000 ) ) ;
343
+ . withArgs ( juror . address , 1 , PNK ( 1000 ) , PNK ( 1000 ) ) ;
344
344
expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 3000 ) ) ;
345
345
} ) ;
346
346
} ) ;
@@ -456,7 +456,7 @@ describe("Staking", async () => {
456
456
it ( "Should execute the delayed stakes" , async ( ) => {
457
457
await expect ( await sortition . executeDelayedStakes ( 10 ) )
458
458
. to . emit ( sortition , "StakeSet" )
459
- . withArgs ( deployer , 2 , PNK ( 3000 ) )
459
+ . withArgs ( deployer , 2 , PNK ( 3000 ) , PNK ( 5000 ) )
460
460
. to . not . emit ( sortition , "StakeDelayedNotTransferred" )
461
461
. to . not . emit ( sortition , "StakeDelayedAlreadyTransferred" )
462
462
. to . not . emit ( sortition , "StakeDelayedAlreadyTransferredWithdrawn" ) ;
@@ -524,7 +524,7 @@ describe("Staking", async () => {
524
524
it ( "Should execute the delayed stakes by withdrawing PNK and reducing the stakes" , async ( ) => {
525
525
await expect ( await sortition . executeDelayedStakes ( 10 ) )
526
526
. to . emit ( sortition , "StakeSet" )
527
- . withArgs ( deployer , 2 , PNK ( 1000 ) ) ;
527
+ . withArgs ( deployer , 2 , PNK ( 1000 ) , PNK ( 3000 ) ) ;
528
528
expect ( await sortition . getJurorBalance ( deployer , 2 ) ) . to . be . deep . equal ( [
529
529
PNK ( 3000 ) ,
530
530
PNK ( 300 ) , // we're the only juror so we are drawn 3 times
@@ -613,7 +613,7 @@ describe("Staking", async () => {
613
613
it ( "Should execute the delayed stakes but the stakes should remain the same" , async ( ) => {
614
614
await expect ( await sortition . executeDelayedStakes ( 10 ) )
615
615
. to . emit ( sortition , "StakeSet" )
616
- . withArgs ( deployer , 2 , PNK ( 2000 ) ) ;
616
+ . withArgs ( deployer , 2 , PNK ( 2000 ) , PNK ( 4000 ) ) ;
617
617
expect ( await sortition . getJurorBalance ( deployer , 2 ) ) . to . be . deep . equal ( [
618
618
PNK ( 4000 ) ,
619
619
PNK ( 300 ) , // we're the only juror so we are drawn 3 times
@@ -704,7 +704,7 @@ describe("Staking", async () => {
704
704
it ( "Should execute the delayed stakes but the stakes should remain the same" , async ( ) => {
705
705
await expect ( sortition . executeDelayedStakes ( 10 ) )
706
706
. to . emit ( await sortition , "StakeSet" )
707
- . withArgs ( deployer , 2 , PNK ( 2000 ) )
707
+ . withArgs ( deployer , 2 , PNK ( 2000 ) , PNK ( 4000 ) )
708
708
. to . not . emit ( sortition , "StakeDelayedNotTransferred" )
709
709
. to . not . emit ( sortition , "StakeDelayedAlreadyTransferred" )
710
710
. to . not . emit ( sortition , "StakeDelayedAlreadyTransferredWithdrawn" ) ;
0 commit comments