diff --git a/steps/1/src/tests.rs b/steps/1/src/tests.rs index 26dd7ed7..266ea5ed 100644 --- a/steps/1/src/tests.rs +++ b/steps/1/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,6 +73,7 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/10/src/tests.rs b/steps/10/src/tests.rs index 401092ae..a33f4de3 100644 --- a/steps/10/src/tests.rs +++ b/steps/10/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/11/src/tests.rs b/steps/11/src/tests.rs index 401092ae..a33f4de3 100644 --- a/steps/11/src/tests.rs +++ b/steps/11/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/12/src/tests.rs b/steps/12/src/tests.rs index 401092ae..a33f4de3 100644 --- a/steps/12/src/tests.rs +++ b/steps/12/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/13/src/tests.rs b/steps/13/src/tests.rs index 15d158ad..0c1aca26 100644 --- a/steps/13/src/tests.rs +++ b/steps/13/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/14/src/tests.rs b/steps/14/src/tests.rs index 401092ae..a33f4de3 100644 --- a/steps/14/src/tests.rs +++ b/steps/14/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/15/src/tests.rs b/steps/15/src/tests.rs index 3892aaf8..aa02ffa9 100644 --- a/steps/15/src/tests.rs +++ b/steps/15/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/16/src/tests.rs b/steps/16/src/tests.rs index 3892aaf8..aa02ffa9 100644 --- a/steps/16/src/tests.rs +++ b/steps/16/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/17/src/tests.rs b/steps/17/src/tests.rs index e09a2511..19cbedde 100644 --- a/steps/17/src/tests.rs +++ b/steps/17/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/18/src/tests.rs b/steps/18/src/tests.rs index e09a2511..19cbedde 100644 --- a/steps/18/src/tests.rs +++ b/steps/18/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/19/src/tests.rs b/steps/19/src/tests.rs index 0fb87316..7cd94b57 100644 --- a/steps/19/src/tests.rs +++ b/steps/19/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/2/src/tests.rs b/steps/2/src/tests.rs index 26dd7ed7..266ea5ed 100644 --- a/steps/2/src/tests.rs +++ b/steps/2/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,6 +73,7 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/20/src/tests.rs b/steps/20/src/tests.rs index 0fb87316..7cd94b57 100644 --- a/steps/20/src/tests.rs +++ b/steps/20/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/21/src/tests.rs b/steps/21/src/tests.rs index bcfff3dc..8877de04 100644 --- a/steps/21/src/tests.rs +++ b/steps/21/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/22/src/tests.rs b/steps/22/src/tests.rs index bcfff3dc..8877de04 100644 --- a/steps/22/src/tests.rs +++ b/steps/22/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/23/src/tests.rs b/steps/23/src/tests.rs index bc0aa673..312a2308 100644 --- a/steps/23/src/tests.rs +++ b/steps/23/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/24/src/tests.rs b/steps/24/src/tests.rs index bc0aa673..312a2308 100644 --- a/steps/24/src/tests.rs +++ b/steps/24/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/25/src/tests.rs b/steps/25/src/tests.rs index 01b246d1..efff2798 100644 --- a/steps/25/src/tests.rs +++ b/steps/25/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/26/src/tests.rs b/steps/26/src/tests.rs index 01b246d1..efff2798 100644 --- a/steps/26/src/tests.rs +++ b/steps/26/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/27/src/tests.rs b/steps/27/src/tests.rs index 01b246d1..efff2798 100644 --- a/steps/27/src/tests.rs +++ b/steps/27/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/28/src/tests.rs b/steps/28/src/tests.rs index 93d49214..d8fa8e1c 100644 --- a/steps/28/src/tests.rs +++ b/steps/28/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/29/src/tests.rs b/steps/29/src/tests.rs index 93d49214..d8fa8e1c 100644 --- a/steps/29/src/tests.rs +++ b/steps/29/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/3/src/tests.rs b/steps/3/src/tests.rs index 26dd7ed7..266ea5ed 100644 --- a/steps/3/src/tests.rs +++ b/steps/3/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,6 +73,7 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/30/src/tests.rs b/steps/30/src/tests.rs index f4166ad2..1fb90372 100644 --- a/steps/30/src/tests.rs +++ b/steps/30/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/31/src/tests.rs b/steps/31/src/tests.rs index f4166ad2..1fb90372 100644 --- a/steps/31/src/tests.rs +++ b/steps/31/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/32/src/tests.rs b/steps/32/src/tests.rs index f3681f01..dcb8fcfb 100644 --- a/steps/32/src/tests.rs +++ b/steps/32/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/33/src/tests.rs b/steps/33/src/tests.rs index f3681f01..dcb8fcfb 100644 --- a/steps/33/src/tests.rs +++ b/steps/33/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/34/src/tests.rs b/steps/34/src/tests.rs index 09d0ac97..522f81ad 100644 --- a/steps/34/src/tests.rs +++ b/steps/34/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/35/src/tests.rs b/steps/35/src/tests.rs index 09d0ac97..522f81ad 100644 --- a/steps/35/src/tests.rs +++ b/steps/35/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/36/src/tests.rs b/steps/36/src/tests.rs index 61a38e41..0f5c0aae 100644 --- a/steps/36/src/tests.rs +++ b/steps/36/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/37/src/tests.rs b/steps/37/src/tests.rs index 61a38e41..0f5c0aae 100644 --- a/steps/37/src/tests.rs +++ b/steps/37/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/38/src/tests.rs b/steps/38/src/tests.rs index 61a38e41..0f5c0aae 100644 --- a/steps/38/src/tests.rs +++ b/steps/38/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/39/src/tests.rs b/steps/39/src/tests.rs index c1ea5ea6..24e41cc6 100644 --- a/steps/39/src/tests.rs +++ b/steps/39/src/tests.rs @@ -54,6 +54,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -61,7 +72,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/4/src/tests.rs b/steps/4/src/tests.rs index 26dd7ed7..266ea5ed 100644 --- a/steps/4/src/tests.rs +++ b/steps/4/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,6 +73,7 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/40/src/tests.rs b/steps/40/src/tests.rs index c1ea5ea6..24e41cc6 100644 --- a/steps/40/src/tests.rs +++ b/steps/40/src/tests.rs @@ -54,6 +54,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -61,7 +72,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/41/src/tests.rs b/steps/41/src/tests.rs index 222a831b..4542661a 100644 --- a/steps/41/src/tests.rs +++ b/steps/41/src/tests.rs @@ -54,6 +54,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -61,7 +72,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/42/src/tests.rs b/steps/42/src/tests.rs index 222a831b..4542661a 100644 --- a/steps/42/src/tests.rs +++ b/steps/42/src/tests.rs @@ -54,6 +54,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -61,7 +72,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/43/src/tests.rs b/steps/43/src/tests.rs index 57510b3d..9168e31f 100644 --- a/steps/43/src/tests.rs +++ b/steps/43/src/tests.rs @@ -55,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -62,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/44/src/tests.rs b/steps/44/src/tests.rs index 57510b3d..9168e31f 100644 --- a/steps/44/src/tests.rs +++ b/steps/44/src/tests.rs @@ -55,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -62,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/45/src/tests.rs b/steps/45/src/tests.rs index 2a02d4e7..e6c48814 100644 --- a/steps/45/src/tests.rs +++ b/steps/45/src/tests.rs @@ -57,6 +57,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -64,7 +75,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/46/src/tests.rs b/steps/46/src/tests.rs index 2a02d4e7..e6c48814 100644 --- a/steps/46/src/tests.rs +++ b/steps/46/src/tests.rs @@ -57,6 +57,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -64,7 +75,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/47/src/tests.rs b/steps/47/src/tests.rs index 5bb638fa..2558284e 100644 --- a/steps/47/src/tests.rs +++ b/steps/47/src/tests.rs @@ -57,6 +57,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -64,7 +75,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/48/src/tests.rs b/steps/48/src/tests.rs index 5bb638fa..2558284e 100644 --- a/steps/48/src/tests.rs +++ b/steps/48/src/tests.rs @@ -57,6 +57,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -64,7 +75,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/49/src/tests.rs b/steps/49/src/tests.rs index a1e86a46..a04be004 100644 --- a/steps/49/src/tests.rs +++ b/steps/49/src/tests.rs @@ -57,6 +57,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -64,7 +75,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/5/src/tests.rs b/steps/5/src/tests.rs index 26dd7ed7..266ea5ed 100644 --- a/steps/5/src/tests.rs +++ b/steps/5/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,6 +73,7 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/50/src/tests.rs b/steps/50/src/tests.rs index a1e86a46..a04be004 100644 --- a/steps/50/src/tests.rs +++ b/steps/50/src/tests.rs @@ -57,6 +57,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -64,7 +75,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/51/src/tests.rs b/steps/51/src/tests.rs index 03c3f44b..742ee810 100644 --- a/steps/51/src/tests.rs +++ b/steps/51/src/tests.rs @@ -57,6 +57,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -64,7 +75,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/52/src/tests.rs b/steps/52/src/tests.rs index 03c3f44b..742ee810 100644 --- a/steps/52/src/tests.rs +++ b/steps/52/src/tests.rs @@ -57,6 +57,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -64,7 +75,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/53/src/tests.rs b/steps/53/src/tests.rs index fab1f489..0109061b 100644 --- a/steps/53/src/tests.rs +++ b/steps/53/src/tests.rs @@ -57,6 +57,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -64,7 +75,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/54/src/tests.rs b/steps/54/src/tests.rs index fab1f489..0109061b 100644 --- a/steps/54/src/tests.rs +++ b/steps/54/src/tests.rs @@ -57,6 +57,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -64,7 +75,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/6/src/tests.rs b/steps/6/src/tests.rs index 26dd7ed7..266ea5ed 100644 --- a/steps/6/src/tests.rs +++ b/steps/6/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,6 +73,7 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/7/src/tests.rs b/steps/7/src/tests.rs index 2717ddae..f6970db0 100644 --- a/steps/7/src/tests.rs +++ b/steps/7/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/8/src/tests.rs b/steps/8/src/tests.rs index 2717ddae..f6970db0 100644 --- a/steps/8/src/tests.rs +++ b/steps/8/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); } diff --git a/steps/9/src/tests.rs b/steps/9/src/tests.rs index 401092ae..a33f4de3 100644 --- a/steps/9/src/tests.rs +++ b/steps/9/src/tests.rs @@ -29,6 +29,9 @@ construct_runtime! { } } +const ALICE: u64 = 1; +const BOB: u64 = 2; + #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type Block = Block; @@ -52,6 +55,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .into() } +#[test] +fn starting_template_is_sane() { + new_test_ext().execute_with(|| { + let event = Event::::Created { owner: ALICE }; + let _runtime_event: RuntimeEvent = event.into(); + let _call = Call::::create_kitty {}; + let result = PalletKitties::create_kitty(RuntimeOrigin::signed(BOB)); + assert_ok!(result); + }); +} + #[test] fn system_and_balances_work() { // This test will just sanity check that we can access `System` and `Balances`. @@ -59,7 +73,8 @@ fn system_and_balances_work() { // We often need to set `System` to block 1 so that we can see events. System::set_block_number(1); // We often need to add some balance to a user to test features which needs tokens. - assert_ok!(Balances::mint_into(&1, 100)); + assert_ok!(Balances::mint_into(&ALICE, 100)); + assert_ok!(Balances::mint_into(&BOB, 100)); }); }