feat: Rebrand Polkadot/Substrate references to PezkuwiChain
This commit systematically rebrands various references from Parity Technologies' Polkadot/Substrate ecosystem to PezkuwiChain within the kurdistan-sdk. Key changes include: - Updated external repository URLs (zombienet-sdk, parity-db, parity-scale-codec, wasm-instrument) to point to pezkuwichain forks. - Modified internal documentation and code comments to reflect PezkuwiChain naming and structure. - Replaced direct references to with or specific paths within the for XCM, Pezkuwi, and other modules. - Cleaned up deprecated issue and PR references in various and files, particularly in and modules. - Adjusted image and logo URLs in documentation to point to PezkuwiChain assets. - Removed or rephrased comments related to external Polkadot/Substrate PRs and issues. This is a significant step towards fully customizing the SDK for the PezkuwiChain ecosystem.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet [foo]]
|
||||
mod foo {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Invalid pallet macro call: unexpected attribute. Macro call must be bare, such as `#[frame_support::pallet]` or `#[pallet]`, or must specify the `dev_mode` attribute, such as `#[frame_support::pallet(dev_mode)]` or #[pallet(dev_mode)].
|
||||
--> tests/pallet_ui/attr_non_empty.rs:18:26
|
||||
|
|
||||
18 | #[frame_support::pallet [foo]]
|
||||
| ^^^
|
||||
@@ -0,0 +1,39 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
#[pallet::constant(Hello)]
|
||||
type MyGetParam2: Get<u32>;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
error: unexpected token, expected `]`
|
||||
--> tests/pallet_ui/attribute_macros_deny_parameters.rs:25:21
|
||||
|
|
||||
25 | #[pallet::constant(Hello)]
|
||||
| ^^^^^^^
|
||||
@@ -0,0 +1,47 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
pub trait WeightInfo {
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
#[pallet::call(weight = T::WeightInfo)]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::weight_of_authorize(Weight::zero())]
|
||||
#[pallet::weight(Weight::zero())]
|
||||
#[pallet::call_index(0)]
|
||||
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
|
||||
let _ = origin;
|
||||
let _ = a;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
error: Invalid pallet::call, weight_of_authorize attribute must be used with authorize attribute
|
||||
--> tests/pallet_ui/authorize_weight_but_no_closure.rs:36:33
|
||||
|
|
||||
36 | #[pallet::weight_of_authorize(Weight::zero())]
|
||||
| ^^^^^^
|
||||
@@ -0,0 +1,48 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
pub trait WeightInfo {
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
#[pallet::call(weight = T::WeightInfo)]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::authorize(|_| true)]
|
||||
#[pallet::weight_of_authorize(Weight::zero())]
|
||||
#[pallet::weight(Weight::zero())]
|
||||
#[pallet::call_index(0)]
|
||||
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
|
||||
let _ = origin;
|
||||
let _ = a;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,8 @@
|
||||
error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
|
||||
--> tests/pallet_ui/authorize_wrong_closure.rs:36:23
|
||||
|
|
||||
36 | #[pallet::authorize(|_| true)]
|
||||
| ^--
|
||||
| |
|
||||
| expected closure that takes 2 arguments
|
||||
| takes 1 argument
|
||||
@@ -0,0 +1,48 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
pub trait WeightInfo {
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
#[pallet::call(weight = T::WeightInfo)]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::authorize(|_, _: u8| -> bool { true })]
|
||||
#[pallet::weight_of_authorize(Weight::zero())]
|
||||
#[pallet::weight(Weight::zero())]
|
||||
#[pallet::call_index(0)]
|
||||
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
|
||||
let _ = origin;
|
||||
let _ = a;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,13 @@
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> tests/pallet_ui/authorize_wrong_closure_2.rs:36:23
|
||||
|
|
||||
36 | #[pallet::authorize(|_, _: u8| -> bool { true })]
|
||||
| ^--------------------------
|
||||
| |
|
||||
| expected due to this
|
||||
| found signature defined here
|
||||
| return type was inferred to be `{closure@authorize_wrong_closure_2.rs:36:23}` here
|
||||
|
|
||||
= note: expected closure signature `for<'a> fn(TransactionSource, &'a u32) -> _`
|
||||
found closure signature `fn(TransactionSource, u8) -> _`
|
||||
= note: consider using `--verbose` to print the full type name to the console
|
||||
@@ -0,0 +1,48 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
pub trait WeightInfo {
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
#[pallet::call(weight = T::WeightInfo)]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::authorize()]
|
||||
#[pallet::weight_of_authorize(Weight::zero())]
|
||||
#[pallet::weight(Weight::zero())]
|
||||
#[pallet::call_index(0)]
|
||||
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
|
||||
let _ = origin;
|
||||
let _ = a;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: unexpected end of input, expected an expression
|
||||
--> tests/pallet_ui/authorize_wrong_closure_3.rs:36:22
|
||||
|
|
||||
36 | #[pallet::authorize()]
|
||||
| ^^
|
||||
@@ -0,0 +1,48 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
pub trait WeightInfo {
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
#[pallet::call(weight = T::WeightInfo)]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::authorize(Ok(Default::default()))]
|
||||
#[pallet::weight_of_authorize(Weight::zero())]
|
||||
#[pallet::weight(Weight::zero())]
|
||||
#[pallet::call_index(0)]
|
||||
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
|
||||
let _ = origin;
|
||||
let _ = a;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,10 @@
|
||||
error[E0277]: expected a `Fn(TransactionSource, &u32)` closure, found `Result<_, _>`
|
||||
--> tests/pallet_ui/authorize_wrong_closure_4.rs:36:23
|
||||
|
|
||||
36 | #[pallet::authorize(Ok(Default::default()))]
|
||||
| ^^--------------------
|
||||
| |
|
||||
| expected an `Fn(TransactionSource, &u32)` closure, found `Result<_, _>`
|
||||
| return type was inferred to be `Result<_, _>` here
|
||||
|
|
||||
= help: the trait `for<'a> Fn(TransactionSource, &'a u32)` is not implemented for `Result<_, _>`
|
||||
@@ -0,0 +1,50 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
pub trait WeightInfo {
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
#[pallet::call(weight = T::WeightInfo)]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::authorize(|_a: &u32| -> TransactionValidityWithRefund {
|
||||
Ok(Default::default())
|
||||
})]
|
||||
#[pallet::weight_of_authorize(Weight::zero())]
|
||||
#[pallet::weight(Weight::zero())]
|
||||
#[pallet::call_index(0)]
|
||||
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
|
||||
let _ = origin;
|
||||
let _ = a;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,8 @@
|
||||
error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
|
||||
--> tests/pallet_ui/authorize_wrong_closure_5.rs:36:23
|
||||
|
|
||||
36 | #[pallet::authorize(|_a: &u32| -> TransactionValidityWithRefund {
|
||||
| ^------------------------------------------
|
||||
| |
|
||||
| expected closure that takes 2 arguments
|
||||
| takes 1 argument
|
||||
@@ -0,0 +1,48 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
pub trait WeightInfo {
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
#[pallet::call(weight = T::WeightInfo)]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::authorize(|_, _| Ok(Default::default()))]
|
||||
#[pallet::weight_of_authorize("foo")]
|
||||
#[pallet::weight(Weight::zero())]
|
||||
#[pallet::call_index(0)]
|
||||
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
|
||||
let _ = origin;
|
||||
let _ = a;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,22 @@
|
||||
error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`:
|
||||
It is deprecated to use hard-coded constant as call weight.
|
||||
Please instead benchmark all calls or put the pallet into `dev` mode.
|
||||
|
||||
For more info see:
|
||||
<https://github.com/paritytech/bizinikiwi/pull/13798>
|
||||
--> tests/pallet_ui/authorize_wrong_weight.rs:37:33
|
||||
|
|
||||
37 | #[pallet::weight_of_authorize("foo")]
|
||||
| ^^^^^
|
||||
|
|
||||
= note: `-D deprecated` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(deprecated)]`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> tests/pallet_ui/authorize_wrong_weight.rs:37:33
|
||||
|
|
||||
18 | #[frame_support::pallet]
|
||||
| ------------------------ expected `frame_support::weights::Weight` because of return type
|
||||
...
|
||||
37 | #[pallet::weight_of_authorize("foo")]
|
||||
| ^^^^^ expected `Weight`, found `&str`
|
||||
@@ -0,0 +1,47 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
pub trait WeightInfo {
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
#[pallet::call(weight = T::WeightInfo)]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::authorize(|_, _| Ok(Default::default()))]
|
||||
#[pallet::weight(Weight::zero())]
|
||||
#[pallet::call_index(0)]
|
||||
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
|
||||
let _ = origin;
|
||||
let _ = a;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,5 @@
|
||||
error[E0599]: no function or associated item named `authorize_call1` found for associated type `<T as pallet::Config>::WeightInfo` in the current scope
|
||||
--> tests/pallet_ui/authorize_wrong_weight_info.rs:39:10
|
||||
|
|
||||
39 | pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
|
||||
| ^^^^^ function or associated item not found in `<T as Config>::WeightInfo`
|
||||
@@ -0,0 +1,47 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
pub trait WeightInfo {
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
#[pallet::call(weight = T::WeightIn)]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::authorize(|_, _| Ok(Default::default()))]
|
||||
#[pallet::weight(Weight::zero())]
|
||||
#[pallet::call_index(0)]
|
||||
pub fn call1(origin: OriginFor<T>, a: u32) -> DispatchResult {
|
||||
let _ = origin;
|
||||
let _ = a;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,5 @@
|
||||
error[E0220]: associated type `WeightIn` not found for `T`
|
||||
--> tests/pallet_ui/authorize_wrong_weight_info_2.rs:34:29
|
||||
|
|
||||
34 | #[pallet::call(weight = T::WeightIn)]
|
||||
| ^^^^^^^^ help: there is an associated type with a similar name: `WeightInfo`
|
||||
@@ -0,0 +1,45 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::{Hooks, DispatchResultWithPostInfo};
|
||||
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type Bar: codec::Codec + scale_info::TypeInfo;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::weight(0)]
|
||||
#[pallet::call_index(0)]
|
||||
pub fn foo(origin: OriginFor<T>, _bar: T::Bar) -> DispatchResultWithPostInfo {
|
||||
Ok(().into())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`:
|
||||
It is deprecated to use hard-coded constant as call weight.
|
||||
Please instead benchmark all calls or put the pallet into `dev` mode.
|
||||
|
||||
For more info see:
|
||||
<https://github.com/paritytech/bizinikiwi/pull/13798>
|
||||
--> tests/pallet_ui/call_argument_invalid_bound.rs:36:20
|
||||
|
|
||||
36 | #[pallet::weight(0)]
|
||||
| ^
|
||||
|
|
||||
= note: `-D deprecated` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(deprecated)]`
|
||||
|
||||
error[E0277]: `<T as pallet::Config>::Bar` doesn't implement `std::fmt::Debug`
|
||||
--> tests/pallet_ui/call_argument_invalid_bound.rs:38:36
|
||||
|
|
||||
38 | pub fn foo(origin: OriginFor<T>, _bar: T::Bar) -> DispatchResultWithPostInfo {
|
||||
| ^^^^ `<T as pallet::Config>::Bar` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
|
||||
|
|
||||
= help: the trait `std::fmt::Debug` is not implemented for `<T as pallet::Config>::Bar`
|
||||
= note: required for `&<T as pallet::Config>::Bar` to implement `std::fmt::Debug`
|
||||
= note: required for the cast from `&&<T as pallet::Config>::Bar` to `&dyn std::fmt::Debug`
|
||||
|
||||
error[E0277]: the trait bound `<T as pallet::Config>::Bar: Clone` is not satisfied
|
||||
--> tests/pallet_ui/call_argument_invalid_bound.rs:38:36
|
||||
|
|
||||
38 | pub fn foo(origin: OriginFor<T>, _bar: T::Bar) -> DispatchResultWithPostInfo {
|
||||
| ^^^^ the trait `Clone` is not implemented for `<T as pallet::Config>::Bar`
|
||||
|
||||
error[E0369]: binary operation `==` cannot be applied to type `&<T as pallet::Config>::Bar`
|
||||
--> tests/pallet_ui/call_argument_invalid_bound.rs:38:36
|
||||
|
|
||||
38 | pub fn foo(origin: OriginFor<T>, _bar: T::Bar) -> DispatchResultWithPostInfo {
|
||||
| ^^^^
|
||||
|
||||
error: unused variable: `origin`
|
||||
--> tests/pallet_ui/call_argument_invalid_bound.rs:38:14
|
||||
|
|
||||
38 | pub fn foo(origin: OriginFor<T>, _bar: T::Bar) -> DispatchResultWithPostInfo {
|
||||
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_origin`
|
||||
|
|
||||
= note: `-D unused-variables` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(unused_variables)]`
|
||||
@@ -0,0 +1,45 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::{Hooks, DispatchResultWithPostInfo};
|
||||
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type Bar: scale_info::TypeInfo;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::weight(0)]
|
||||
#[pallet::call_index(0)]
|
||||
pub fn foo(origin: OriginFor<T>, _bar: T::Bar) -> DispatchResultWithPostInfo {
|
||||
Ok(().into())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`:
|
||||
It is deprecated to use hard-coded constant as call weight.
|
||||
Please instead benchmark all calls or put the pallet into `dev` mode.
|
||||
|
||||
For more info see:
|
||||
<https://github.com/paritytech/bizinikiwi/pull/13798>
|
||||
--> tests/pallet_ui/call_argument_invalid_bound_2.rs:36:20
|
||||
|
|
||||
36 | #[pallet::weight(0)]
|
||||
| ^
|
||||
|
|
||||
= note: `-D deprecated` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(deprecated)]`
|
||||
|
||||
error[E0277]: `<T as pallet::Config>::Bar` doesn't implement `std::fmt::Debug`
|
||||
--> tests/pallet_ui/call_argument_invalid_bound_2.rs:38:36
|
||||
|
|
||||
38 | pub fn foo(origin: OriginFor<T>, _bar: T::Bar) -> DispatchResultWithPostInfo {
|
||||
| ^^^^ `<T as pallet::Config>::Bar` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
|
||||
|
|
||||
= help: the trait `std::fmt::Debug` is not implemented for `<T as pallet::Config>::Bar`
|
||||
= note: required for `&<T as pallet::Config>::Bar` to implement `std::fmt::Debug`
|
||||
= note: required for the cast from `&&<T as pallet::Config>::Bar` to `&dyn std::fmt::Debug`
|
||||
|
||||
error[E0277]: the trait bound `<T as pallet::Config>::Bar: Clone` is not satisfied
|
||||
--> tests/pallet_ui/call_argument_invalid_bound_2.rs:38:36
|
||||
|
|
||||
38 | pub fn foo(origin: OriginFor<T>, _bar: T::Bar) -> DispatchResultWithPostInfo {
|
||||
| ^^^^ the trait `Clone` is not implemented for `<T as pallet::Config>::Bar`
|
||||
|
||||
error[E0369]: binary operation `==` cannot be applied to type `&<T as pallet::Config>::Bar`
|
||||
--> tests/pallet_ui/call_argument_invalid_bound_2.rs:38:36
|
||||
|
|
||||
38 | pub fn foo(origin: OriginFor<T>, _bar: T::Bar) -> DispatchResultWithPostInfo {
|
||||
| ^^^^
|
||||
|
||||
error[E0277]: the trait bound `<T as pallet::Config>::Bar: Encode` is not satisfied
|
||||
--> tests/pallet_ui/call_argument_invalid_bound_2.rs:38:36
|
||||
|
|
||||
18 | #[frame_support::pallet]
|
||||
| ------------------------ required by a bound introduced by this call
|
||||
...
|
||||
38 | pub fn foo(origin: OriginFor<T>, _bar: T::Bar) -> DispatchResultWithPostInfo {
|
||||
| ^^^^ the trait `WrapperTypeEncode` is not implemented for `<T as pallet::Config>::Bar`
|
||||
|
|
||||
= note: required for `<T as pallet::Config>::Bar` to implement `Encode`
|
||||
|
||||
error[E0277]: the trait bound `<T as pallet::Config>::Bar: Decode` is not satisfied
|
||||
--> tests/pallet_ui/call_argument_invalid_bound_2.rs:38:42
|
||||
|
|
||||
38 | pub fn foo(origin: OriginFor<T>, _bar: T::Bar) -> DispatchResultWithPostInfo {
|
||||
| ^^^^^^ the trait `WrapperTypeDecode` is not implemented for `<T as pallet::Config>::Bar`
|
||||
|
|
||||
= note: required for `<T as pallet::Config>::Bar` to implement `Decode`
|
||||
|
||||
error: unused variable: `origin`
|
||||
--> tests/pallet_ui/call_argument_invalid_bound_2.rs:38:14
|
||||
|
|
||||
38 | pub fn foo(origin: OriginFor<T>, _bar: T::Bar) -> DispatchResultWithPostInfo {
|
||||
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_origin`
|
||||
|
|
||||
= note: `-D unused-variables` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(unused_variables)]`
|
||||
@@ -0,0 +1,46 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use codec::{Decode, DecodeWithMemTracking, Encode};
|
||||
use pezframe_support::pezpallet_prelude::{DispatchResultWithPostInfo, Hooks};
|
||||
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[derive(Encode, Decode, DecodeWithMemTracking, scale_info::TypeInfo, PartialEq, Clone)]
|
||||
struct Bar;
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::weight(0)]
|
||||
#[pallet::call_index(0)]
|
||||
pub fn foo(origin: OriginFor<T>, _bar: Bar) -> DispatchResultWithPostInfo {
|
||||
Ok(().into())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,38 @@
|
||||
error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`:
|
||||
It is deprecated to use hard-coded constant as call weight.
|
||||
Please instead benchmark all calls or put the pallet into `dev` mode.
|
||||
|
||||
For more info see:
|
||||
<https://github.com/paritytech/bizinikiwi/pull/13798>
|
||||
--> tests/pallet_ui/call_argument_invalid_bound_3.rs:38:20
|
||||
|
|
||||
38 | #[pallet::weight(0)]
|
||||
| ^
|
||||
|
|
||||
= note: `-D deprecated` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(deprecated)]`
|
||||
|
||||
error[E0277]: `Bar` doesn't implement `std::fmt::Debug`
|
||||
--> tests/pallet_ui/call_argument_invalid_bound_3.rs:40:36
|
||||
|
|
||||
40 | pub fn foo(origin: OriginFor<T>, _bar: Bar) -> DispatchResultWithPostInfo {
|
||||
| ^^^^ `Bar` cannot be formatted using `{:?}`
|
||||
|
|
||||
= help: the trait `std::fmt::Debug` is not implemented for `Bar`
|
||||
= note: add `#[derive(Debug)]` to `Bar` or manually `impl std::fmt::Debug for Bar`
|
||||
= note: required for `&Bar` to implement `std::fmt::Debug`
|
||||
= note: required for the cast from `&&Bar` to `&dyn std::fmt::Debug`
|
||||
help: consider annotating `Bar` with `#[derive(Debug)]`
|
||||
|
|
||||
34 + #[derive(Debug)]
|
||||
35 | struct Bar;
|
||||
|
|
||||
|
||||
error: unused variable: `origin`
|
||||
--> tests/pallet_ui/call_argument_invalid_bound_3.rs:40:14
|
||||
|
|
||||
40 | pub fn foo(origin: OriginFor<T>, _bar: Bar) -> DispatchResultWithPostInfo {
|
||||
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_origin`
|
||||
|
|
||||
= note: `-D unused-variables` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(unused_variables)]`
|
||||
@@ -0,0 +1,41 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::weight(0)]
|
||||
#[pallet::call_index(10)]
|
||||
pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
|
||||
|
||||
#[pallet::weight(0)]
|
||||
#[pallet::call_index(10)]
|
||||
pub fn bar(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
error: Call indices are conflicting: Both functions foo and bar are at index 10
|
||||
--> tests/pallet_ui/call_conflicting_indices.rs:32:10
|
||||
|
|
||||
32 | pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
|
||||
| ^^^
|
||||
|
||||
error: Call indices are conflicting: Both functions foo and bar are at index 10
|
||||
--> tests/pallet_ui/call_conflicting_indices.rs:36:10
|
||||
|
|
||||
36 | pub fn bar(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
|
||||
| ^^^
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet(dev_mode)]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::DispatchResult;
|
||||
use pezframe_system::pezpallet_prelude::OriginFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::feeless_if(|| -> bool { true })]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult { Ok(()) }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
error: Invalid pallet::call, feeless_if closure must have same number of arguments as the dispatchable function
|
||||
--> tests/pallet_ui/call_feeless_invalid_closure_arg1.rs:31:24
|
||||
|
|
||||
31 | #[pallet::feeless_if(|| -> bool { true })]
|
||||
| ^
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet(dev_mode)]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::DispatchResult;
|
||||
use pezframe_system::pezpallet_prelude::OriginFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::feeless_if(|_: bool| -> bool { true })]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult { Ok(()) }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
error: Invalid type: expected `&OriginFor<T>`
|
||||
--> tests/pallet_ui/call_feeless_invalid_closure_arg2.rs:31:28
|
||||
|
|
||||
31 | #[pallet::feeless_if(|_: bool| -> bool { true })]
|
||||
| ^^^^
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet(dev_mode)]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::DispatchResult;
|
||||
use pezframe_system::pezpallet_prelude::OriginFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::feeless_if(|_: &OriginFor<T>, _s: &u32| -> bool { true })]
|
||||
pub fn foo(_: OriginFor<T>, _something: u64) -> DispatchResult { Ok(()) }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
error: Invalid pallet::call, feeless_if closure argument must have a reference to the same type as the dispatchable function argument
|
||||
--> tests/pallet_ui/call_feeless_invalid_closure_arg3.rs:31:43
|
||||
|
|
||||
31 | #[pallet::feeless_if(|_: &OriginFor<T>, _s: &u32| -> bool { true })]
|
||||
| ^^
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet(dev_mode)]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::DispatchResult;
|
||||
use pezframe_system::pezpallet_prelude::OriginFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::feeless_if(|_: &OriginFor<T>| -> u32 { 0 })]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult { Ok(()) }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
error: Invalid pallet::call, feeless_if closure must return `bool`
|
||||
--> tests/pallet_ui/call_feeless_invalid_closure_return.rs:31:43
|
||||
|
|
||||
31 | #[pallet::feeless_if(|_: &OriginFor<T>| -> u32 { 0 })]
|
||||
| ^
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet(dev_mode)]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::DispatchResult;
|
||||
use pezframe_system::pezpallet_prelude::OriginFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::feeless_if(0)]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult { Ok(()) }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
error: Invalid feeless_if attribute: expected a closure
|
||||
--> tests/pallet_ui/call_feeless_invalid_type.rs:31:24
|
||||
|
|
||||
31 | #[pallet::feeless_if(0)]
|
||||
| ^
|
||||
|
||||
error: expected `|`
|
||||
--> tests/pallet_ui/call_feeless_invalid_type.rs:31:24
|
||||
|
|
||||
31 | #[pallet::feeless_if(0)]
|
||||
| ^
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo;
|
||||
use pezframe_system::pezpallet_prelude::OriginFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0something)]
|
||||
pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Number literal must not have a suffix
|
||||
--> tests/pallet_ui/call_index_has_suffix.rs:31:30
|
||||
|
|
||||
31 | #[pallet::call_index(0something)]
|
||||
| ^^^^^^^^^^
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo;
|
||||
use pezframe_system::pezpallet_prelude::OriginFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::weird_attr]
|
||||
pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: expected one of: `weight`, `call_index`, `feeless_if`, `authorize`, `weight_of_authorize`
|
||||
--> tests/pallet_ui/call_invalid_attr.rs:31:13
|
||||
|
|
||||
31 | #[pallet::weird_attr]
|
||||
| ^^^^^^^^^^
|
||||
@@ -0,0 +1,39 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::Hooks;
|
||||
use pezframe_system::pezpallet_prelude::BlockNumberFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
const Foo: u8 = 3u8;
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Invalid pallet::call, only method accepted
|
||||
--> tests/pallet_ui/call_invalid_const.rs:34:3
|
||||
|
|
||||
34 | const Foo: u8 = 3u8;
|
||||
| ^^^^^
|
||||
@@ -0,0 +1,38 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo;
|
||||
use pezframe_system::pezpallet_prelude::OriginFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::weight(0)]
|
||||
#[pallet::call_index(256)]
|
||||
pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: number too large to fit in target type
|
||||
--> tests/pallet_ui/call_invalid_index.rs:32:24
|
||||
|
|
||||
32 | #[pallet::call_index(256)]
|
||||
| ^^^
|
||||
@@ -0,0 +1,39 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::Hooks;
|
||||
use pezframe_system::pezpallet_prelude::BlockNumberFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
pub fn foo(origin: u8) {}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Invalid type: expected `OriginFor<T>` or `T::RuntimeOrigin`
|
||||
--> tests/pallet_ui/call_invalid_origin_type.rs:34:22
|
||||
|
|
||||
34 | pub fn foo(origin: u8) {}
|
||||
| ^^
|
||||
@@ -0,0 +1,39 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::Hooks;
|
||||
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
pub fn foo(origin: OriginFor<T>) -> ::DispatchResult { todo!() }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: expected `DispatchResultWithPostInfo` or `DispatchResult`
|
||||
--> tests/pallet_ui/call_invalid_return.rs:34:39
|
||||
|
|
||||
34 | pub fn foo(origin: OriginFor<T>) -> ::DispatchResult { todo!() }
|
||||
| ^
|
||||
@@ -0,0 +1,44 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::{Hooks, DispatchResultWithPostInfo};
|
||||
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type Bar: codec::Codec;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::weight(0)]
|
||||
fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
|
||||
Ok(().into())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Invalid pallet::call, dispatchable function must be public: `pub fn`
|
||||
--> tests/pallet_ui/call_invalid_vis.rs:37:3
|
||||
|
|
||||
37 | fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
|
||||
| ^^
|
||||
@@ -0,0 +1,44 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::{Hooks, DispatchResultWithPostInfo};
|
||||
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type Bar: codec::Codec;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::weight(0)]
|
||||
pub(crate) fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
|
||||
Ok(().into())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Invalid pallet::call, dispatchable function must be public: `pub fn`
|
||||
--> tests/pallet_ui/call_invalid_vis_2.rs:37:3
|
||||
|
|
||||
37 | pub(crate) fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
|
||||
| ^^^
|
||||
@@ -0,0 +1,44 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::DispatchResult;
|
||||
use pezframe_system::pezpallet_prelude::OriginFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::weight(0)]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::weight(0)]
|
||||
pub fn bar(_: OriginFor<T>) -> DispatchResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
error: use of deprecated constant `pallet::warnings::ImplicitCallIndex_0::_w`:
|
||||
It is deprecated to use implicit call indices.
|
||||
Please instead ensure that all calls have a `pallet::call_index` attribute or put the pallet into `dev` mode.
|
||||
|
||||
For more info see:
|
||||
<https://github.com/paritytech/bizinikiwi/pull/12891>
|
||||
<https://github.com/paritytech/bizinikiwi/pull/11381>
|
||||
--> tests/pallet_ui/call_missing_index.rs:32:10
|
||||
|
|
||||
32 | pub fn foo(_: OriginFor<T>) -> DispatchResult {
|
||||
| ^^^
|
||||
|
|
||||
= note: `-D deprecated` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(deprecated)]`
|
||||
|
||||
error: use of deprecated constant `pallet::warnings::ImplicitCallIndex_1::_w`:
|
||||
It is deprecated to use implicit call indices.
|
||||
Please instead ensure that all calls have a `pallet::call_index` attribute or put the pallet into `dev` mode.
|
||||
|
||||
For more info see:
|
||||
<https://github.com/paritytech/bizinikiwi/pull/12891>
|
||||
<https://github.com/paritytech/bizinikiwi/pull/11381>
|
||||
--> tests/pallet_ui/call_missing_index.rs:37:10
|
||||
|
|
||||
37 | pub fn bar(_: OriginFor<T>) -> DispatchResult {
|
||||
| ^^^
|
||||
|
||||
error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`:
|
||||
It is deprecated to use hard-coded constant as call weight.
|
||||
Please instead benchmark all calls or put the pallet into `dev` mode.
|
||||
|
||||
For more info see:
|
||||
<https://github.com/paritytech/bizinikiwi/pull/13798>
|
||||
--> tests/pallet_ui/call_missing_index.rs:31:20
|
||||
|
|
||||
31 | #[pallet::weight(0)]
|
||||
| ^
|
||||
|
||||
error: use of deprecated constant `pallet::warnings::ConstantWeight_1::_w`:
|
||||
It is deprecated to use hard-coded constant as call weight.
|
||||
Please instead benchmark all calls or put the pallet into `dev` mode.
|
||||
|
||||
For more info see:
|
||||
<https://github.com/paritytech/bizinikiwi/pull/13798>
|
||||
--> tests/pallet_ui/call_missing_index.rs:36:20
|
||||
|
|
||||
36 | #[pallet::weight(0)]
|
||||
| ^
|
||||
|
||||
error: associated function `error_metadata` is never used
|
||||
--> tests/pallet_ui/call_missing_index.rs:26:12
|
||||
|
|
||||
26 | #[pallet::pallet]
|
||||
| ^^^^^^ associated function in this implementation
|
||||
|
|
||||
= note: `-D dead-code` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(dead_code)]`
|
||||
|
||||
error: associated functions `new_call_variant_foo` and `new_call_variant_bar` are never used
|
||||
--> tests/pallet_ui/call_missing_index.rs:32:10
|
||||
|
|
||||
29 | #[pallet::call]
|
||||
| ---- associated functions in this implementation
|
||||
...
|
||||
32 | pub fn foo(_: OriginFor<T>) -> DispatchResult {
|
||||
| ^^^
|
||||
...
|
||||
37 | pub fn bar(_: OriginFor<T>) -> DispatchResult {
|
||||
| ^^^
|
||||
@@ -0,0 +1,39 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::{Hooks, DispatchResultWithPostInfo};
|
||||
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: A pallet::call requires either a concrete `#[pallet::weight($expr)]` or an inherited weight from the `#[pallet:call(weight($type))]` attribute, but none were given.
|
||||
--> tests/pallet_ui/call_missing_weight.rs:34:7
|
||||
|
|
||||
34 | pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
|
||||
| ^^
|
||||
@@ -0,0 +1,39 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo;
|
||||
use pezframe_system::pezpallet_prelude::OriginFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::weight(0)]
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::call_index(2)]
|
||||
pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Invalid pallet::call, too many call_index attributes given
|
||||
--> tests/pallet_ui/call_multiple_call_index.rs:34:7
|
||||
|
|
||||
34 | pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {}
|
||||
| ^^
|
||||
@@ -0,0 +1,39 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::Hooks;
|
||||
use pezframe_system::pezpallet_prelude::BlockNumberFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
pub fn foo() {}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Invalid pallet::call, must have at least origin arg
|
||||
--> tests/pallet_ui/call_no_origin.rs:34:7
|
||||
|
|
||||
34 | pub fn foo() {}
|
||||
| ^^
|
||||
@@ -0,0 +1,39 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::Hooks;
|
||||
use pezframe_system::pezpallet_prelude::{BlockNumberFor, OriginFor};
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
pub fn foo(origin: OriginFor<T>) {}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Invalid pallet::call, require return type DispatchResultWithPostInfo
|
||||
--> tests/pallet_ui/call_no_return.rs:34:7
|
||||
|
|
||||
34 | pub fn foo(origin: OriginFor<T>) {}
|
||||
| ^^
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet(dev_mode)]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
#[pallet::call]
|
||||
impl <T: Config> Pallet<T> {
|
||||
pub fn foo(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
|
||||
return Err(DispatchError::BadOrigin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,26 @@
|
||||
error[E0308]: mismatched types
|
||||
--> tests/pallet_ui/call_span_for_error.rs:32:15
|
||||
|
|
||||
32 | return Err(DispatchError::BadOrigin);
|
||||
| --- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `DispatchErrorWithPostInfo<...>`, found `DispatchError`
|
||||
| |
|
||||
| arguments to this enum variant are incorrect
|
||||
|
|
||||
= note: expected struct `DispatchErrorWithPostInfo<PostDispatchInfo>`
|
||||
found enum `frame_support::pallet_prelude::DispatchError`
|
||||
help: the type constructed contains `frame_support::pallet_prelude::DispatchError` due to the type of the argument passed
|
||||
--> tests/pallet_ui/call_span_for_error.rs:32:11
|
||||
|
|
||||
32 | return Err(DispatchError::BadOrigin);
|
||||
| ^^^^------------------------^
|
||||
| |
|
||||
| this argument influences the type of `Err`
|
||||
note: tuple variant defined here
|
||||
--> $RUST/core/src/result.rs
|
||||
|
|
||||
| Err(#[stable(feature = "rust1", since = "1.0.0")] E),
|
||||
| ^^^
|
||||
help: call `Into::into` on this expression to convert `frame_support::pallet_prelude::DispatchError` into `DispatchErrorWithPostInfo<PostDispatchInfo>`
|
||||
|
|
||||
32 | return Err(DispatchError::BadOrigin.into());
|
||||
| +++++++
|
||||
@@ -0,0 +1,38 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::DispatchResult;
|
||||
use pezframe_system::pezpallet_prelude::OriginFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(10_000something)]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult { Ok(()) }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
error: invalid suffix `something` for number literal
|
||||
--> tests/pallet_ui/call_weight_argument_has_suffix.rs:32:26
|
||||
|
|
||||
32 | #[pallet::weight(10_000something)]
|
||||
| ^^^^^^^^^^^^^^^ invalid suffix `something`
|
||||
|
|
||||
= help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.)
|
||||
|
||||
error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`:
|
||||
It is deprecated to use hard-coded constant as call weight.
|
||||
Please instead benchmark all calls or put the pallet into `dev` mode.
|
||||
|
||||
For more info see:
|
||||
<https://github.com/paritytech/bizinikiwi/pull/13798>
|
||||
--> tests/pallet_ui/call_weight_argument_has_suffix.rs:32:26
|
||||
|
|
||||
32 | #[pallet::weight(10_000something)]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D deprecated` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(deprecated)]`
|
||||
@@ -0,0 +1,38 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::DispatchResult;
|
||||
use pezframe_system::pezpallet_prelude::OriginFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(123_u64)]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult { Ok(()) }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`:
|
||||
It is deprecated to use hard-coded constant as call weight.
|
||||
Please instead benchmark all calls or put the pallet into `dev` mode.
|
||||
|
||||
For more info see:
|
||||
<https://github.com/paritytech/bizinikiwi/pull/13798>
|
||||
--> tests/pallet_ui/call_weight_const_warning.rs:32:26
|
||||
|
|
||||
32 | #[pallet::weight(123_u64)]
|
||||
| ^^^^^^^
|
||||
|
|
||||
= note: `-D deprecated` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(deprecated)]`
|
||||
|
||||
error: associated function `error_metadata` is never used
|
||||
--> tests/pallet_ui/call_weight_const_warning.rs:26:12
|
||||
|
|
||||
26 | #[pallet::pallet]
|
||||
| ^^^^^^ associated function in this implementation
|
||||
|
|
||||
= note: `-D dead-code` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(dead_code)]`
|
||||
|
||||
error: associated function `new_call_variant_foo` is never used
|
||||
--> tests/pallet_ui/call_weight_const_warning.rs:33:10
|
||||
|
|
||||
29 | #[pallet::call]
|
||||
| ---- associated function in this implementation
|
||||
...
|
||||
33 | pub fn foo(_: OriginFor<T>) -> DispatchResult { Ok(()) }
|
||||
| ^^^
|
||||
@@ -0,0 +1,42 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::DispatchResult;
|
||||
use pezframe_system::pezpallet_prelude::OriginFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(123)]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult { Ok(()) }
|
||||
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight(123_custom_prefix)]
|
||||
pub fn bar(_: OriginFor<T>) -> DispatchResult { Ok(()) }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
error: invalid suffix `custom_prefix` for number literal
|
||||
--> tests/pallet_ui/call_weight_const_warning_twice.rs:36:26
|
||||
|
|
||||
36 | #[pallet::weight(123_custom_prefix)]
|
||||
| ^^^^^^^^^^^^^^^^^ invalid suffix `custom_prefix`
|
||||
|
|
||||
= help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.)
|
||||
|
||||
error: use of deprecated constant `pallet::warnings::ConstantWeight_0::_w`:
|
||||
It is deprecated to use hard-coded constant as call weight.
|
||||
Please instead benchmark all calls or put the pallet into `dev` mode.
|
||||
|
||||
For more info see:
|
||||
<https://github.com/paritytech/bizinikiwi/pull/13798>
|
||||
--> tests/pallet_ui/call_weight_const_warning_twice.rs:32:26
|
||||
|
|
||||
32 | #[pallet::weight(123)]
|
||||
| ^^^
|
||||
|
|
||||
= note: `-D deprecated` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(deprecated)]`
|
||||
|
||||
error: use of deprecated constant `pallet::warnings::ConstantWeight_1::_w`:
|
||||
It is deprecated to use hard-coded constant as call weight.
|
||||
Please instead benchmark all calls or put the pallet into `dev` mode.
|
||||
|
||||
For more info see:
|
||||
<https://github.com/paritytech/bizinikiwi/pull/13798>
|
||||
--> tests/pallet_ui/call_weight_const_warning_twice.rs:36:26
|
||||
|
|
||||
36 | #[pallet::weight(123_custom_prefix)]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
@@ -0,0 +1,67 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
|
||||
pub trait WeightInfo {
|
||||
fn foo() -> Weight;
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use super::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: crate::WeightInfo;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call(invalid)]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod assign {
|
||||
use super::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: crate::WeightInfo;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call = invalid]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
error: expected `weight`
|
||||
--> tests/pallet_ui/call_weight_inherited_invalid.rs:36:17
|
||||
|
|
||||
36 | #[pallet::call(invalid)]
|
||||
| ^^^^^^^
|
||||
|
||||
error: expected parentheses
|
||||
--> tests/pallet_ui/call_weight_inherited_invalid.rs:57:17
|
||||
|
|
||||
57 | #[pallet::call = invalid]
|
||||
| ^
|
||||
@@ -0,0 +1,70 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Weight is an ident instead of a type.
|
||||
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
pub trait WeightInfo {
|
||||
fn foo() -> Weight;
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod parentheses {
|
||||
use super::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: crate::WeightInfo;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call(weight(prefix))]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod assign {
|
||||
use super::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: crate::WeightInfo;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call(weight = prefix)]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
error[E0412]: cannot find type `prefix` in this scope
|
||||
--> tests/pallet_ui/call_weight_inherited_invalid2.rs:39:24
|
||||
|
|
||||
39 | #[pallet::call(weight(prefix))]
|
||||
| ^^^^^^ not found in this scope
|
||||
|
||||
error[E0412]: cannot find type `prefix` in this scope
|
||||
--> tests/pallet_ui/call_weight_inherited_invalid2.rs:60:26
|
||||
|
|
||||
60 | #[pallet::call(weight = prefix)]
|
||||
| ^^^^^^ not found in this scope
|
||||
@@ -0,0 +1,70 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Call weight is an LitInt instead of a type.
|
||||
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
pub trait WeightInfo {
|
||||
fn foo() -> Weight;
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod parentheses {
|
||||
use super::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: crate::WeightInfo;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call(weight(123))]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod assign {
|
||||
use super::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: crate::WeightInfo;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call(weight = 123)]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
error: expected one of: `for`, parentheses, `fn`, `unsafe`, `extern`, identifier, `::`, `<`, `dyn`, square brackets, `*`, `&`, `!`, `impl`, `_`, lifetime
|
||||
--> tests/pallet_ui/call_weight_inherited_invalid3.rs:39:24
|
||||
|
|
||||
39 | #[pallet::call(weight(123))]
|
||||
| ^^^
|
||||
|
||||
error: expected one of: `for`, parentheses, `fn`, `unsafe`, `extern`, identifier, `::`, `<`, `dyn`, square brackets, `*`, `&`, `!`, `impl`, `_`, lifetime
|
||||
--> tests/pallet_ui/call_weight_inherited_invalid3.rs:60:26
|
||||
|
|
||||
60 | #[pallet::call(weight = 123)]
|
||||
| ^^^
|
||||
|
||||
error: unused import: `frame_system::pallet_prelude::*`
|
||||
--> tests/pallet_ui/call_weight_inherited_invalid3.rs:21:5
|
||||
|
|
||||
21 | use frame_system::pallet_prelude::*;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D unused-imports` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(unused_imports)]`
|
||||
@@ -0,0 +1,69 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Function does not exist in the trait.
|
||||
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
pub trait WeightInfo {
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod parentheses {
|
||||
use super::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: crate::WeightInfo;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call(weight(<T as Config>::WeightInfo))]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod assign {
|
||||
use super::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
type WeightInfo: crate::WeightInfo;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call(weight = <T as Config>::WeightInfo)]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
error[E0599]: no function or associated item named `foo` found for associated type `<T as parentheses::Config>::WeightInfo` in the current scope
|
||||
--> tests/pallet_ui/call_weight_inherited_invalid4.rs:41:10
|
||||
|
|
||||
41 | pub fn foo(_: OriginFor<T>) -> DispatchResult {
|
||||
| ^^^ function or associated item not found in `<T as Config>::WeightInfo`
|
||||
|
||||
error[E0599]: no function or associated item named `foo` found for associated type `<T as assign::Config>::WeightInfo` in the current scope
|
||||
--> tests/pallet_ui/call_weight_inherited_invalid4.rs:62:10
|
||||
|
|
||||
62 | pub fn foo(_: OriginFor<T>) -> DispatchResult {
|
||||
| ^^^ function or associated item not found in `<T as Config>::WeightInfo`
|
||||
@@ -0,0 +1,61 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Stray tokens after good input.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod parentheses {
|
||||
use super::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call(weight(<T as Config>::WeightInfo straycat))]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod assign {
|
||||
use super::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call(weight = <T as Config>::WeightInfo straycat)]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
pub fn foo(_: OriginFor<T>) -> DispatchResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
error: unexpected token, expected `)`
|
||||
--> tests/pallet_ui/call_weight_inherited_invalid5.rs:31:50
|
||||
|
|
||||
31 | #[pallet::call(weight(<T as Config>::WeightInfo straycat))]
|
||||
| ^^^^^^^^
|
||||
|
||||
error: unexpected token, expected `)`
|
||||
--> tests/pallet_ui/call_weight_inherited_invalid5.rs:51:52
|
||||
|
|
||||
51 | #[pallet::call(weight = <T as Config>::WeightInfo straycat)]
|
||||
| ^^^^^^^^
|
||||
@@ -0,0 +1,38 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::DispatchResult;
|
||||
use pezframe_system::pezpallet_prelude::OriginFor;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(*_unused)]
|
||||
pub fn foo(_: OriginFor<T>, _unused: u64) -> DispatchResult { Ok(()) }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
error: use of deprecated constant `pallet::warnings::UncheckedWeightWitness_0::_w`:
|
||||
It is deprecated to not check weight witness data.
|
||||
Please instead ensure that all witness data for weight calculation is checked before usage.
|
||||
|
||||
For more info see:
|
||||
<https://github.com/pezkuwichain/pezkuwichain-sdk/pull/1818>
|
||||
--> tests/pallet_ui/call_weight_unchecked_warning.rs:33:31
|
||||
|
|
||||
33 | pub fn foo(_: OriginFor<T>, _unused: u64) -> DispatchResult { Ok(()) }
|
||||
| ^^^^^^^
|
||||
|
|
||||
= note: `-D deprecated` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(deprecated)]`
|
||||
|
||||
error: associated function `error_metadata` is never used
|
||||
--> tests/pallet_ui/call_weight_unchecked_warning.rs:26:12
|
||||
|
|
||||
26 | #[pallet::pallet]
|
||||
| ^^^^^^ associated function in this implementation
|
||||
|
|
||||
= note: `-D dead-code` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(dead_code)]`
|
||||
|
||||
error: associated function `new_call_variant_foo` is never used
|
||||
--> tests/pallet_ui/call_weight_unchecked_warning.rs:33:10
|
||||
|
|
||||
29 | #[pallet::call]
|
||||
| ---- associated function in this implementation
|
||||
...
|
||||
33 | pub fn foo(_: OriginFor<T>, _unused: u64) -> DispatchResult { Ok(()) }
|
||||
| ^^^
|
||||
@@ -0,0 +1,44 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
if Self::in_code_storage_version() != Self::on_chain_storage_version() {
|
||||
|
||||
}
|
||||
|
||||
Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,13 @@
|
||||
error[E0369]: binary operation `!=` cannot be applied to type `NoStorageVersionSet`
|
||||
--> tests/pallet_ui/compare_unset_storage_version.rs:32:39
|
||||
|
|
||||
32 | if Self::in_code_storage_version() != Self::on_chain_storage_version() {
|
||||
| ------------------------------- ^^ -------------------------------- StorageVersion
|
||||
| |
|
||||
| NoStorageVersionSet
|
||||
|
|
||||
note: the foreign item type `NoStorageVersionSet` doesn't implement `PartialEq<StorageVersion>`
|
||||
--> $WORKSPACE/bizinikiwi/frame/support/src/traits/metadata.rs
|
||||
|
|
||||
| pub struct NoStorageVersionSet;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not implement `PartialEq<StorageVersion>`
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::composite_enum]
|
||||
pub enum HoldReasons {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
error: expected one of: `FreezeReason`, `HoldReason`, `LockId`, `SlashReason`, `Task`
|
||||
--> tests/pallet_ui/composite_enum_unsupported_identifier.rs:27:11
|
||||
|
|
||||
27 | pub enum HoldReasons {}
|
||||
| ^^^^^^^^^^^
|
||||
@@ -0,0 +1,39 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config(with_default, without_automatic_metadata, without_automatic_metadata)]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
#[pallet::constant]
|
||||
type MyGetParam2: Get<u32>;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Invalid duplicated attribute for `#[pallet::config]`. Please remove duplicates: without_automatic_metadata.
|
||||
--> tests/pallet_ui/config_duplicate_attr.rs:23:12
|
||||
|
|
||||
23 | #[pallet::config(with_default, without_automatic_metadata, without_automatic_metadata)]
|
||||
| ^^^^^^
|
||||
@@ -0,0 +1,42 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
#[pallet::constant]
|
||||
type MyGetParam2: Get<u32>;
|
||||
|
||||
#[pallet::include_metadata]
|
||||
type MyNonScaleTypeInfo;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Invalid #[pallet::include_metadata] in #[pallet::config], collected type `MyNonScaleTypeInfo` does not implement `TypeInfo` or `Parameter`
|
||||
--> tests/pallet_ui/config_metadata_non_type_info.rs:28:4
|
||||
|
|
||||
28 | #[pallet::include_metadata]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -0,0 +1,40 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
#[pallet::constant]
|
||||
#[pallet::include_metadata]
|
||||
type MyGetParam2: Get<u32>;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Invalid #[pallet::include_metadata]: conflict with #[pallet::constant]. Pallet constant already collect the metadata for the type.
|
||||
--> tests/pallet_ui/config_metadata_on_constants.rs:26:10
|
||||
|
|
||||
26 | #[pallet::include_metadata]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -0,0 +1,44 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
#[pallet::no_default_bounds]
|
||||
#[pallet::include_metadata]
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
|
||||
#[pallet::constant]
|
||||
type MyGetParam2: Get<u32>;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,5 @@
|
||||
error: Invalid #[pallet::include_metadata] for `type RuntimeEvent`. The associated type `RuntimeEvent` is already collected in the metadata.
|
||||
--> tests/pallet_ui/config_metadata_on_events.rs:26:4
|
||||
|
|
||||
26 | #[pallet::include_metadata]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
mod pallet {
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
#[pallet::constant]
|
||||
type MyGetParam2: Get<Self::Block>;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
error[E0220]: associated type `Block` not found for `Self`
|
||||
--> tests/pallet_ui/default_config_with_no_default_in_system.rs:25:31
|
||||
|
|
||||
25 | type MyGetParam2: Get<Self::Block>;
|
||||
| ^^^^^ there is an associated type `Block` in the trait `frame_system::Config`
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user