-
Notifications
You must be signed in to change notification settings - Fork 10
feat(nfts + nonfungibles): sync polkadot stable2503 #558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: al3mart/sync-polkadot-stable2503
Are you sure you want to change the base?
feat(nfts + nonfungibles): sync polkadot stable2503 #558
Conversation
[sc-3710] |
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## al3mart/sync-polkadot-stable2503 #558 +/- ##
====================================================================
+ Coverage 63.88% 63.98% +0.09%
====================================================================
Files 120 120
Lines 23686 23640 -46
Branches 23686 23640 -46
====================================================================
- Hits 15132 15125 -7
+ Misses 7514 7475 -39
Partials 1040 1040
🚀 New features to boost your workflow:
|
06f0e43
to
6cb9ad9
Compare
* refactor: derive DecodeWithMemTracking for ProxyType * refactor: derive DecodeWithMemTracking in pallets structs * refactor: impl DecodeWithMemTracking for ItemSettings & CollectionSettings
Changes from the commit: paritytech/polkadot-sdk#3634
Changes made from upstream: paritytech/polkadot-sdk#6087
a3089ab
to
fd99b50
Compare
/// A type alias for handling balance deposits. | ||
pub(super) type DepositBalanceOf<T, I = ()> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -254,6 +254,9 @@ pub mod pallet { | |||
/// Weight information for extrinsics in this pallet. | |||
type WeightInfo: WeightInfo; | |||
|
|||
/// Provider for the block number. Normally this is the `frame_system` pallet. | |||
type BlockNumberProvider: BlockNumberProvider; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sp-api.workspace = true | ||
|
||
[features] | ||
default = [ "std" ] | ||
std = [ "codec/std", "pallet-nfts/std", "sp-api/std" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pallets/nfts/src/weights.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weights of pallet-nfts and nonfungibles were re-generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! It looks great!
I've left one comment to clarify if we really need BlockNumberProvider
in the api.
Given that we are using
type BlockNumberFor<T> = pallet_nfts::BlockNumberFor<T, NftsInstanceOf<T>>;
it seems that we could be good without adding a new type to the trait ?
Once that is clarified I'm happy to approve 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, two nitpicks but nothing to stop this from going in.
@@ -66,7 +66,7 @@ use frame_support::{ | |||
use frame_system::Config as SystemConfig; | |||
pub use pallet::*; | |||
use sp_runtime::{ | |||
traits::{IdentifyAccount, Saturating, StaticLookup, Verify, Zero}, | |||
traits::{BlockNumberProvider, IdentifyAccount, Saturating, StaticLookup, Verify, Zero}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused Zero import
@@ -960,18 +956,14 @@ impl WeightInfo for () { | |||
/// The range of component `m` is `[0, 1000]`. | |||
/// The range of component `c` is `[0, 1000]`. | |||
/// The range of component `a` is `[0, 1000]`. | |||
fn destroy(m: u32, c: u32, a: u32, ) -> Weight { | |||
fn destroy(_m: u32, _c: u32, a: u32, ) -> Weight { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure whether the weights had to changed because now the complexity parameters are not used (often because the benchmarks are ran with too little steps and repetitions.
This PR syncs all changes from
v1.15.0
topolkadot-stable2503
for thepallet-nfts
andpallet-nonfugibles
polkadot-v1.15.0
: paritytech/polkadot-sdk@7ecf3f7polkadot-stable2503
: paritytech/polkadot-sdk@0c0d4ceRequires rebasing to this commit on
main
.Related upstream commits:
Commit comments are identical to the commits in
pallet-nfts | stable2503
pallet-nonfungibles
as it was a blocker before (maybe not needed, just note it here)frame_system::pallet_prelude::BlockNumberFor
and replaces it withtype BlockNumberProvider
configured on the runtime side.Config
trait of bothpallet-nfts
andpallet-nonfungibles
BlockNumberFor<T>
withBlockNumberFor<T, I>
pallet-nfts
fromruntime-api
as it is not used by the crate.DecodeWithMemTracking
to most of the types inpallet-nfts
. (UPDATED: This PR no longer contains this commit as it has been updated in 2372731#diff-c20a7ad3d8fa1d073ced5bb90e6dd70a357679adfd05c562478a10e4c55b733e)