Skip to content

Commit

Permalink
some format and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shawntabrizi committed Aug 3, 2024
1 parent 816472e commit 387d985
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 22 deletions.
5 changes: 3 additions & 2 deletions steps/28/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use super::*;
use frame::prelude::*;
use frame::primitives::BlakeTwo256;
use frame::traits::Hash;

impl<T: Config> Pallet<T> {
// Generates and returns DNA and Sex
Expand All @@ -13,8 +15,7 @@ impl<T: Config> Pallet<T> {
CountForKitties::<T>::get(),
);

let encoded_payload: Vec<u8> = unique_payload.encode();
frame_support::Hashable::blake2_256(&encoded_payload)
BlakeTwo256::hash_of(&unique_payload).into()
}

pub fn mint(owner: T::AccountId, dna: [u8; 32]) -> DispatchResult {
Expand Down
5 changes: 3 additions & 2 deletions steps/29/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use super::*;
use frame::prelude::*;
use frame::primitives::BlakeTwo256;
use frame::traits::Hash;

impl<T: Config> Pallet<T> {
// Generates and returns DNA and Sex
Expand All @@ -13,8 +15,7 @@ impl<T: Config> Pallet<T> {
CountForKitties::<T>::get(),
);

let encoded_payload = unique_payload.encode();
frame_support::Hashable::blake2_256(&encoded_payload)
BlakeTwo256::hash_of(&unique_payload).into()
}

pub fn mint(owner: T::AccountId, dna: [u8; 32]) -> DispatchResult {
Expand Down
5 changes: 3 additions & 2 deletions steps/30/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use super::*;
use frame::prelude::*;
use frame::primitives::BlakeTwo256;
use frame::traits::Hash;

impl<T: Config> Pallet<T> {
// Generates and returns DNA and Sex
Expand All @@ -13,8 +15,7 @@ impl<T: Config> Pallet<T> {
CountForKitties::<T>::get(),
);

let encoded_payload = unique_payload.encode();
frame_support::Hashable::blake2_256(&encoded_payload)
BlakeTwo256::hash_of(&unique_payload).into()
}

pub fn mint(owner: T::AccountId, dna: [u8; 32]) -> DispatchResult {
Expand Down
5 changes: 3 additions & 2 deletions steps/31/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use super::*;
use frame::prelude::*;
use frame::primitives::BlakeTwo256;
use frame::traits::Hash;

impl<T: Config> Pallet<T> {
// Generates and returns DNA and Sex
Expand All @@ -13,8 +15,7 @@ impl<T: Config> Pallet<T> {
CountForKitties::<T>::get(),
);

let encoded_payload = unique_payload.encode();
frame_support::Hashable::blake2_256(&encoded_payload)
BlakeTwo256::hash_of(&unique_payload).into()
}

pub fn mint(owner: T::AccountId, dna: [u8; 32]) -> DispatchResult {
Expand Down
5 changes: 3 additions & 2 deletions steps/32/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use super::*;
use frame::prelude::*;
use frame::primitives::BlakeTwo256;
use frame::traits::Hash;

// Learn about internal functions.
impl<T: Config> Pallet<T> {
Expand All @@ -14,8 +16,7 @@ impl<T: Config> Pallet<T> {
CountForKitties::<T>::get(),
);

let encoded_payload = unique_payload.encode();
frame_support::Hashable::blake2_256(&encoded_payload)
BlakeTwo256::hash_of(&unique_payload).into()
}

pub fn mint(owner: T::AccountId, dna: [u8; 32]) -> DispatchResult {
Expand Down
5 changes: 3 additions & 2 deletions steps/33/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use super::*;
use frame::prelude::*;
use frame::primitives::BlakeTwo256;
use frame::traits::Hash;

// Learn about internal functions.
impl<T: Config> Pallet<T> {
Expand All @@ -14,8 +16,7 @@ impl<T: Config> Pallet<T> {
CountForKitties::<T>::get(),
);

let encoded_payload = unique_payload.encode();
frame_support::Hashable::blake2_256(&encoded_payload)
BlakeTwo256::hash_of(&unique_payload).into()
}

pub fn mint(owner: T::AccountId, dna: [u8; 32]) -> DispatchResult {
Expand Down
5 changes: 3 additions & 2 deletions steps/34/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use super::*;
use frame::prelude::*;
use frame::primitives::BlakeTwo256;
use frame::traits::Hash;

// Learn about internal functions.
impl<T: Config> Pallet<T> {
Expand All @@ -14,8 +16,7 @@ impl<T: Config> Pallet<T> {
CountForKitties::<T>::get(),
);

let encoded_payload = unique_payload.encode();
frame_support::Hashable::blake2_256(&encoded_payload)
BlakeTwo256::hash_of(&unique_payload).into()
}

pub fn mint(owner: T::AccountId, dna: [u8; 32]) -> DispatchResult {
Expand Down
5 changes: 3 additions & 2 deletions steps/35/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use super::*;
use frame::prelude::*;
use frame::primitives::BlakeTwo256;
use frame::traits::Hash;

// Learn about internal functions.
impl<T: Config> Pallet<T> {
Expand All @@ -14,8 +16,7 @@ impl<T: Config> Pallet<T> {
CountForKitties::<T>::get(),
);

let encoded_payload = unique_payload.encode();
frame_support::Hashable::blake2_256(&encoded_payload)
BlakeTwo256::hash_of(&unique_payload).into()
}

pub fn mint(owner: T::AccountId, dna: [u8; 32]) -> DispatchResult {
Expand Down
5 changes: 3 additions & 2 deletions steps/36/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use super::*;
use frame::prelude::*;
use frame::primitives::BlakeTwo256;
use frame::traits::Hash;

// Learn about internal functions.
impl<T: Config> Pallet<T> {
Expand All @@ -14,8 +16,7 @@ impl<T: Config> Pallet<T> {
CountForKitties::<T>::get(),
);

let encoded_payload = unique_payload.encode();
frame_support::Hashable::blake2_256(&encoded_payload)
BlakeTwo256::hash_of(&unique_payload).into()
}

pub fn mint(owner: T::AccountId, dna: [u8; 32]) -> DispatchResult {
Expand Down
5 changes: 3 additions & 2 deletions steps/37/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use super::*;
use frame::prelude::*;
use frame::primitives::BlakeTwo256;
use frame::traits::Hash;

// Learn about internal functions.
impl<T: Config> Pallet<T> {
Expand All @@ -14,8 +16,7 @@ impl<T: Config> Pallet<T> {
CountForKitties::<T>::get(),
);

let encoded_payload = unique_payload.encode();
frame_support::Hashable::blake2_256(&encoded_payload)
BlakeTwo256::hash_of(&unique_payload).into()
}

pub fn mint(owner: T::AccountId, dna: [u8; 32]) -> DispatchResult {
Expand Down
4 changes: 3 additions & 1 deletion steps/38/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use super::*;
use frame::{prelude::*, primitives::BlakeTwo256, traits::Hash};
use frame::prelude::*;
use frame::primitives::BlakeTwo256;
use frame::traits::Hash;

// Learn about internal functions.
impl<T: Config> Pallet<T> {
Expand Down
3 changes: 2 additions & 1 deletion steps/38/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ pub use pallet::*;
#[frame::pallet(dev_mode)]
pub mod pallet {
use super::*;
use frame::traits::fungible::{Inspect, Mutate};
use frame::traits::fungible::Inspect;
use frame::traits::fungible::Mutate;

#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
Expand Down

0 comments on commit 387d985

Please sign in to comment.