@@ -331,14 +331,7 @@ describe('safientMain', async () => {
331331 await safientMainCreator . createSafe ( beneficiaryAddress , safeId [ 3 ] , Types . ClaimType . DDayBased , 0 , 6 , '' , '' ) ;
332332
333333 // create a claim - before D-Day (claim should fail)
334- const tx1 = await safientMainBeneficiary . createClaim ( safeId [ 3 ] , '' ) ;
335- const txReceipt1 = await tx1 . wait ( ) ;
336- const claimId1 = txReceipt1 . events [ 0 ] . args [ 1 ] ;
337- const claimID1 = parseInt ( claimId1 . _hex ) ;
338-
339- // check claim status (DDayBased)
340- const safeId4ClaimResult1 = await safientMainAccountX . getClaimStatus ( safeId [ 3 ] , claimID1 ) ;
341- expect ( safeId4ClaimResult1 ) . to . equal ( 2 ) ; // claim got Failed (before D-Day)
334+ await expect ( safientMainBeneficiary . createClaim ( safeId [ 3 ] , '' ) ) . to . be . rejectedWith ( Error ) ; ;
342335
343336 // mine a new block after 6 seconds
344337 const mineNewBlock = new Promise ( ( resolve , reject ) => {
@@ -374,14 +367,7 @@ describe('safientMain', async () => {
374367 await safientMainCreator . createSafe ( beneficiaryAddress , safeId [ 4 ] , Types . ClaimType . DDayBased , 0 , now + 6 , '' , '' ) ;
375368
376369 // create a claim - before D-Day (6 seconds) (claim should fail)
377- const tx1 = await safientMainBeneficiary . createClaim ( safeId [ 4 ] , '' ) ;
378- const txReceipt1 = await tx1 . wait ( ) ;
379- const claimId1 = txReceipt1 . events [ 0 ] . args [ 1 ] ;
380- const claimID1 = parseInt ( claimId1 . _hex ) ;
381-
382- // check claim status (DDayBased)
383- const safeId4ClaimResult1 = await safientMainAccountX . getClaimStatus ( safeId [ 4 ] , claimID1 ) ;
384- expect ( safeId4ClaimResult1 ) . to . equal ( 2 ) ; // claim got Failed (before D-Day)
370+ await expect ( safientMainBeneficiary . createClaim ( safeId [ 4 ] , '' ) ) . to . be . rejectedWith ( Error ) ; ;
385371
386372 latestBlockNumber = await ethers . provider . getBlockNumber ( ) ;
387373 latestBlock = await ethers . provider . getBlock ( latestBlockNumber ) ;
@@ -399,14 +385,7 @@ describe('safientMain', async () => {
399385 const result1 = await mineNewBlock1 ;
400386
401387 // create a claim - before D-Day (12 seconds) (claim should fail)
402- const tx2 = await safientMainBeneficiary . createClaim ( safeId [ 4 ] , '' ) ;
403- const txReceipt2 = await tx2 . wait ( ) ;
404- const claimId2 = txReceipt2 . events [ 0 ] . args [ 1 ] ;
405- const claimID2 = parseInt ( claimId2 . _hex ) ;
406-
407- // check claim status (DDayBased)
408- const safeId4ClaimResult2 = await safientMainAccountX . getClaimStatus ( safeId [ 4 ] , claimID2 ) ;
409- expect ( safeId4ClaimResult2 ) . to . equal ( 2 ) ; // claim got Failed (before D-Day)
388+ await expect ( safientMainBeneficiary . createClaim ( safeId [ 4 ] , '' ) ) . to . be . rejectedWith ( Error ) ;
410389
411390 // mine a new block after 2 seconds
412391 const mineNewBlock2 = new Promise ( ( resolve , reject ) => {
0 commit comments