mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 07:58:00 +00:00
fix macro internal use with $crate (#2060)
This commit is contained in:
@@ -110,7 +110,7 @@ macro_rules! decl_module {
|
||||
$($t:tt)*
|
||||
}
|
||||
) => {
|
||||
decl_module!(@normalize
|
||||
$crate::decl_module!(@normalize
|
||||
$(#[$attr])*
|
||||
pub struct $mod_type<$trait_instance: $trait_name$(<I>, I: $instantiable $(= $module_default_instance)?)?>
|
||||
for enum $call_type where origin: $origin_type, system = system
|
||||
@@ -129,7 +129,7 @@ macro_rules! decl_module {
|
||||
$($t:tt)*
|
||||
}
|
||||
) => {
|
||||
decl_module!(@normalize
|
||||
$crate::decl_module!(@normalize
|
||||
$(#[$attr])*
|
||||
pub struct $mod_type<$trait_instance: $trait_name$(<I>, I: $instantiable $(= $module_default_instance)?)?>
|
||||
for enum $call_type where origin: $origin_type, system = $system
|
||||
@@ -155,7 +155,7 @@ macro_rules! decl_module {
|
||||
$vis:vis fn deposit_event $(<$dpeg:ident $(, $dpeg_instance:ident)?>)* () = default;
|
||||
$($rest:tt)*
|
||||
) => {
|
||||
decl_module!(@normalize
|
||||
$crate::decl_module!(@normalize
|
||||
$(#[$attr])*
|
||||
pub struct $mod_type<$trait_instance: $trait_name$(<I>, I: $instantiable $(= $module_default_instance)?)?>
|
||||
for enum $call_type where origin: $origin_type, system = $system
|
||||
@@ -182,7 +182,7 @@ macro_rules! decl_module {
|
||||
) { $( $impl:tt )* }
|
||||
$($rest:tt)*
|
||||
) => {
|
||||
decl_module!(@normalize
|
||||
$crate::decl_module!(@normalize
|
||||
$(#[$attr])*
|
||||
pub struct $mod_type<$trait_instance: $trait_name$(<I>, I: $instantiable $(= $module_default_instance)?)?>
|
||||
for enum $call_type where origin: $origin_type, system = $system
|
||||
@@ -207,7 +207,7 @@ macro_rules! decl_module {
|
||||
fn on_finalise($($param_name:ident : $param:ty),* ) { $( $impl:tt )* }
|
||||
$($rest:tt)*
|
||||
) => {
|
||||
decl_module!(@normalize
|
||||
$crate::decl_module!(@normalize
|
||||
$(#[$attr])*
|
||||
pub struct $mod_type<$trait_instance: $trait_name$(<I>, I: $instantiable $(= $module_default_instance)?)?>
|
||||
for enum $call_type where origin: $origin_type, system = $system
|
||||
@@ -232,7 +232,7 @@ macro_rules! decl_module {
|
||||
fn on_initialise($($param_name:ident : $param:ty),* ) { $( $impl:tt )* }
|
||||
$($rest:tt)*
|
||||
) => {
|
||||
decl_module!(@normalize
|
||||
$crate::decl_module!(@normalize
|
||||
$(#[$attr])*
|
||||
pub struct $mod_type<$trait_instance: $trait_name$(<I>, I: $instantiable $(= $module_default_instance)?)?>
|
||||
for enum $call_type where origin: $origin_type, system = $system
|
||||
@@ -284,7 +284,7 @@ macro_rules! decl_module {
|
||||
) $( -> $result:ty )* { $( $impl:tt )* }
|
||||
$($rest:tt)*
|
||||
) => {
|
||||
decl_module!(@normalize
|
||||
$crate::decl_module!(@normalize
|
||||
$(#[$attr])*
|
||||
pub struct $mod_type<$trait_instance: $trait_name$(<I>, $instance: $instantiable $(= $module_default_instance)?)?>
|
||||
for enum $call_type where origin: $origin_type, system = $system
|
||||
@@ -360,7 +360,7 @@ macro_rules! decl_module {
|
||||
) $( -> $result:ty )* { $( $impl:tt )* }
|
||||
$($rest:tt)*
|
||||
) => {
|
||||
decl_module!(@normalize
|
||||
$crate::decl_module!(@normalize
|
||||
$(#[$attr])*
|
||||
pub struct $mod_type<$trait_instance: $trait_name$(<I>, $instance: $instantiable $(= $module_default_instance)?)?>
|
||||
for enum $call_type where origin: $origin_type, system = $system
|
||||
@@ -389,7 +389,7 @@ macro_rules! decl_module {
|
||||
{ $( $offchain:tt )* }
|
||||
[ $($t:tt)* ]
|
||||
) => {
|
||||
decl_module!(@imp
|
||||
$crate::decl_module!(@imp
|
||||
$(#[$attr])*
|
||||
pub struct $mod_type<$trait_instance: $trait_name$(<I>, I: $instantiable $(= $module_default_instance)?)?>
|
||||
for enum $call_type where origin: $origin_type, system = $system {
|
||||
@@ -649,25 +649,25 @@ macro_rules! decl_module {
|
||||
#[cfg(not(feature = "std"))]
|
||||
pub struct $mod_type<$trait_instance: $trait_name $(<I>, $instance: $instantiable $( = $module_default_instance)?)?>(::core::marker::PhantomData<($trait_instance $(, $instance)?)>);
|
||||
|
||||
decl_module! {
|
||||
$crate::decl_module! {
|
||||
@impl_on_initialise
|
||||
$mod_type<$trait_instance: $trait_name $(<I>, $instance: $instantiable)?>;
|
||||
$( $on_initialise )*
|
||||
}
|
||||
|
||||
decl_module! {
|
||||
$crate::decl_module! {
|
||||
@impl_on_finalise
|
||||
$mod_type<$trait_instance: $trait_name $(<I>, $instance: $instantiable)?>;
|
||||
$( $on_finalise )*
|
||||
}
|
||||
|
||||
decl_module! {
|
||||
$crate::decl_module! {
|
||||
@impl_offchain
|
||||
$mod_type<$trait_instance: $trait_name $(<I>, $instance: $instantiable)?>;
|
||||
$( $offchain )*
|
||||
}
|
||||
|
||||
decl_module! {
|
||||
$crate::decl_module! {
|
||||
@impl_deposit_event
|
||||
$mod_type<$trait_instance: $trait_name $(<I>, $instance: $instantiable)?>;
|
||||
$system;
|
||||
@@ -679,7 +679,7 @@ macro_rules! decl_module {
|
||||
/// [`Call`]: enum.Call.html
|
||||
impl<$trait_instance: $trait_name $(<I>, $instance: $instantiable)?> $mod_type<$trait_instance $(, $instance)?> {
|
||||
$(
|
||||
decl_module! {
|
||||
$crate::decl_module! {
|
||||
@impl_function
|
||||
$mod_type<$trait_instance: $trait_name $(<I>, $fn_instance: $fn_instantiable)?>;
|
||||
$origin_type;
|
||||
|
||||
@@ -87,7 +87,7 @@ macro_rules! construct_runtime {
|
||||
$( $rest:tt )*
|
||||
}
|
||||
) => {
|
||||
construct_runtime!(
|
||||
$crate::construct_runtime!(
|
||||
{
|
||||
$runtime;
|
||||
$block;
|
||||
@@ -105,7 +105,7 @@ macro_rules! construct_runtime {
|
||||
$name:ident: $module:ident,
|
||||
$( $rest:tt )*
|
||||
) => {
|
||||
construct_runtime!(
|
||||
$crate::construct_runtime!(
|
||||
{ $( $preset )* };
|
||||
{ $( $expanded )* $name: $module::{Module, Call, Storage, Event<T>, Config<T>}, };
|
||||
$( $rest )*
|
||||
@@ -124,7 +124,7 @@ macro_rules! construct_runtime {
|
||||
},
|
||||
$( $rest:tt )*
|
||||
) => {
|
||||
construct_runtime!(
|
||||
$crate::construct_runtime!(
|
||||
{ $( $preset )* };
|
||||
{
|
||||
$( $expanded )*
|
||||
@@ -151,7 +151,7 @@ macro_rules! construct_runtime {
|
||||
},
|
||||
$( $rest:tt )*
|
||||
) => {
|
||||
construct_runtime!(
|
||||
$crate::construct_runtime!(
|
||||
{ $( $preset )* };
|
||||
{
|
||||
$( $expanded )*
|
||||
@@ -177,7 +177,7 @@ macro_rules! construct_runtime {
|
||||
},
|
||||
$( $rest:tt )*
|
||||
) => {
|
||||
construct_runtime!(
|
||||
$crate::construct_runtime!(
|
||||
{ $( $preset )* };
|
||||
{
|
||||
$( $expanded )*
|
||||
|
||||
@@ -24,7 +24,7 @@ use srml_support::rstd as rstd;
|
||||
use srml_support::codec::{Encode, Decode};
|
||||
use srml_support::runtime_primitives::{generic, BuildStorage};
|
||||
use srml_support::runtime_primitives::traits::{BlakeTwo256, Block as _, Verify, Digest};
|
||||
use srml_support::{Parameter, construct_runtime, decl_module, decl_storage, decl_event};
|
||||
use srml_support::Parameter;
|
||||
use inherents::{
|
||||
ProvideInherent, InherentData, InherentIdentifier, RuntimeString, MakeFatalError
|
||||
};
|
||||
@@ -50,7 +50,7 @@ mod system {
|
||||
|
||||
pub type DigestItemOf<T> = <<T as Trait>::Digest as Digest>::Item;
|
||||
|
||||
decl_module! {
|
||||
srml_support::decl_module! {
|
||||
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
|
||||
pub fn deposit_event(_event: T::Event) {
|
||||
}
|
||||
@@ -62,7 +62,7 @@ mod system {
|
||||
}
|
||||
}
|
||||
|
||||
decl_event!(
|
||||
srml_support::decl_event!(
|
||||
pub enum Event {
|
||||
ExtrinsicSuccess,
|
||||
ExtrinsicFailed,
|
||||
@@ -122,7 +122,7 @@ mod module1 {
|
||||
type Log: From<Log<Self, I>> + Into<system::DigestItemOf<Self>>;
|
||||
}
|
||||
|
||||
decl_module! {
|
||||
srml_support::decl_module! {
|
||||
pub struct Module<T: Trait<I>, I: InstantiableThing> for enum Call where origin: <T as system::Trait>::Origin {
|
||||
fn deposit_event<T, I>() = default;
|
||||
|
||||
@@ -140,7 +140,7 @@ mod module1 {
|
||||
}
|
||||
}
|
||||
|
||||
decl_storage! {
|
||||
srml_support::decl_storage! {
|
||||
trait Store for Module<T: Trait<I>, I: InstantiableThing> as Module1 {
|
||||
pub Value config(value): u64;
|
||||
pub Map: map u32 => u64;
|
||||
@@ -148,7 +148,7 @@ mod module1 {
|
||||
}
|
||||
}
|
||||
|
||||
decl_event! {
|
||||
srml_support::decl_event! {
|
||||
pub enum Event<T, I> where Phantom = rstd::marker::PhantomData<T> {
|
||||
_Phantom(Phantom),
|
||||
AnotherVariant(u32),
|
||||
@@ -207,13 +207,13 @@ mod module2 {
|
||||
|
||||
impl<T: Trait<I>, I: Instance> Currency for Module<T, I> {}
|
||||
|
||||
decl_module! {
|
||||
srml_support::decl_module! {
|
||||
pub struct Module<T: Trait<I>, I: Instance=DefaultInstance> for enum Call where origin: <T as system::Trait>::Origin {
|
||||
fn deposit_event<T, I>() = default;
|
||||
}
|
||||
}
|
||||
|
||||
decl_storage! {
|
||||
srml_support::decl_storage! {
|
||||
trait Store for Module<T: Trait<I>, I: Instance=DefaultInstance> as Module2 {
|
||||
pub Value config(value): T::Amount;
|
||||
pub Map config(map): map u64 => u64;
|
||||
@@ -222,7 +222,7 @@ mod module2 {
|
||||
extra_genesis_skip_phantom_data_field;
|
||||
}
|
||||
|
||||
decl_event! {
|
||||
srml_support::decl_event! {
|
||||
pub enum Event<T, I=DefaultInstance> where Amount = <T as Trait<I>>::Amount {
|
||||
Variant(Amount),
|
||||
}
|
||||
@@ -275,7 +275,7 @@ mod module3 {
|
||||
type Currency2: Currency;
|
||||
}
|
||||
|
||||
decl_module! {
|
||||
srml_support::decl_module! {
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as system::Trait>::Origin {
|
||||
}
|
||||
}
|
||||
@@ -335,7 +335,7 @@ impl system::Trait for Runtime {
|
||||
type Log = Log;
|
||||
}
|
||||
|
||||
construct_runtime!(
|
||||
srml_support::construct_runtime!(
|
||||
pub enum Runtime with Log(InternalLog: DigestItem<H256, (), ()>) where
|
||||
Block = Block,
|
||||
NodeBlock = Block,
|
||||
|
||||
Reference in New Issue
Block a user