From b27f3b9246e1b9d5c5de00644f2203520f3068b4 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Fri, 2 Aug 2024 19:09:13 -0400 Subject: [PATCH] more cleanup --- steps/10/src/lib.rs | 1 - steps/11/src/impls.rs | 1 - steps/11/src/lib.rs | 1 - steps/12/src/impls.rs | 1 - steps/12/src/lib.rs | 1 - steps/13/src/impls.rs | 1 - steps/13/src/lib.rs | 1 - steps/14/src/impls.rs | 1 - steps/14/src/lib.rs | 1 - steps/15/src/impls.rs | 1 - steps/15/src/lib.rs | 1 - steps/16/src/impls.rs | 1 - steps/16/src/lib.rs | 1 - steps/17/src/impls.rs | 1 - steps/17/src/lib.rs | 1 - steps/18/src/impls.rs | 1 - steps/18/src/lib.rs | 1 - steps/19/src/impls.rs | 1 - steps/19/src/lib.rs | 1 - steps/20/src/impls.rs | 1 - steps/20/src/lib.rs | 1 - steps/21/src/impls.rs | 1 - steps/21/src/lib.rs | 1 - steps/22/src/impls.rs | 1 - steps/22/src/lib.rs | 1 - steps/23/src/impls.rs | 1 - steps/23/src/lib.rs | 1 - steps/24/src/impls.rs | 1 - steps/24/src/lib.rs | 1 - steps/25/src/impls.rs | 1 - steps/25/src/lib.rs | 1 - steps/26/src/impls.rs | 1 - steps/26/src/lib.rs | 1 - steps/27/src/impls.rs | 1 - steps/27/src/lib.rs | 1 - steps/28/src/impls.rs | 1 - steps/28/src/lib.rs | 1 - steps/29/src/impls.rs | 1 - steps/29/src/lib.rs | 1 - steps/30/src/impls.rs | 1 - steps/30/src/lib.rs | 1 - steps/31/src/impls.rs | 1 - steps/31/src/lib.rs | 1 - steps/32/src/impls.rs | 1 - steps/32/src/lib.rs | 1 - steps/33/src/impls.rs | 1 - steps/33/src/lib.rs | 1 - steps/34/src/impls.rs | 1 - steps/34/src/lib.rs | 1 - steps/35/src/impls.rs | 1 - steps/35/src/lib.rs | 1 - steps/36/src/impls.rs | 1 - steps/36/src/lib.rs | 1 - steps/37/src/impls.rs | 1 - steps/37/src/lib.rs | 1 - steps/38/src/impls.rs | 1 - steps/38/src/lib.rs | 1 - steps/39/src/impls.rs | 1 - steps/39/src/lib.rs | 1 - steps/40/src/impls.rs | 1 - steps/40/src/lib.rs | 1 - steps/41/src/impls.rs | 1 - steps/41/src/lib.rs | 1 - steps/42/src/impls.rs | 1 - steps/42/src/lib.rs | 1 - steps/43/src/impls.rs | 1 - steps/43/src/lib.rs | 1 - steps/44/src/impls.rs | 1 - steps/44/src/lib.rs | 1 - steps/45/src/impls.rs | 1 - steps/45/src/lib.rs | 1 - steps/46/src/impls.rs | 1 - steps/46/src/lib.rs | 1 - steps/5/src/impls.rs | 2 +- steps/5/src/lib.rs | 2 +- steps/6/src/impls.rs | 1 - steps/6/src/lib.rs | 3 +-- steps/7/src/impls.rs | 1 - steps/7/src/lib.rs | 1 - steps/8/src/impls.rs | 1 - steps/8/src/lib.rs | 1 - steps/9/src/impls.rs | 1 - steps/9/src/lib.rs | 1 - 83 files changed, 3 insertions(+), 84 deletions(-) diff --git a/steps/10/src/lib.rs b/steps/10/src/lib.rs index 3f71eacd..c42eeda5 100644 --- a/steps/10/src/lib.rs +++ b/steps/10/src/lib.rs @@ -36,7 +36,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; Self::mint(who)?; Ok(()) diff --git a/steps/11/src/impls.rs b/steps/11/src/impls.rs index ef53a56f..cabecf1e 100644 --- a/steps/11/src/impls.rs +++ b/steps/11/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId) -> DispatchResult { let current_count: u64 = CountForKitties::::get().unwrap_or(0); let new_count = current_count + 1; diff --git a/steps/11/src/lib.rs b/steps/11/src/lib.rs index 3f71eacd..c42eeda5 100644 --- a/steps/11/src/lib.rs +++ b/steps/11/src/lib.rs @@ -36,7 +36,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; Self::mint(who)?; Ok(()) diff --git a/steps/12/src/impls.rs b/steps/12/src/impls.rs index ba4070f5..dba24b9f 100644 --- a/steps/12/src/impls.rs +++ b/steps/12/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId) -> DispatchResult { let current_count: u64 = CountForKitties::::get().unwrap_or(0); /* TODO: Update this logic to use safe math. */ diff --git a/steps/12/src/lib.rs b/steps/12/src/lib.rs index 1cbe1b6f..c991780e 100644 --- a/steps/12/src/lib.rs +++ b/steps/12/src/lib.rs @@ -40,7 +40,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; Self::mint(who)?; Ok(()) diff --git a/steps/13/src/impls.rs b/steps/13/src/impls.rs index 9481d053..7256a66d 100644 --- a/steps/13/src/impls.rs +++ b/steps/13/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId) -> DispatchResult { let current_count: u64 = CountForKitties::::get().unwrap_or(0); let new_count = current_count.checked_add(1).ok_or(Error::::TooManyKitties)?; diff --git a/steps/13/src/lib.rs b/steps/13/src/lib.rs index 360f5a29..882dfff2 100644 --- a/steps/13/src/lib.rs +++ b/steps/13/src/lib.rs @@ -38,7 +38,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; Self::mint(who)?; Ok(()) diff --git a/steps/14/src/impls.rs b/steps/14/src/impls.rs index 99141c05..385b7e09 100644 --- a/steps/14/src/impls.rs +++ b/steps/14/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId) -> DispatchResult { /* TODO: Remove the `unwrap_or` which is not needed when using `ValueQuery`. */ let current_count: u64 = CountForKitties::::get().unwrap_or(0); diff --git a/steps/14/src/lib.rs b/steps/14/src/lib.rs index d06f4817..0e3151d2 100644 --- a/steps/14/src/lib.rs +++ b/steps/14/src/lib.rs @@ -39,7 +39,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; Self::mint(who)?; Ok(()) diff --git a/steps/15/src/impls.rs b/steps/15/src/impls.rs index 1af97cbb..ca7e21bf 100644 --- a/steps/15/src/impls.rs +++ b/steps/15/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId) -> DispatchResult { let current_count: u64 = CountForKitties::::get(); let new_count = current_count.checked_add(1).ok_or(Error::::TooManyKitties)?; diff --git a/steps/15/src/lib.rs b/steps/15/src/lib.rs index 84a5cb85..758c6429 100644 --- a/steps/15/src/lib.rs +++ b/steps/15/src/lib.rs @@ -38,7 +38,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; Self::mint(who)?; Ok(()) diff --git a/steps/16/src/impls.rs b/steps/16/src/impls.rs index 1af97cbb..ca7e21bf 100644 --- a/steps/16/src/impls.rs +++ b/steps/16/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId) -> DispatchResult { let current_count: u64 = CountForKitties::::get(); let new_count = current_count.checked_add(1).ok_or(Error::::TooManyKitties)?; diff --git a/steps/16/src/lib.rs b/steps/16/src/lib.rs index ca5b7bf8..756cd516 100644 --- a/steps/16/src/lib.rs +++ b/steps/16/src/lib.rs @@ -42,7 +42,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; Self::mint(who)?; Ok(()) diff --git a/steps/17/src/impls.rs b/steps/17/src/impls.rs index e4449c96..25c7a272 100644 --- a/steps/17/src/impls.rs +++ b/steps/17/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. /* TODO: Update this function signature to include `id` which is type `[u8; 16]`. */ pub fn mint(owner: T::AccountId) -> DispatchResult { let current_count: u64 = CountForKitties::::get(); diff --git a/steps/17/src/lib.rs b/steps/17/src/lib.rs index b4183194..081fa9fd 100644 --- a/steps/17/src/lib.rs +++ b/steps/17/src/lib.rs @@ -42,7 +42,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; /* TODO: Create `const default_id`, which type `[u8; 16]` and has value `[0u8; 16]`. */ /* TODO: Pass `default_id` to the `mint` function as a second parameter. */ diff --git a/steps/18/src/impls.rs b/steps/18/src/impls.rs index c8320f87..9cd37fd9 100644 --- a/steps/18/src/impls.rs +++ b/steps/18/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let current_count: u64 = CountForKitties::::get(); let new_count = current_count.checked_add(1).ok_or(Error::::TooManyKitties)?; diff --git a/steps/18/src/lib.rs b/steps/18/src/lib.rs index 118b68bb..8ebd1c25 100644 --- a/steps/18/src/lib.rs +++ b/steps/18/src/lib.rs @@ -42,7 +42,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = [0u8; 16]; Self::mint(who, dna)?; diff --git a/steps/19/src/impls.rs b/steps/19/src/impls.rs index c9848947..88698f87 100644 --- a/steps/19/src/impls.rs +++ b/steps/19/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { /* TODO: - `ensure!` that `Kitties` map does not `contains_key` for `dna`. diff --git a/steps/19/src/lib.rs b/steps/19/src/lib.rs index 21c00603..75b79635 100644 --- a/steps/19/src/lib.rs +++ b/steps/19/src/lib.rs @@ -43,7 +43,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = [0u8; 16]; Self::mint(who, dna)?; diff --git a/steps/20/src/impls.rs b/steps/20/src/impls.rs index 650fdfbe..50d614b0 100644 --- a/steps/20/src/impls.rs +++ b/steps/20/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { // Check if the kitty does not already exist in our storage map ensure!(!Kitties::::contains_key(dna), Error::::DuplicateKitty); diff --git a/steps/20/src/lib.rs b/steps/20/src/lib.rs index d15f278a..ba2fcc92 100644 --- a/steps/20/src/lib.rs +++ b/steps/20/src/lib.rs @@ -43,7 +43,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = [0u8; 16]; Self::mint(who, dna)?; diff --git a/steps/21/src/impls.rs b/steps/21/src/impls.rs index 650fdfbe..50d614b0 100644 --- a/steps/21/src/impls.rs +++ b/steps/21/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { // Check if the kitty does not already exist in our storage map ensure!(!Kitties::::contains_key(dna), Error::::DuplicateKitty); diff --git a/steps/21/src/lib.rs b/steps/21/src/lib.rs index d15f278a..ba2fcc92 100644 --- a/steps/21/src/lib.rs +++ b/steps/21/src/lib.rs @@ -43,7 +43,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = [0u8; 16]; Self::mint(who, dna)?; diff --git a/steps/22/src/impls.rs b/steps/22/src/impls.rs index 650fdfbe..50d614b0 100644 --- a/steps/22/src/impls.rs +++ b/steps/22/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { // Check if the kitty does not already exist in our storage map ensure!(!Kitties::::contains_key(dna), Error::::DuplicateKitty); diff --git a/steps/22/src/lib.rs b/steps/22/src/lib.rs index 536e024a..10db913d 100644 --- a/steps/22/src/lib.rs +++ b/steps/22/src/lib.rs @@ -51,7 +51,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = [0u8; 16]; Self::mint(who, dna)?; diff --git a/steps/23/src/impls.rs b/steps/23/src/impls.rs index 650fdfbe..50d614b0 100644 --- a/steps/23/src/impls.rs +++ b/steps/23/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { // Check if the kitty does not already exist in our storage map ensure!(!Kitties::::contains_key(dna), Error::::DuplicateKitty); diff --git a/steps/23/src/lib.rs b/steps/23/src/lib.rs index 865972e9..f76a732f 100644 --- a/steps/23/src/lib.rs +++ b/steps/23/src/lib.rs @@ -49,7 +49,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = [0u8; 16]; Self::mint(who, dna)?; diff --git a/steps/24/src/impls.rs b/steps/24/src/impls.rs index 4b507f20..ef9d0c1d 100644 --- a/steps/24/src/impls.rs +++ b/steps/24/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { /* Create a new variable `kitty` which is a `Kitty` struct with `dna` and `owner`. */ diff --git a/steps/24/src/lib.rs b/steps/24/src/lib.rs index 38d7ef68..0c9728ef 100644 --- a/steps/24/src/lib.rs +++ b/steps/24/src/lib.rs @@ -54,7 +54,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = [0u8; 16]; Self::mint(who, dna)?; diff --git a/steps/25/src/impls.rs b/steps/25/src/impls.rs index 5ec6eb65..46d02909 100644 --- a/steps/25/src/impls.rs +++ b/steps/25/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone() }; // Check if the kitty does not already exist in our storage map diff --git a/steps/25/src/lib.rs b/steps/25/src/lib.rs index da4e8942..e62e28b6 100644 --- a/steps/25/src/lib.rs +++ b/steps/25/src/lib.rs @@ -51,7 +51,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = [0u8; 16]; Self::mint(who, dna)?; diff --git a/steps/26/src/impls.rs b/steps/26/src/impls.rs index 4a482eda..e70943c2 100644 --- a/steps/26/src/impls.rs +++ b/steps/26/src/impls.rs @@ -13,7 +13,6 @@ impl Pallet { - Return the 16 byte hash. */ - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone() }; // Check if the kitty does not already exist in our storage map diff --git a/steps/26/src/lib.rs b/steps/26/src/lib.rs index 2f0cd7b0..9548106c 100644 --- a/steps/26/src/lib.rs +++ b/steps/26/src/lib.rs @@ -51,7 +51,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; /* TODO: Use the `Self::gen_dna()` function to generate a unique Kitty. */ let dna = [0u8; 16]; diff --git a/steps/27/src/impls.rs b/steps/27/src/impls.rs index 1088c864..25786f65 100644 --- a/steps/27/src/impls.rs +++ b/steps/27/src/impls.rs @@ -17,7 +17,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone() }; // Check if the kitty does not already exist in our storage map diff --git a/steps/27/src/lib.rs b/steps/27/src/lib.rs index fdafef6c..efc2c0ff 100644 --- a/steps/27/src/lib.rs +++ b/steps/27/src/lib.rs @@ -51,7 +51,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/28/src/impls.rs b/steps/28/src/impls.rs index 9678a42b..7eff3c0c 100644 --- a/steps/28/src/impls.rs +++ b/steps/28/src/impls.rs @@ -17,7 +17,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone() }; // Check if the kitty does not already exist in our storage map diff --git a/steps/28/src/lib.rs b/steps/28/src/lib.rs index d594ff55..c208e983 100644 --- a/steps/28/src/lib.rs +++ b/steps/28/src/lib.rs @@ -57,7 +57,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/29/src/impls.rs b/steps/29/src/impls.rs index b91e9554..52636e45 100644 --- a/steps/29/src/impls.rs +++ b/steps/29/src/impls.rs @@ -17,7 +17,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone() }; // Check if the kitty does not already exist in our storage map diff --git a/steps/29/src/lib.rs b/steps/29/src/lib.rs index d8a32001..9863f11c 100644 --- a/steps/29/src/lib.rs +++ b/steps/29/src/lib.rs @@ -56,7 +56,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/30/src/impls.rs b/steps/30/src/impls.rs index 1d20f328..75f55438 100644 --- a/steps/30/src/impls.rs +++ b/steps/30/src/impls.rs @@ -17,7 +17,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone() }; // Check if the kitty does not already exist in our storage map diff --git a/steps/30/src/lib.rs b/steps/30/src/lib.rs index 64c5196b..c2657e74 100644 --- a/steps/30/src/lib.rs +++ b/steps/30/src/lib.rs @@ -61,7 +61,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/31/src/impls.rs b/steps/31/src/impls.rs index 300924a7..a6162535 100644 --- a/steps/31/src/impls.rs +++ b/steps/31/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone() }; // Check if the kitty does not already exist in our storage map diff --git a/steps/31/src/lib.rs b/steps/31/src/lib.rs index d2263ea3..d8158b33 100644 --- a/steps/31/src/lib.rs +++ b/steps/31/src/lib.rs @@ -60,7 +60,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/32/src/impls.rs b/steps/32/src/impls.rs index 300924a7..a6162535 100644 --- a/steps/32/src/impls.rs +++ b/steps/32/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone() }; // Check if the kitty does not already exist in our storage map diff --git a/steps/32/src/lib.rs b/steps/32/src/lib.rs index d2263ea3..d8158b33 100644 --- a/steps/32/src/lib.rs +++ b/steps/32/src/lib.rs @@ -60,7 +60,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/33/src/impls.rs b/steps/33/src/impls.rs index b2b0d678..727b21ad 100644 --- a/steps/33/src/impls.rs +++ b/steps/33/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone() }; // Check if the kitty does not already exist in our storage map diff --git a/steps/33/src/lib.rs b/steps/33/src/lib.rs index 5f561fb6..a07b5a4a 100644 --- a/steps/33/src/lib.rs +++ b/steps/33/src/lib.rs @@ -66,7 +66,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/34/src/impls.rs b/steps/34/src/impls.rs index 8210525e..cd109fa7 100644 --- a/steps/34/src/impls.rs +++ b/steps/34/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone() }; // Check if the kitty does not already exist in our storage map diff --git a/steps/34/src/lib.rs b/steps/34/src/lib.rs index 1758fb1f..ef6657d4 100644 --- a/steps/34/src/lib.rs +++ b/steps/34/src/lib.rs @@ -61,7 +61,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/35/src/impls.rs b/steps/35/src/impls.rs index 97b5febb..0916ec63 100644 --- a/steps/35/src/impls.rs +++ b/steps/35/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone() }; // Check if the kitty does not already exist in our storage map diff --git a/steps/35/src/lib.rs b/steps/35/src/lib.rs index 199989a9..cfd484eb 100644 --- a/steps/35/src/lib.rs +++ b/steps/35/src/lib.rs @@ -66,7 +66,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/36/src/impls.rs b/steps/36/src/impls.rs index 502cfc12..f7e42c4c 100644 --- a/steps/36/src/impls.rs +++ b/steps/36/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone() }; // Check if the kitty does not already exist in our storage map diff --git a/steps/36/src/lib.rs b/steps/36/src/lib.rs index 6d59db7d..3db04f82 100644 --- a/steps/36/src/lib.rs +++ b/steps/36/src/lib.rs @@ -64,7 +64,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/37/src/impls.rs b/steps/37/src/impls.rs index 502cfc12..f7e42c4c 100644 --- a/steps/37/src/impls.rs +++ b/steps/37/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone() }; // Check if the kitty does not already exist in our storage map diff --git a/steps/37/src/lib.rs b/steps/37/src/lib.rs index 2f8a5f49..d41ea5d8 100644 --- a/steps/37/src/lib.rs +++ b/steps/37/src/lib.rs @@ -70,7 +70,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/38/src/impls.rs b/steps/38/src/impls.rs index 765ad4f0..837d6839 100644 --- a/steps/38/src/impls.rs +++ b/steps/38/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone(), price: None }; // Check if the kitty does not already exist in our storage map diff --git a/steps/38/src/lib.rs b/steps/38/src/lib.rs index 24d0bcab..5b82e724 100644 --- a/steps/38/src/lib.rs +++ b/steps/38/src/lib.rs @@ -75,7 +75,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/39/src/impls.rs b/steps/39/src/impls.rs index 0afb6dfa..4e42ed36 100644 --- a/steps/39/src/impls.rs +++ b/steps/39/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone(), price: None }; // Check if the kitty does not already exist in our storage map diff --git a/steps/39/src/lib.rs b/steps/39/src/lib.rs index ce18c6b0..e956f498 100644 --- a/steps/39/src/lib.rs +++ b/steps/39/src/lib.rs @@ -80,7 +80,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/40/src/impls.rs b/steps/40/src/impls.rs index d844db66..fe09c2bd 100644 --- a/steps/40/src/impls.rs +++ b/steps/40/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone(), price: None }; // Check if the kitty does not already exist in our storage map diff --git a/steps/40/src/lib.rs b/steps/40/src/lib.rs index 5489572e..82d5582b 100644 --- a/steps/40/src/lib.rs +++ b/steps/40/src/lib.rs @@ -76,7 +76,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/41/src/impls.rs b/steps/41/src/impls.rs index d89803c7..e81d24f5 100644 --- a/steps/41/src/impls.rs +++ b/steps/41/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone(), price: None }; // Check if the kitty does not already exist in our storage map diff --git a/steps/41/src/lib.rs b/steps/41/src/lib.rs index 5489572e..82d5582b 100644 --- a/steps/41/src/lib.rs +++ b/steps/41/src/lib.rs @@ -76,7 +76,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/42/src/impls.rs b/steps/42/src/impls.rs index d53238cb..8d15d2a7 100644 --- a/steps/42/src/impls.rs +++ b/steps/42/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone(), price: None }; // Check if the kitty does not already exist in our storage map diff --git a/steps/42/src/lib.rs b/steps/42/src/lib.rs index 5489572e..82d5582b 100644 --- a/steps/42/src/lib.rs +++ b/steps/42/src/lib.rs @@ -76,7 +76,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/43/src/impls.rs b/steps/43/src/impls.rs index d2b20157..23a6f0c9 100644 --- a/steps/43/src/impls.rs +++ b/steps/43/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone(), price: None }; // Check if the kitty does not already exist in our storage map diff --git a/steps/43/src/lib.rs b/steps/43/src/lib.rs index 32a5134e..729985b9 100644 --- a/steps/43/src/lib.rs +++ b/steps/43/src/lib.rs @@ -81,7 +81,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/44/src/impls.rs b/steps/44/src/impls.rs index 0f425a08..ffa4ebc0 100644 --- a/steps/44/src/impls.rs +++ b/steps/44/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone(), price: None }; // Check if the kitty does not already exist in our storage map diff --git a/steps/44/src/lib.rs b/steps/44/src/lib.rs index 0c23bf1f..2ff1e208 100644 --- a/steps/44/src/lib.rs +++ b/steps/44/src/lib.rs @@ -77,7 +77,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/45/src/impls.rs b/steps/45/src/impls.rs index 415b4e7b..2d67e047 100644 --- a/steps/45/src/impls.rs +++ b/steps/45/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone(), price: None }; // Check if the kitty does not already exist in our storage map diff --git a/steps/45/src/lib.rs b/steps/45/src/lib.rs index 128d57c5..4757b140 100644 --- a/steps/45/src/lib.rs +++ b/steps/45/src/lib.rs @@ -81,7 +81,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/46/src/impls.rs b/steps/46/src/impls.rs index 4770d83b..64fd0c81 100644 --- a/steps/46/src/impls.rs +++ b/steps/46/src/impls.rs @@ -18,7 +18,6 @@ impl Pallet { frame_support::Hashable::blake2_128(&encoded_payload) } - // Learn about `AccountId`. pub fn mint(owner: T::AccountId, dna: [u8; 16]) -> DispatchResult { let kitty = Kitty { dna, owner: owner.clone(), price: None }; // Check if the kitty does not already exist in our storage map diff --git a/steps/46/src/lib.rs b/steps/46/src/lib.rs index 33af2bce..c0595712 100644 --- a/steps/46/src/lib.rs +++ b/steps/46/src/lib.rs @@ -79,7 +79,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; let dna = Self::gen_dna(); Self::mint(who, dna)?; diff --git a/steps/5/src/impls.rs b/steps/5/src/impls.rs index 869c781c..aeeb7a08 100644 --- a/steps/5/src/impls.rs +++ b/steps/5/src/impls.rs @@ -2,7 +2,7 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. + /* TODO: Learn about `AccountId`. */ pub fn mint(owner: T::AccountId) -> DispatchResult { Self::deposit_event(Event::::Created { owner }); Ok(()) diff --git a/steps/5/src/lib.rs b/steps/5/src/lib.rs index 0cb07769..b0663a69 100644 --- a/steps/5/src/lib.rs +++ b/steps/5/src/lib.rs @@ -30,7 +30,7 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. + /* TODO: Learn about origin. */ let who = ensure_signed(origin)?; Self::mint(who)?; Ok(()) diff --git a/steps/6/src/impls.rs b/steps/6/src/impls.rs index 869c781c..d49f793b 100644 --- a/steps/6/src/impls.rs +++ b/steps/6/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId) -> DispatchResult { Self::deposit_event(Event::::Created { owner }); Ok(()) diff --git a/steps/6/src/lib.rs b/steps/6/src/lib.rs index 55715012..f8b3ab59 100644 --- a/steps/6/src/lib.rs +++ b/steps/6/src/lib.rs @@ -13,7 +13,7 @@ pub mod pallet { #[pallet::pallet] pub struct Pallet(_); - // Learn about frame_system, and `Config`. + /* TODO: Learn about Pallet `Config` and `frame_system`. */ #[pallet::config] pub trait Config: frame_system::Config { type RuntimeEvent: From> + IsType<::RuntimeEvent>; @@ -31,7 +31,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; Self::mint(who)?; Ok(()) diff --git a/steps/7/src/impls.rs b/steps/7/src/impls.rs index 869c781c..d49f793b 100644 --- a/steps/7/src/impls.rs +++ b/steps/7/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId) -> DispatchResult { Self::deposit_event(Event::::Created { owner }); Ok(()) diff --git a/steps/7/src/lib.rs b/steps/7/src/lib.rs index d0f9f36d..e6f38dbf 100644 --- a/steps/7/src/lib.rs +++ b/steps/7/src/lib.rs @@ -32,7 +32,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; Self::mint(who)?; Ok(()) diff --git a/steps/8/src/impls.rs b/steps/8/src/impls.rs index 869c781c..d49f793b 100644 --- a/steps/8/src/impls.rs +++ b/steps/8/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId) -> DispatchResult { Self::deposit_event(Event::::Created { owner }); Ok(()) diff --git a/steps/8/src/lib.rs b/steps/8/src/lib.rs index d0f9f36d..e6f38dbf 100644 --- a/steps/8/src/lib.rs +++ b/steps/8/src/lib.rs @@ -32,7 +32,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; Self::mint(who)?; Ok(()) diff --git a/steps/9/src/impls.rs b/steps/9/src/impls.rs index 869c781c..d49f793b 100644 --- a/steps/9/src/impls.rs +++ b/steps/9/src/impls.rs @@ -2,7 +2,6 @@ use super::*; use frame_support::pallet_prelude::*; impl Pallet { - // Learn about `AccountId`. pub fn mint(owner: T::AccountId) -> DispatchResult { Self::deposit_event(Event::::Created { owner }); Ok(()) diff --git a/steps/9/src/lib.rs b/steps/9/src/lib.rs index 3f71eacd..c42eeda5 100644 --- a/steps/9/src/lib.rs +++ b/steps/9/src/lib.rs @@ -36,7 +36,6 @@ pub mod pallet { #[pallet::call] impl Pallet { pub fn create_kitty(origin: OriginFor) -> DispatchResult { - // Learn about `origin`. let who = ensure_signed(origin)?; Self::mint(who)?; Ok(())