mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-04-22 03:17:56 +00:00
Fix MaxLockers (#248)
* Fix MaxLockers * fix constants * fix toolchains --------- Co-authored-by: Özgün Özerk <ozgunozerk.elo@gmail.com>
This commit is contained in:
@@ -108,6 +108,7 @@ try-runtime = [
|
||||
"polkadot-cli/try-runtime",
|
||||
"sp-runtime/try-runtime",
|
||||
]
|
||||
txpool = []
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -5,11 +5,16 @@ use serde::Deserialize;
|
||||
#[serde(tag = "type")]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum AbiItem {
|
||||
#[allow(dead_code)]
|
||||
Error(Error),
|
||||
#[allow(dead_code)]
|
||||
Function(Function),
|
||||
Constructor,
|
||||
#[allow(dead_code)]
|
||||
Event(Event),
|
||||
#[allow(dead_code)]
|
||||
Receive(Receive),
|
||||
#[allow(dead_code)]
|
||||
Default(Function),
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ use super::{abi::AbiItem, deserialize_bytecode};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct ForgeContract {
|
||||
#[allow(dead_code)]
|
||||
pub abi: Vec<AbiItem>,
|
||||
pub bytecode: ForgeBytecode,
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ use super::{abi::AbiItem, deserialize_bytecode};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct HardhatContract {
|
||||
#[allow(dead_code)]
|
||||
pub abi: Vec<AbiItem>,
|
||||
#[serde(deserialize_with = "deserialize_bytecode")]
|
||||
pub bytecode: Vec<u8>,
|
||||
|
||||
@@ -43,7 +43,9 @@ impl Contract {
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum ContractParsingError {
|
||||
#[allow(dead_code)]
|
||||
MetadataReadError(io::Error),
|
||||
#[allow(dead_code)]
|
||||
MetadataParseError(serde_json::Error),
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ impl pallet_conviction_voting::Config for Runtime {
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const MaxBalance: Balance = Balance::max_value();
|
||||
pub const MaxBalance: Balance = Balance::MAX;
|
||||
}
|
||||
pub type TreasurySpender = EitherOf<EnsureRootWithSuccess<AccountId, MaxBalance>, Spender>;
|
||||
|
||||
|
||||
@@ -214,8 +214,7 @@ pub type XcmRouter = WithUniqueTopic<(
|
||||
)>;
|
||||
|
||||
parameter_types! {
|
||||
pub const MaxLockers: u32 = 8;
|
||||
pub const MaxRemoteLockConsumers: u32 = 0;
|
||||
pub const MaxLockers: u32 = 0;
|
||||
}
|
||||
|
||||
impl pallet_xcm::Config for Runtime {
|
||||
|
||||
@@ -234,8 +234,7 @@ mod xcm_tests {
|
||||
|
||||
#[test]
|
||||
fn pallet_xcm_constants() {
|
||||
assert_eq!(MaxLockers::get(), 8);
|
||||
assert_eq!(MaxRemoteLockConsumers::get(), 0);
|
||||
assert_eq!(MaxLockers::get(), 0);
|
||||
assert_eq!(<parachain_template_runtime::Runtime as pallet_xcm::Config>::VERSION_DISCOVERY_QUEUE_SIZE, 100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[toolchain]
|
||||
channel = "nightly-2024-02-17"
|
||||
channel = "nightly-2024-06-12"
|
||||
targets = ["wasm32-unknown-unknown"]
|
||||
components = ["rustfmt", "clippy", "rust-src"]
|
||||
|
||||
@@ -96,7 +96,6 @@ fn main() {
|
||||
let mut elapsed: Duration = Duration::ZERO;
|
||||
|
||||
let start_block = |block: u32, lapse: u32| {
|
||||
#[cfg(not(fuzzing))]
|
||||
println!("\ninitializing block {}", block + lapse);
|
||||
|
||||
let next_block = block + lapse;
|
||||
@@ -197,20 +196,17 @@ fn main() {
|
||||
|
||||
current_weight = current_weight.saturating_add(call_weight);
|
||||
if current_weight.ref_time() >= max_weight.ref_time() {
|
||||
#[cfg(not(fuzzing))]
|
||||
println!("Skipping because of max weight {max_weight}");
|
||||
continue;
|
||||
}
|
||||
|
||||
externalities.execute_with(|| {
|
||||
let origin_account = endowed_accounts[origin % endowed_accounts.len()];
|
||||
#[cfg(not(fuzzing))]
|
||||
{
|
||||
println!("\n origin: {origin_account:?}");
|
||||
println!(" call: {extrinsic:?}");
|
||||
}
|
||||
let _res = extrinsic.clone().dispatch(RuntimeOrigin::signed(origin_account));
|
||||
#[cfg(not(fuzzing))]
|
||||
println!(" result: {_res:?}");
|
||||
|
||||
// Uncomment to print events for debugging purposes
|
||||
@@ -228,7 +224,6 @@ fn main() {
|
||||
elapsed += now.elapsed();
|
||||
}
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
println!("\n time spent: {elapsed:?}");
|
||||
assert!(elapsed.as_secs() <= MAX_TIME_FOR_BLOCK, "block execution took too much time");
|
||||
|
||||
@@ -237,7 +232,6 @@ fn main() {
|
||||
// Finilization
|
||||
Executive::finalize_block();
|
||||
// Invariants
|
||||
#[cfg(not(fuzzing))]
|
||||
println!("\ntesting invariants for block {current_block}");
|
||||
<AllPalletsWithSystem as TryState<BlockNumber>>::try_state(
|
||||
current_block,
|
||||
@@ -287,7 +281,6 @@ fn main() {
|
||||
"Inconsistent total issuance: {total_issuance} but counted {counted_issuance}"
|
||||
);
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
println!("running integrity tests");
|
||||
// We run all developer-defined integrity tests
|
||||
<AllPalletsWithSystem as IntegrityTest>::integrity_test();
|
||||
|
||||
Reference in New Issue
Block a user