@@ -991,29 +991,31 @@ mod tests {
991991 assert_noop!(Crowdloan::begin_retirement(Origin::signed(1), 0), Error::<Test>::NotParachain);
992992 });
993993 }
994-
994+ */
995995 #[ test]
996996 fn withdraw_works ( ) {
997997 new_test_ext ( ) . execute_with ( || {
998998 // Set up a crowdloan
999- assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
1000- assert_ok!(Crowdloan::create(Origin::signed(1), 1000, 1, 4, 9));
1001- // Transfer fee is taken here
1002- assert_ok!(Crowdloan::contribute(Origin::signed(1), 0, 100));
1003- assert_ok!(Crowdloan::contribute(Origin::signed(2), 0, 200));
1004- assert_ok!(Crowdloan::contribute(Origin::signed(3), 0, 300));
999+ assert_ok ! ( TestRegistrar :: <Test >:: make_parathread( 0 . into( ) ) ) ;
1000+ TestRegistrar :: < Test > :: set_manager ( 0 . into ( ) , 1 ) ;
1001+ assert_ok ! ( Crowdloan :: create( Origin :: signed( 1 ) , 0 . into( ) , 1000 , 1 , 4 , 9 ) ) ;
1002+
1003+ // Contribute
1004+ assert_ok ! ( Crowdloan :: contribute( Origin :: signed( 1 ) , 0 . into( ) , 100 ) ) ;
1005+ assert_ok ! ( Crowdloan :: contribute( Origin :: signed( 2 ) , 0 . into( ) , 200 ) ) ;
1006+ assert_ok ! ( Crowdloan :: contribute( Origin :: signed( 3 ) , 0 . into( ) , 300 ) ) ;
10051007
10061008 // Skip all the way to the end
10071009 run_to_block ( 50 ) ;
10081010
10091011 // Anyone can trigger withdraw of a user's balance without fees
1010- assert_ok!(Crowdloan::withdraw(Origin::signed(1337), 1, 0));
1012+ assert_ok ! ( Crowdloan :: withdraw( Origin :: signed( 1337 ) , 1 , 0 . into ( ) ) ) ;
10111013 assert_eq ! ( Balances :: free_balance( 1 ) , 999 ) ;
10121014
1013- assert_ok!(Crowdloan::withdraw(Origin::signed(1337), 2, 0));
1015+ assert_ok ! ( Crowdloan :: withdraw( Origin :: signed( 1337 ) , 2 , 0 . into ( ) ) ) ;
10141016 assert_eq ! ( Balances :: free_balance( 2 ) , 2000 ) ;
10151017
1016- assert_ok!(Crowdloan::withdraw(Origin::signed(1337), 3, 0));
1018+ assert_ok ! ( Crowdloan :: withdraw( Origin :: signed( 1337 ) , 3 , 0 . into ( ) ) ) ;
10171019 assert_eq ! ( Balances :: free_balance( 3 ) , 3000 ) ;
10181020 } ) ;
10191021 }
@@ -1022,26 +1024,28 @@ mod tests {
10221024 fn withdraw_handles_basic_errors ( ) {
10231025 new_test_ext ( ) . execute_with ( || {
10241026 // Set up a crowdloan
1025- assert_ok!(Slots::new_auction(Origin::root(), 5, 1));
1026- assert_ok!(Crowdloan::create(Origin::signed(1), 1000, 1, 4, 9));
1027- // Transfer fee is taken here
1028- assert_ok!(Crowdloan::contribute(Origin::signed(1), 0, 49));
1027+ assert_ok ! ( TestRegistrar :: <Test >:: make_parathread( 0 . into( ) ) ) ;
1028+ TestRegistrar :: < Test > :: set_manager ( 0 . into ( ) , 1 ) ;
1029+ assert_ok ! ( Crowdloan :: create( Origin :: signed( 1 ) , 0 . into( ) , 1000 , 1 , 4 , 9 ) ) ;
1030+
1031+ // Contribute
1032+ assert_ok ! ( Crowdloan :: contribute( Origin :: signed( 1 ) , 0 . into( ) , 49 ) ) ;
10291033 assert_eq ! ( Balances :: free_balance( 1 ) , 950 ) ;
10301034
10311035 run_to_block ( 5 ) ;
10321036
10331037 // Cannot withdraw before fund ends
1034- assert_noop!(Crowdloan::withdraw(Origin::signed(1337), 1, 0), Error::<Test>::FundNotEnded);
1038+ assert_noop ! ( Crowdloan :: withdraw( Origin :: signed( 1337 ) , 1 , 0 . into ( ) ) , Error :: <Test >:: FundNotEnded ) ;
10351039
10361040 run_to_block ( 10 ) ;
10371041
10381042 // Cannot withdraw if they did not contribute
1039- assert_noop!(Crowdloan::withdraw(Origin::signed(1337), 2, 0), Error::<Test>::NoContributions);
1043+ assert_noop ! ( Crowdloan :: withdraw( Origin :: signed( 1337 ) , 2 , 0 . into ( ) ) , Error :: <Test >:: NoContributions ) ;
10401044 // Cannot withdraw from a non-existent fund
1041- assert_noop!(Crowdloan::withdraw(Origin::signed(1337), 2, 1), Error::<Test>::InvalidParaId);
1045+ assert_noop ! ( Crowdloan :: withdraw( Origin :: signed( 1337 ) , 2 , 1 . into ( ) ) , Error :: <Test >:: InvalidParaId ) ;
10421046 } ) ;
10431047 }
1044- */
1048+
10451049 #[ test]
10461050 fn dissolve_works ( ) {
10471051 new_test_ext ( ) . execute_with ( || {
0 commit comments