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