mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-13 03:25:50 +00:00
64877492c5
Adds a warning to FRAME pallets when a function argument that starts
with `_` is used in the weight formula.
This is in most cases an error since the weight witness needs to be
checked.
Example:
```rust
#[pallet::call_index(0)]
#[pallet::weight(T::SystemWeightInfo::remark(_remark.len() as u32))]
pub fn remark(_origin: OriginFor<T>, _remark: Vec<u8>) -> DispatchResultWithPostInfo {
Ok(().into())
}
```
Produces this warning:
```pre
warning: 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/paritytech/polkadot-sdk/pull/1818>
--> substrate/frame/system/src/lib.rs:424:40
|
424 | pub fn remark(_origin: OriginFor<T>, _remark: Vec<u8>) -> DispatchResultWithPostInfo {
| ^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
```
Can be suppressed like this, since in this case it is legit:
```rust
#[pallet::call_index(0)]
#[pallet::weight(T::SystemWeightInfo::remark(remark.len() as u32))]
pub fn remark(_origin: OriginFor<T>, remark: Vec<u8>) -> DispatchResultWithPostInfo {
let _ = remark; // We dont need to check the weight witness.
Ok(().into())
}
```
Changes:
- Add warning on uncheded weight witness
- Respect `subkeys` limit in `System::kill_prefix`
- Fix HRMP pallet and other warnings
- Update`proc_macro_warning` dependency
- Delete random folder `substrate/src/src` 🙈
- Adding Prdoc
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
39 lines
1.0 KiB
TOML
39 lines
1.0 KiB
TOML
[package]
|
|
name = "frame-support-procedural"
|
|
version = "4.0.0-dev"
|
|
authors.workspace = true
|
|
edition.workspace = true
|
|
license = "Apache-2.0"
|
|
homepage = "https://substrate.io"
|
|
repository.workspace = true
|
|
description = "Proc macro of Support code for the runtime."
|
|
|
|
[package.metadata.docs.rs]
|
|
targets = ["x86_64-unknown-linux-gnu"]
|
|
|
|
[lib]
|
|
proc-macro = true
|
|
|
|
[dependencies]
|
|
derive-syn-parse = "0.1.5"
|
|
Inflector = "0.11.4"
|
|
cfg-expr = "0.15.5"
|
|
itertools = "0.10.3"
|
|
proc-macro2 = "1.0.56"
|
|
quote = "1.0.28"
|
|
syn = { version = "2.0.38", features = ["full"] }
|
|
frame-support-procedural-tools = { path = "tools" }
|
|
proc-macro-warning = { version = "1.0.0", default-features = false }
|
|
macro_magic = { version = "0.4.2", features = ["proc_support"] }
|
|
expander = "2.0.0"
|
|
sp-core-hashing = { path = "../../../primitives/core/hashing" }
|
|
|
|
[features]
|
|
default = [ "std" ]
|
|
std = []
|
|
no-metadata-docs = []
|
|
# Generate impl-trait for tuples with the given number of tuples. Will be needed as the number of
|
|
# pallets in a runtime grows. Does increase the compile time!
|
|
tuples-96 = []
|
|
tuples-128 = []
|