@@ -1147,9 +1147,6 @@ fn test_finalize_succeeds() {
11471147 amount
11481148 ) ) ;
11491149
1150- // run some more blocks past the end of the contribution period
1151- run_to_block ( 60 ) ;
1152-
11531150 // finalize the crowdloan
11541151 assert_ok ! ( Crowdloan :: finalize(
11551152 RuntimeOrigin :: signed( creator) ,
@@ -1340,54 +1337,6 @@ fn test_finalize_fails_if_not_creator_origin() {
13401337 } ) ;
13411338}
13421339
1343- #[ test]
1344- fn test_finalize_fails_if_crowdloan_has_not_ended ( ) {
1345- TestState :: default ( )
1346- . with_balance ( U256 :: from ( 1 ) , 100 )
1347- . with_balance ( U256 :: from ( 2 ) , 100 )
1348- . build_and_execute ( || {
1349- // create a crowdloan
1350- let creator: AccountOf < Test > = U256 :: from ( 1 ) ;
1351- let deposit: BalanceOf < Test > = 50 ;
1352- let min_contribution: BalanceOf < Test > = 10 ;
1353- let cap: BalanceOf < Test > = 100 ;
1354- let end: BlockNumberFor < Test > = 50 ;
1355-
1356- assert_ok ! ( Crowdloan :: create(
1357- RuntimeOrigin :: signed( creator) ,
1358- deposit,
1359- min_contribution,
1360- cap,
1361- end,
1362- Some ( noop_call( ) ) ,
1363- None ,
1364- ) ) ;
1365-
1366- // run some blocks
1367- run_to_block ( 10 ) ;
1368-
1369- // some contribution
1370- let crowdloan_id: CrowdloanId = 0 ;
1371- let contributor: AccountOf < Test > = U256 :: from ( 2 ) ;
1372- let amount: BalanceOf < Test > = 50 ;
1373-
1374- assert_ok ! ( Crowdloan :: contribute(
1375- RuntimeOrigin :: signed( contributor) ,
1376- crowdloan_id,
1377- amount
1378- ) ) ;
1379-
1380- // run some more blocks before end of contribution period
1381- run_to_block ( 10 ) ;
1382-
1383- // try to finalize
1384- assert_err ! (
1385- Crowdloan :: finalize( RuntimeOrigin :: signed( creator) , crowdloan_id) ,
1386- pallet_crowdloan:: Error :: <Test >:: ContributionPeriodNotEnded
1387- ) ;
1388- } ) ;
1389- }
1390-
13911340#[ test]
13921341fn test_finalize_fails_if_crowdloan_cap_is_not_raised ( ) {
13931342 TestState :: default ( )
@@ -1585,8 +1534,8 @@ fn test_refund_succeeds() {
15851534 . is_some_and( |c| c. contributors_count == 7 )
15861535 ) ;
15871536
1588- // run some more blocks past the end of the contribution period
1589- run_to_block ( 60 ) ;
1537+ // run some more blocks before the end of the contribution period
1538+ run_to_block ( 20 ) ;
15901539
15911540 // first round of refund
15921541 assert_ok ! ( Crowdloan :: refund(
@@ -1614,7 +1563,7 @@ fn test_refund_succeeds() {
16141563 pallet_crowdloan:: Event :: <Test >:: PartiallyRefunded { crowdloan_id } . into( )
16151564 ) ;
16161565
1617- // run some more blocks
1566+ // run some more blocks past the end of the contribution period
16181567 run_to_block ( 70 ) ;
16191568
16201569 // second round of refund
@@ -1700,39 +1649,6 @@ fn test_refund_fails_if_crowdloan_does_not_exist() {
17001649 } ) ;
17011650}
17021651
1703- #[ test]
1704- fn test_refund_fails_if_crowdloan_has_not_ended ( ) {
1705- TestState :: default ( )
1706- . with_balance ( U256 :: from ( 1 ) , 100 )
1707- . build_and_execute ( || {
1708- // create a crowdloan
1709- let creator: AccountOf < Test > = U256 :: from ( 1 ) ;
1710- let initial_deposit: BalanceOf < Test > = 50 ;
1711- let min_contribution: BalanceOf < Test > = 10 ;
1712- let cap: BalanceOf < Test > = 300 ;
1713- let end: BlockNumberFor < Test > = 50 ;
1714- assert_ok ! ( Crowdloan :: create(
1715- RuntimeOrigin :: signed( creator) ,
1716- initial_deposit,
1717- min_contribution,
1718- cap,
1719- end,
1720- Some ( noop_call( ) ) ,
1721- None ,
1722- ) ) ;
1723-
1724- // run some blocks
1725- run_to_block ( 10 ) ;
1726-
1727- // try to refund
1728- let crowdloan_id: CrowdloanId = 0 ;
1729- assert_err ! (
1730- Crowdloan :: refund( RuntimeOrigin :: signed( creator) , crowdloan_id) ,
1731- pallet_crowdloan:: Error :: <Test >:: ContributionPeriodNotEnded
1732- ) ;
1733- } ) ;
1734- }
1735-
17361652#[ test]
17371653fn test_dissolve_succeeds ( ) {
17381654 TestState :: default ( )
0 commit comments