@@ -183,7 +183,7 @@ describe("Staking", async () => {
183183 await pnk . connect ( juror ) . approve ( core . target , PNK ( 1000 ) ) ;
184184 await expect ( await core . connect ( juror ) . setStake ( 1 , PNK ( 1000 ) ) )
185185 . to . emit ( sortition , "StakeSet" )
186- . withArgs ( juror . address , 1 , PNK ( 1000 ) ) ;
186+ . withArgs ( juror . address , 1 , PNK ( 1000 ) , PNK ( 1000 ) ) ;
187187 expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 1000 ) ) ;
188188 } ) ;
189189 } ) ;
@@ -201,17 +201,17 @@ describe("Staking", async () => {
201201 it ( "Should be able to unstake" , async ( ) => {
202202 expect ( await core . connect ( juror ) . setStake ( 1 , PNK ( 500 ) ) )
203203 . to . emit ( sortition , "StakeSet" )
204- . withArgs ( juror . address , 1 , PNK ( 500 ) ) ;
204+ . withArgs ( juror . address , 1 , PNK ( 500 ) , PNK ( 500 ) ) ;
205205 expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 500 ) ) ;
206206
207207 expect ( await core . connect ( juror ) . setStake ( 1 , PNK ( 1001 ) ) )
208208 . to . emit ( sortition , "StakeSet" )
209- . withArgs ( juror . address , 1 , PNK ( 1001 ) ) ;
209+ . withArgs ( juror . address , 1 , PNK ( 1001 ) , PNK ( 1001 ) ) ;
210210 expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 1001 ) ) ;
211211
212212 expect ( await core . connect ( juror ) . setStake ( 1 , PNK ( 0 ) ) )
213213 . to . emit ( sortition , "StakeSet" )
214- . withArgs ( juror . address , 1 , PNK ( 0 ) ) ;
214+ . withArgs ( juror . address , 1 , PNK ( 0 ) , PNK ( 0 ) ) ;
215215 expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 0 ) ) ;
216216 } ) ;
217217 } ) ;
@@ -230,7 +230,7 @@ describe("Staking", async () => {
230230 await drawAndReachStakingPhaseFromGenerating ( ) ;
231231 expect ( await sortition . executeDelayedStakes ( 10 ) )
232232 . to . emit ( sortition , "StakeSet" )
233- . withArgs ( juror . address , 1 , PNK ( 0 ) ) ;
233+ . withArgs ( juror . address , 1 , PNK ( 0 ) , PNK ( 0 ) ) ;
234234 } ) ;
235235 } ) ;
236236 } ) ;
@@ -272,14 +272,14 @@ describe("Staking", async () => {
272272 await core . connect ( juror ) . setStake ( 1 , PNK ( 1000 ) ) ;
273273 await createDisputeAndReachGeneratingPhaseFromStaking ( ) ;
274274 expect ( await core . connect ( juror ) . setStake ( 1 , PNK ( 2000 ) ) )
275- . to . emit ( sortition , "StakeDelayedAlreadyTransferred " )
275+ . to . emit ( sortition , "StakeDelayedAlreadyTransferredDeposited " )
276276 . withArgs ( juror . address , 1 , PNK ( 2000 ) )
277277 . to . not . emit ( sortition , "StakeSet" ) ;
278278 expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 1000 ) ) ;
279279 await drawAndReachStakingPhaseFromGenerating ( ) ;
280280 expect ( await sortition . executeDelayedStakes ( 10 ) )
281281 . to . emit ( sortition , "StakeSet" )
282- . withArgs ( juror . address , 1 , PNK ( 2000 ) ) ;
282+ . withArgs ( juror . address , 1 , PNK ( 2000 ) , PNK ( 2000 ) ) ;
283283 expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 2000 ) ) ;
284284 } ) ;
285285 } ) ;
@@ -309,7 +309,7 @@ describe("Staking", async () => {
309309 await pnk . connect ( juror ) . approve ( core . target , PNK ( 1000 ) ) ;
310310 await expect ( await core . connect ( juror ) . setStake ( 1 , PNK ( 1000 ) ) )
311311 . to . emit ( sortition , "StakeSet" )
312- . withArgs ( juror . address , 1 , PNK ( 1000 ) ) ;
312+ . withArgs ( juror . address , 1 , PNK ( 1000 ) , PNK ( 1000 ) ) ;
313313 expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 3000 ) ) ;
314314 } ) ;
315315 } ) ;
@@ -334,13 +334,13 @@ describe("Staking", async () => {
334334 it ( "Should be able to stake exactly maxTotalStaked" , async ( ) => {
335335 await pnk . connect ( juror ) . approve ( core . target , PNK ( 1000 ) ) ;
336336 await expect ( await core . connect ( juror ) . setStake ( 1 , PNK ( 1000 ) ) )
337- . to . emit ( sortition , "StakeDelayedAlreadyTransferred " )
337+ . to . emit ( sortition , "StakeDelayedAlreadyTransferredDeposited " )
338338 . withArgs ( juror . address , 1 , PNK ( 1000 ) ) ;
339339 expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 2000 ) ) ; // Not updated until the delayed stake is executed
340340 await drawAndReachStakingPhaseFromGenerating ( ) ;
341341 await expect ( await sortition . executeDelayedStakes ( 10 ) )
342342 . to . emit ( sortition , "StakeSet" )
343- . withArgs ( juror . address , 1 , PNK ( 1000 ) ) ;
343+ . withArgs ( juror . address , 1 , PNK ( 1000 ) , PNK ( 1000 ) ) ;
344344 expect ( await sortition . totalStaked ( ) ) . to . be . equal ( PNK ( 3000 ) ) ;
345345 } ) ;
346346 } ) ;
@@ -430,7 +430,7 @@ describe("Staking", async () => {
430430 await pnk . approve ( core . target , PNK ( 1000 ) ) ;
431431 expect ( await sortition . latestDelayedStakeIndex ( deployer , 2 ) ) . to . be . equal ( 0 ) ;
432432 await expect ( core . setStake ( 2 , PNK ( 3000 ) ) )
433- . to . emit ( sortition , "StakeDelayedAlreadyTransferred " )
433+ . to . emit ( sortition , "StakeDelayedAlreadyTransferredDeposited " )
434434 . withArgs ( deployer , 2 , PNK ( 3000 ) ) ;
435435 expect ( await sortition . getJurorBalance ( deployer , 2 ) ) . to . be . deep . equal ( [ PNK ( 5000 ) , 0 , PNK ( 2000 ) , 2 ] ) ; // stake does not change
436436 } ) ;
@@ -456,9 +456,9 @@ describe("Staking", async () => {
456456 it ( "Should execute the delayed stakes" , async ( ) => {
457457 await expect ( await sortition . executeDelayedStakes ( 10 ) )
458458 . to . emit ( sortition , "StakeSet" )
459- . withArgs ( deployer , 2 , PNK ( 3000 ) )
459+ . withArgs ( deployer , 2 , PNK ( 3000 ) , PNK ( 5000 ) )
460460 . to . not . emit ( sortition , "StakeDelayedNotTransferred" )
461- . to . not . emit ( sortition , "StakeDelayedAlreadyTransferred " )
461+ . to . not . emit ( sortition , "StakeDelayedAlreadyTransferredDeposited " )
462462 . to . not . emit ( sortition , "StakeDelayedAlreadyTransferredWithdrawn" ) ;
463463 expect ( await sortition . getJurorBalance ( deployer , 2 ) ) . to . be . deep . equal ( [
464464 PNK ( 5000 ) ,
@@ -524,7 +524,7 @@ describe("Staking", async () => {
524524 it ( "Should execute the delayed stakes by withdrawing PNK and reducing the stakes" , async ( ) => {
525525 await expect ( await sortition . executeDelayedStakes ( 10 ) )
526526 . to . emit ( sortition , "StakeSet" )
527- . withArgs ( deployer , 2 , PNK ( 1000 ) ) ;
527+ . withArgs ( deployer , 2 , PNK ( 1000 ) , PNK ( 3000 ) ) ;
528528 expect ( await sortition . getJurorBalance ( deployer , 2 ) ) . to . be . deep . equal ( [
529529 PNK ( 3000 ) ,
530530 PNK ( 300 ) , // we're the only juror so we are drawn 3 times
@@ -613,7 +613,7 @@ describe("Staking", async () => {
613613 it ( "Should execute the delayed stakes but the stakes should remain the same" , async ( ) => {
614614 await expect ( await sortition . executeDelayedStakes ( 10 ) )
615615 . to . emit ( sortition , "StakeSet" )
616- . withArgs ( deployer , 2 , PNK ( 2000 ) ) ;
616+ . withArgs ( deployer , 2 , PNK ( 2000 ) , PNK ( 4000 ) ) ;
617617 expect ( await sortition . getJurorBalance ( deployer , 2 ) ) . to . be . deep . equal ( [
618618 PNK ( 4000 ) ,
619619 PNK ( 300 ) , // we're the only juror so we are drawn 3 times
@@ -653,7 +653,7 @@ describe("Staking", async () => {
653653 await pnk . approve ( core . target , PNK ( 1000 ) ) ;
654654 expect ( await sortition . latestDelayedStakeIndex ( deployer , 2 ) ) . to . be . equal ( 0 ) ;
655655 await expect ( core . setStake ( 2 , PNK ( 3000 ) ) )
656- . to . emit ( sortition , "StakeDelayedAlreadyTransferred " )
656+ . to . emit ( sortition , "StakeDelayedAlreadyTransferredDeposited " )
657657 . withArgs ( deployer , 2 , PNK ( 3000 ) ) ;
658658 expect ( await sortition . getJurorBalance ( deployer , 2 ) ) . to . be . deep . equal ( [ PNK ( 5000 ) , 0 , PNK ( 2000 ) , 2 ] ) ; // stake does not change
659659 } ) ;
@@ -704,9 +704,9 @@ describe("Staking", async () => {
704704 it ( "Should execute the delayed stakes but the stakes should remain the same" , async ( ) => {
705705 await expect ( sortition . executeDelayedStakes ( 10 ) )
706706 . to . emit ( await sortition , "StakeSet" )
707- . withArgs ( deployer , 2 , PNK ( 2000 ) )
707+ . withArgs ( deployer , 2 , PNK ( 2000 ) , PNK ( 4000 ) )
708708 . to . not . emit ( sortition , "StakeDelayedNotTransferred" )
709- . to . not . emit ( sortition , "StakeDelayedAlreadyTransferred " )
709+ . to . not . emit ( sortition , "StakeDelayedAlreadyTransferredDeposited " )
710710 . to . not . emit ( sortition , "StakeDelayedAlreadyTransferredWithdrawn" ) ;
711711 expect ( await sortition . getJurorBalance ( deployer , 2 ) ) . to . be . deep . equal ( [
712712 PNK ( 4000 ) ,
0 commit comments