mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 12:17:58 +00:00
Disambiguate BlockNumber type in decl_module (#7061)
* Disambiguate `BlockNumber` type in `decl_module` * fix `frame-support-tests` * fix ui tests * fix trait order
This commit is contained in:
@@ -40,7 +40,7 @@ mod module1 {
|
||||
|
||||
frame_support::decl_module! {
|
||||
pub struct Module<T: Trait<I>, I: Instance = DefaultInstance> for enum Call
|
||||
where origin: <T as system::Trait>::Origin
|
||||
where origin: <T as system::Trait>::Origin, system=system
|
||||
{
|
||||
#[weight = 0]
|
||||
pub fn fail(_origin) -> frame_support::dispatch::DispatchResult {
|
||||
@@ -67,7 +67,7 @@ mod module2 {
|
||||
|
||||
frame_support::decl_module! {
|
||||
pub struct Module<T: Trait> for enum Call
|
||||
where origin: <T as system::Trait>::Origin
|
||||
where origin: <T as system::Trait>::Origin, system=system
|
||||
{
|
||||
#[weight = 0]
|
||||
pub fn fail(_origin) -> frame_support::dispatch::DispatchResult {
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
frame_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, system=self {
|
||||
fn integrity_test() {}
|
||||
|
||||
fn integrity_test() {}
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@ error: `integrity_test` can only be passed once as input.
|
||||
--> $DIR/reserved_keyword_two_times_integrity_test.rs:1:1
|
||||
|
|
||||
1 | / frame_support::decl_module! {
|
||||
2 | | pub struct Module<T: Trait> for enum Call where origin: T::Origin {
|
||||
2 | | pub struct Module<T: Trait> for enum Call where origin: T::Origin, system=self {
|
||||
3 | | fn integrity_test() {}
|
||||
4 | |
|
||||
5 | | fn integrity_test() {}
|
||||
@@ -16,7 +16,7 @@ error[E0601]: `main` function not found in crate `$CRATE`
|
||||
--> $DIR/reserved_keyword_two_times_integrity_test.rs:1:1
|
||||
|
|
||||
1 | / frame_support::decl_module! {
|
||||
2 | | pub struct Module<T: Trait> for enum Call where origin: T::Origin {
|
||||
2 | | pub struct Module<T: Trait> for enum Call where origin: T::Origin, system=self {
|
||||
3 | | fn integrity_test() {}
|
||||
4 | |
|
||||
5 | | fn integrity_test() {}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
frame_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, system=self {
|
||||
fn on_initialize() -> Weight {
|
||||
0
|
||||
}
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@ error: `on_initialize` can only be passed once as input.
|
||||
--> $DIR/reserved_keyword_two_times_on_initialize.rs:1:1
|
||||
|
|
||||
1 | / frame_support::decl_module! {
|
||||
2 | | pub struct Module<T: Trait> for enum Call where origin: T::Origin {
|
||||
2 | | pub struct Module<T: Trait> for enum Call where origin: T::Origin, system=self {
|
||||
3 | | fn on_initialize() -> Weight {
|
||||
4 | | 0
|
||||
... |
|
||||
@@ -16,7 +16,7 @@ error[E0601]: `main` function not found in crate `$CRATE`
|
||||
--> $DIR/reserved_keyword_two_times_on_initialize.rs:1:1
|
||||
|
|
||||
1 | / frame_support::decl_module! {
|
||||
2 | | pub struct Module<T: Trait> for enum Call where origin: T::Origin {
|
||||
2 | | pub struct Module<T: Trait> for enum Call where origin: T::Origin, system=self {
|
||||
3 | | fn on_initialize() -> Weight {
|
||||
4 | | 0
|
||||
... |
|
||||
|
||||
@@ -25,7 +25,7 @@ mod tests {
|
||||
use codec::{Encode, Decode, EncodeLike};
|
||||
|
||||
frame_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, system=self {}
|
||||
}
|
||||
|
||||
pub trait Trait {
|
||||
@@ -420,7 +420,7 @@ mod test2 {
|
||||
}
|
||||
|
||||
frame_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, system=self {}
|
||||
}
|
||||
|
||||
type PairOf<T> = (T, T);
|
||||
@@ -455,7 +455,7 @@ mod test3 {
|
||||
type BlockNumber;
|
||||
}
|
||||
frame_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, system=self {}
|
||||
}
|
||||
frame_support::decl_storage! {
|
||||
trait Store for Module<T: Trait> as Test {
|
||||
@@ -485,7 +485,7 @@ mod test_append_and_len {
|
||||
}
|
||||
|
||||
frame_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, system=self {}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Clone, Encode, Decode)]
|
||||
|
||||
@@ -21,7 +21,7 @@ pub trait Trait {
|
||||
}
|
||||
|
||||
frame_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, system=self {}
|
||||
}
|
||||
|
||||
frame_support::decl_storage!{
|
||||
|
||||
@@ -21,7 +21,7 @@ pub trait Trait {
|
||||
}
|
||||
|
||||
frame_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, system=self {}
|
||||
}
|
||||
|
||||
frame_support::decl_storage!{
|
||||
|
||||
@@ -21,7 +21,7 @@ pub trait Trait {
|
||||
}
|
||||
|
||||
frame_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, system=self {}
|
||||
}
|
||||
|
||||
frame_support::decl_storage!{
|
||||
|
||||
@@ -29,7 +29,7 @@ mod no_instance {
|
||||
}
|
||||
|
||||
frame_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, system=self {}
|
||||
}
|
||||
|
||||
frame_support::decl_storage!{
|
||||
@@ -50,11 +50,13 @@ mod no_instance {
|
||||
}
|
||||
|
||||
mod instance {
|
||||
use super::no_instance;
|
||||
|
||||
pub trait Trait<I = DefaultInstance>: super::no_instance::Trait {}
|
||||
|
||||
frame_support::decl_module! {
|
||||
pub struct Module<T: Trait<I>, I: Instance = DefaultInstance>
|
||||
for enum Call where origin: T::Origin {}
|
||||
for enum Call where origin: T::Origin, system=no_instance {}
|
||||
}
|
||||
|
||||
frame_support::decl_storage!{
|
||||
|
||||
@@ -21,7 +21,7 @@ pub trait Trait {
|
||||
}
|
||||
|
||||
frame_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, system=self {}
|
||||
}
|
||||
|
||||
frame_support::decl_storage! {
|
||||
|
||||
@@ -184,7 +184,7 @@ mod module3 {
|
||||
}
|
||||
|
||||
frame_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, system=system {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ mod module {
|
||||
pub trait Trait: system::Trait {}
|
||||
|
||||
frame_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, system=system {}
|
||||
}
|
||||
|
||||
#[derive(Encode, Decode, Copy, Clone, Serialize, Deserialize)]
|
||||
|
||||
@@ -18,7 +18,7 @@ macro_rules! reserved {
|
||||
}
|
||||
|
||||
frame_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, system=self {
|
||||
#[weight = 0]
|
||||
fn $reserved(_origin) -> dispatch::DispatchResult { unreachable!() }
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ pub trait Trait {
|
||||
}
|
||||
|
||||
frame_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, system=self {
|
||||
#[weight = 0]
|
||||
#[transactional]
|
||||
fn value_commits(_origin, v: u32) {
|
||||
|
||||
@@ -31,7 +31,7 @@ pub trait Trait: 'static + Eq + Clone {
|
||||
}
|
||||
|
||||
frame_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, system=self {}
|
||||
}
|
||||
|
||||
impl<T: Trait> Module<T> {
|
||||
|
||||
Reference in New Issue
Block a user