Refactor alliance benchmarks to v2 (#1868)

- This PR refactors `alliance/src/benchmarkings.rs` to use benchmarking
v2. These changes are needed to improve the readability and
maintainability of the benchmarking code.

- No known issue to backlink.

## Local Testing 
1. `cargo build --features runtime-benchmarks` 
2. `cargo run --locked --release -p node-cli --bin substrate-node
--features runtime-benchmarks -- benchmark pallet --execution wasm
--wasm-execution compiled --chain dev --pallet "*" --extrinsic "*"
--steps 2 --repeat 1`
This commit is contained in:
0xmovses
2023-10-13 21:54:45 +01:00
committed by GitHub
parent 681e7bbfb2
commit 24840290af
2 changed files with 315 additions and 260 deletions
@@ -33,9 +33,7 @@ pub(crate) fn weight_witness_warning(
if dev_mode {
return
}
let CallWeightDef::Immediate(w) = &method.weight else {
return;
};
let CallWeightDef::Immediate(w) = &method.weight else { return };
let partial_warning = Warning::new_deprecated("UncheckedWeightWitness")
.old("not check weight witness data")
@@ -66,9 +64,7 @@ pub(crate) fn weight_constant_warning(
if dev_mode {
return
}
let syn::Expr::Lit(lit) = weight else {
return;
};
let syn::Expr::Lit(lit) = weight else { return };
let warning = Warning::new_deprecated("ConstantWeight")
.index(warnings.len())