From 038853f32ae68e19ce5828ff6ad21d28774596a8 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Fri, 13 Sep 2024 15:02:34 -0400 Subject: [PATCH] fix some tests --- steps/15/src/tests.rs | 5 ----- steps/16/src/tests.rs | 5 ----- steps/17/src/tests.rs | 5 ----- steps/18/src/tests.rs | 5 ----- steps/19/src/tests.rs | 11 +++-------- steps/20/src/tests.rs | 11 +++-------- steps/21/src/tests.rs | 11 +++-------- steps/22/src/tests.rs | 11 +++-------- steps/23/src/tests.rs | 11 +++-------- steps/24/src/tests.rs | 11 +++-------- steps/25/src/tests.rs | 11 +++-------- steps/26/src/tests.rs | 11 +++-------- steps/27/src/tests.rs | 11 +++-------- steps/28/src/tests.rs | 11 +++-------- steps/29/src/tests.rs | 11 +++-------- steps/30/src/tests.rs | 11 +++-------- steps/31/src/tests.rs | 11 +++-------- steps/32/src/tests.rs | 11 +++-------- steps/33/src/tests.rs | 11 +++-------- steps/34/src/tests.rs | 11 +++-------- steps/35/src/tests.rs | 11 +++-------- steps/36/src/tests.rs | 11 +++-------- steps/37/src/tests.rs | 11 +++-------- steps/38/src/tests.rs | 11 +++-------- steps/39/src/tests.rs | 11 +++-------- steps/40/src/tests.rs | 11 +++-------- steps/41/src/tests.rs | 11 +++-------- steps/42/src/tests.rs | 11 +++-------- steps/43/src/tests.rs | 11 +++-------- steps/44/src/tests.rs | 11 +++-------- steps/45/src/tests.rs | 11 +++-------- steps/46/src/tests.rs | 11 +++-------- steps/47/src/tests.rs | 11 +++-------- steps/48/src/tests.rs | 11 +++-------- steps/49/src/tests.rs | 11 +++-------- steps/50/src/tests.rs | 11 +++-------- steps/51/src/tests.rs | 11 +++-------- steps/52/src/tests.rs | 11 +++-------- steps/53/src/tests.rs | 11 +++-------- steps/54/src/tests.rs | 11 +++-------- 40 files changed, 108 insertions(+), 308 deletions(-) diff --git a/steps/15/src/tests.rs b/steps/15/src/tests.rs index aa02ffa9..6c8a90c2 100644 --- a/steps/15/src/tests.rs +++ b/steps/15/src/tests.rs @@ -121,10 +121,5 @@ fn mint_increments_count_for_kitty() { assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), Some(1)); - // Let's call it two more times... - assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(2))); - assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(3))); - // Now the storage should be `Some(3)` - assert_eq!(CountForKitties::::get(), Some(3)); }) } diff --git a/steps/16/src/tests.rs b/steps/16/src/tests.rs index aa02ffa9..6c8a90c2 100644 --- a/steps/16/src/tests.rs +++ b/steps/16/src/tests.rs @@ -121,10 +121,5 @@ fn mint_increments_count_for_kitty() { assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), Some(1)); - // Let's call it two more times... - assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(2))); - assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(3))); - // Now the storage should be `Some(3)` - assert_eq!(CountForKitties::::get(), Some(3)); }) } diff --git a/steps/17/src/tests.rs b/steps/17/src/tests.rs index 19cbedde..25e59176 100644 --- a/steps/17/src/tests.rs +++ b/steps/17/src/tests.rs @@ -121,11 +121,6 @@ fn mint_increments_count_for_kitty() { assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), Some(1)); - // Let's call it two more times... - assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(2))); - assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(3))); - // Now the storage should be `Some(3)` - assert_eq!(CountForKitties::::get(), Some(3)); }) } diff --git a/steps/18/src/tests.rs b/steps/18/src/tests.rs index 19cbedde..25e59176 100644 --- a/steps/18/src/tests.rs +++ b/steps/18/src/tests.rs @@ -121,11 +121,6 @@ fn mint_increments_count_for_kitty() { assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), Some(1)); - // Let's call it two more times... - assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(2))); - assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(3))); - // Now the storage should be `Some(3)` - assert_eq!(CountForKitties::::get(), Some(3)); }) } diff --git a/steps/19/src/tests.rs b/steps/19/src/tests.rs index 7cd94b57..8687a532 100644 --- a/steps/19/src/tests.rs +++ b/steps/19/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/20/src/tests.rs b/steps/20/src/tests.rs index 7cd94b57..8687a532 100644 --- a/steps/20/src/tests.rs +++ b/steps/20/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/21/src/tests.rs b/steps/21/src/tests.rs index 8877de04..10a33f0b 100644 --- a/steps/21/src/tests.rs +++ b/steps/21/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/22/src/tests.rs b/steps/22/src/tests.rs index 8877de04..10a33f0b 100644 --- a/steps/22/src/tests.rs +++ b/steps/22/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/23/src/tests.rs b/steps/23/src/tests.rs index 312a2308..a3731687 100644 --- a/steps/23/src/tests.rs +++ b/steps/23/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/24/src/tests.rs b/steps/24/src/tests.rs index 312a2308..a3731687 100644 --- a/steps/24/src/tests.rs +++ b/steps/24/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/25/src/tests.rs b/steps/25/src/tests.rs index efff2798..cc707d14 100644 --- a/steps/25/src/tests.rs +++ b/steps/25/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/26/src/tests.rs b/steps/26/src/tests.rs index efff2798..cc707d14 100644 --- a/steps/26/src/tests.rs +++ b/steps/26/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/27/src/tests.rs b/steps/27/src/tests.rs index efff2798..cc707d14 100644 --- a/steps/27/src/tests.rs +++ b/steps/27/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/28/src/tests.rs b/steps/28/src/tests.rs index d8fa8e1c..c97cede3 100644 --- a/steps/28/src/tests.rs +++ b/steps/28/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/29/src/tests.rs b/steps/29/src/tests.rs index d8fa8e1c..c97cede3 100644 --- a/steps/29/src/tests.rs +++ b/steps/29/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/30/src/tests.rs b/steps/30/src/tests.rs index 1fb90372..6ad9942e 100644 --- a/steps/30/src/tests.rs +++ b/steps/30/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/31/src/tests.rs b/steps/31/src/tests.rs index 1fb90372..6ad9942e 100644 --- a/steps/31/src/tests.rs +++ b/steps/31/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/32/src/tests.rs b/steps/32/src/tests.rs index dcb8fcfb..31a4266b 100644 --- a/steps/32/src/tests.rs +++ b/steps/32/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/33/src/tests.rs b/steps/33/src/tests.rs index dcb8fcfb..31a4266b 100644 --- a/steps/33/src/tests.rs +++ b/steps/33/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/34/src/tests.rs b/steps/34/src/tests.rs index 522f81ad..411e21cd 100644 --- a/steps/34/src/tests.rs +++ b/steps/34/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/35/src/tests.rs b/steps/35/src/tests.rs index 522f81ad..411e21cd 100644 --- a/steps/35/src/tests.rs +++ b/steps/35/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/36/src/tests.rs b/steps/36/src/tests.rs index 0f5c0aae..9d681219 100644 --- a/steps/36/src/tests.rs +++ b/steps/36/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/37/src/tests.rs b/steps/37/src/tests.rs index 0f5c0aae..9d681219 100644 --- a/steps/37/src/tests.rs +++ b/steps/37/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/38/src/tests.rs b/steps/38/src/tests.rs index 0f5c0aae..9d681219 100644 --- a/steps/38/src/tests.rs +++ b/steps/38/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/39/src/tests.rs b/steps/39/src/tests.rs index 24e41cc6..010a4c5d 100644 --- a/steps/39/src/tests.rs +++ b/steps/39/src/tests.rs @@ -116,15 +116,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/40/src/tests.rs b/steps/40/src/tests.rs index 24e41cc6..010a4c5d 100644 --- a/steps/40/src/tests.rs +++ b/steps/40/src/tests.rs @@ -116,15 +116,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/41/src/tests.rs b/steps/41/src/tests.rs index 4542661a..94a44fbd 100644 --- a/steps/41/src/tests.rs +++ b/steps/41/src/tests.rs @@ -116,15 +116,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/42/src/tests.rs b/steps/42/src/tests.rs index 4542661a..94a44fbd 100644 --- a/steps/42/src/tests.rs +++ b/steps/42/src/tests.rs @@ -116,15 +116,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/43/src/tests.rs b/steps/43/src/tests.rs index 9168e31f..cf9535d8 100644 --- a/steps/43/src/tests.rs +++ b/steps/43/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/44/src/tests.rs b/steps/44/src/tests.rs index 9168e31f..cf9535d8 100644 --- a/steps/44/src/tests.rs +++ b/steps/44/src/tests.rs @@ -117,15 +117,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/45/src/tests.rs b/steps/45/src/tests.rs index e6c48814..871526ca 100644 --- a/steps/45/src/tests.rs +++ b/steps/45/src/tests.rs @@ -119,15 +119,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/46/src/tests.rs b/steps/46/src/tests.rs index e6c48814..871526ca 100644 --- a/steps/46/src/tests.rs +++ b/steps/46/src/tests.rs @@ -119,15 +119,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/47/src/tests.rs b/steps/47/src/tests.rs index 2558284e..990d4081 100644 --- a/steps/47/src/tests.rs +++ b/steps/47/src/tests.rs @@ -119,15 +119,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/48/src/tests.rs b/steps/48/src/tests.rs index 2558284e..990d4081 100644 --- a/steps/48/src/tests.rs +++ b/steps/48/src/tests.rs @@ -119,15 +119,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/49/src/tests.rs b/steps/49/src/tests.rs index a04be004..e61de66e 100644 --- a/steps/49/src/tests.rs +++ b/steps/49/src/tests.rs @@ -119,15 +119,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/50/src/tests.rs b/steps/50/src/tests.rs index a04be004..e61de66e 100644 --- a/steps/50/src/tests.rs +++ b/steps/50/src/tests.rs @@ -119,15 +119,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/51/src/tests.rs b/steps/51/src/tests.rs index 742ee810..bd56a5db 100644 --- a/steps/51/src/tests.rs +++ b/steps/51/src/tests.rs @@ -119,15 +119,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/52/src/tests.rs b/steps/52/src/tests.rs index 742ee810..bd56a5db 100644 --- a/steps/52/src/tests.rs +++ b/steps/52/src/tests.rs @@ -119,15 +119,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/53/src/tests.rs b/steps/53/src/tests.rs index 0109061b..5cce3afc 100644 --- a/steps/53/src/tests.rs +++ b/steps/53/src/tests.rs @@ -119,15 +119,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) } diff --git a/steps/54/src/tests.rs b/steps/54/src/tests.rs index 0109061b..5cce3afc 100644 --- a/steps/54/src/tests.rs +++ b/steps/54/src/tests.rs @@ -119,15 +119,10 @@ fn mint_increments_count_for_kitty() { new_test_ext().execute_with(|| { // Querying storage before anything is set will return `0`. assert_eq!(CountForKitties::::get(), 0); - // Call `mint` to create a new kitty. - assert_ok!(PalletKitties::mint(1, [1u8; 32])); - // Now the storage should be `1` + // Call `create_kitty` which will call `mint`. + assert_ok!(PalletKitties::create_kitty(RuntimeOrigin::signed(1))); + // Now the storage should be `Some(1)` assert_eq!(CountForKitties::::get(), 1); - // Let's call it two more times... - assert_ok!(PalletKitties::mint(2, [2u8; 32])); - assert_ok!(PalletKitties::mint(3, [3u8; 32])); - // Now the storage should be `3` - assert_eq!(CountForKitties::::get(), 3); }) }