Skip to content

Commit

Permalink
Added Clone Trait
Browse files Browse the repository at this point in the history
This removes the errors one might get due to the unavailability of the `Clone` trait.
  • Loading branch information
0xScratch authored Oct 19, 2024
1 parent 31110e7 commit 0a64dab
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ That will look like:
```rust
impl<AccountId, Balance> Pallet<AccountId, Balance>
where
AccountId: Ord,
AccountId: Ord + Clone,
Balance: Zero + CheckedSub + CheckedAdd + Copy,
{
// functions which use these types and have access to the traits specified
Expand Down Expand Up @@ -133,7 +133,7 @@ pub struct Pallet {
/*
TODO:
The generic types need to satisfy certain traits in order to be used in the functions below.
- AccountId: Ord
- AccountId: Ord + Clone
- Balance: Zero + CheckedSub + CheckedAdd + Copy
You could figure these traits out yourself by letting the compiler tell you what you're missing.
Expand Down Expand Up @@ -195,4 +195,4 @@ pub struct Runtime {

Making the Balances Pallet generic is a crucial skill for creating flexible and scalable blockchain solutions. Great work on completing this lesson! 🌟

Post a screenshot in [#progress](https://discord.com/channels/898706705779687435/980906289968345128) showing your runtime with the new generic Balances Pallet in action. It better not still be using &'static str!
Post a screenshot in [#progress](https://discord.com/channels/898706705779687435/980906289968345128) showing your runtime with the new generic Balances Pallet in action. It better not still be using &'static str!

0 comments on commit 0a64dab

Please sign in to comment.