mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-03 00:37:23 +00:00
Remove as frame_system::DefaultConfig from the required syntax in derive_impl (#3505)
Step in https://github.com/paritytech/polkadot-sdk/issues/171 This PR removes the need to specify `as [disambiguation_path]` for cases where the trait definition resides within the same scope as default impl path. For example, in the following macro invocation ```rust #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { ... } ``` the trait `DefaultConfig` lies within the `frame_system` scope and `TestDefaultConfig` impls the `DefaultConfig` trait. Using this information, we can compute the disambiguation path internally, thus removing the need of an explicit specification. In cases where the trait lies outside this scope, we would still need to specify it explicitly, but this should take care of most (if not all) uses of `derive_impl` within FRAME's context.
This commit is contained in:
@@ -639,6 +639,11 @@ pub fn storage_alias(attributes: TokenStream, input: TokenStream) -> TokenStream
|
||||
/// default to `A` from the `impl A for B` part of the default impl. This is useful for scenarios
|
||||
/// where all of the relevant types are already in scope via `use` statements.
|
||||
///
|
||||
/// In case the `default_impl_path` is scoped to a different module such as
|
||||
/// `some::path::TestTraitImpl`, the same scope is assumed for the `disambiguation_path`, i.e.
|
||||
/// `some::A`. This enables the use of `derive_impl` attribute without having to specify the
|
||||
/// `disambiguation_path` in most (if not all) uses within FRAME's context.
|
||||
///
|
||||
/// Conversely, the `default_impl_path` argument is required and cannot be omitted.
|
||||
///
|
||||
/// Optionally, `no_aggregated_types` can be specified as follows:
|
||||
|
||||
Reference in New Issue
Block a user