chore: regenerate umbrella crate, fix feature propagation

This commit is contained in:
2025-12-16 11:28:32 +03:00
parent dd6d48f528
commit 620b0e3aa0
1358 changed files with 9464 additions and 7656 deletions
@@ -35,7 +35,8 @@ pub mod pezpallet {
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
#[allow(deprecated)]
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
type RuntimeEvent: From<Event<Self>>
+ IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
type XcmExecutor: ExecuteXcm<Self::RuntimeCall>;
}
@@ -841,9 +841,9 @@ fn expand_functions(def: &EnvDef, expand_mode: ExpandMode) -> TokenStream2 {
/// The function `bar` is additionally annotated with `unstable` which removes it from the stable
/// interface. Check out the README to learn about unstable functions.
///
/// In legacy versions of pezpallet_contracts, it was a naming convention that all host functions had
/// to be named with the `seal_` prefix. For the sake of backwards compatibility, each host function
/// now can get a such prefix-named alias function generated by marking it by the
/// In legacy versions of pezpallet_contracts, it was a naming convention that all host functions
/// had to be named with the `seal_` prefix. For the sake of backwards compatibility, each host
/// function now can get a such prefix-named alias function generated by marking it by the
/// `#[prefixed_alias]` attribute:
///
/// ## Example
@@ -417,7 +417,8 @@ mod benchmarks {
StorageVersion::new(latest_version).put::<Pezpallet<T>>();
#[block]
{
<Migration<T, false> as pezframe_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade();
<Migration<T, false> as pezframe_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade(
);
}
assert!(MigrationInProgress::<T>::get().is_none());
}
@@ -432,7 +433,8 @@ mod benchmarks {
MigrationInProgress::<T>::set(v.clone());
#[block]
{
<Migration<T, false> as pezframe_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade();
<Migration<T, false> as pezframe_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade(
);
}
assert!(MigrationInProgress::<T>::get().is_some());
assert_eq!(MigrationInProgress::<T>::get(), v);
@@ -446,7 +448,8 @@ mod benchmarks {
StorageVersion::new(latest_version - 2).put::<Pezpallet<T>>();
#[block]
{
<Migration<T, false> as pezframe_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade();
<Migration<T, false> as pezframe_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade(
);
}
assert!(MigrationInProgress::<T>::get().is_some());
}
@@ -565,7 +568,10 @@ mod benchmarks {
// value and value transferred via call should be removed from the caller
assert_eq!(
T::Currency::balance(&instance.caller),
caller_funding::<T>() - instance.value - value - deposit - Pezpallet::<T>::min_balance(),
caller_funding::<T>() -
instance.value -
value - deposit -
Pezpallet::<T>::min_balance(),
);
// contract should have received the value
assert_eq!(T::Currency::balance(&instance.account_id), before + value);
@@ -1830,8 +1836,8 @@ mod benchmarks {
let key_type = pezsp_core::crypto::KeyTypeId(*b"code");
let pub_key = pezsp_io::crypto::sr25519_generate(key_type, None);
let sig =
pezsp_io::crypto::sr25519_sign(key_type, &pub_key, &message).expect("Generates signature");
let sig = pezsp_io::crypto::sr25519_sign(key_type, &pub_key, &message)
.expect("Generates signature");
let sig = AsRef::<[u8; 64]>::as_ref(&sig).to_vec();
let sig_len = sig.len() as u32;
+2 -2
View File
@@ -41,7 +41,6 @@ use pezframe_support::{
Blake2_128Concat, BoundedVec, StorageHasher,
};
use pezframe_system::{pezpallet_prelude::BlockNumberFor, RawOrigin};
use smallvec::{Array, SmallVec};
use pezsp_core::{
ecdsa::Public as ECDSAPublic,
sr25519::{Public as SR25519Public, Signature as SR25519Signature},
@@ -52,6 +51,7 @@ use pezsp_runtime::{
traits::{Convert, Dispatchable, Zero},
DispatchError,
};
use smallvec::{Array, SmallVec};
pub type AccountIdOf<T> = <T as pezframe_system::Config>::AccountId;
pub type MomentOf<T> = <<T as Config>::Time as Time>::Moment;
@@ -1723,8 +1723,8 @@ mod tests {
use pezframe_support::{assert_err, assert_ok, parameter_types};
use pezframe_system::{EventRecord, Phase};
use pezpallet_contracts_uapi::ReturnFlags;
use pretty_assertions::assert_eq;
use pezsp_runtime::{traits::Hash, DispatchError};
use pretty_assertions::assert_eq;
use std::{cell::RefCell, collections::hash_map::HashMap, rc::Rc};
type System = pezframe_system::Pezpallet<Test>;
+13 -11
View File
@@ -27,8 +27,9 @@
//!
//! This module extends accounts based on the [`pezframe_support::traits::fungible`] traits to have
//! smart-contract functionality. It can be used with other modules that implement accounts based on
//! the [`pezframe_support::traits::fungible`] traits. These "smart-contract accounts" have the ability
//! to instantiate smart-contracts and make calls to other contract and non-contract accounts.
//! the [`pezframe_support::traits::fungible`] traits. These "smart-contract accounts" have the
//! ability to instantiate smart-contracts and make calls to other contract and non-contract
//! accounts.
//!
//! The smart-contract code is stored once, and later retrievable via its hash.
//! This means that multiple smart-contracts can be instantiated from the same hash, without
@@ -71,8 +72,8 @@
//! code an existing `code_hash` is supplied.
//! * [`Pezpallet::call`] - Makes a call to an account, optionally transferring some balance.
//! * [`Pezpallet::upload_code`] - Uploads new code without instantiating a contract from it.
//! * [`Pezpallet::remove_code`] - Removes the stored code and refunds the deposit to its owner. Only
//! allowed to code owner.
//! * [`Pezpallet::remove_code`] - Removes the stored code and refunds the deposit to its owner.
//! Only allowed to code owner.
//! * [`Pezpallet::set_code`] - Changes the code of an existing contract. Only allowed to `Root`
//! origin.
//! * [`Pezpallet::migrate`] - Runs migration steps of current multi-block migration in priority,
@@ -134,12 +135,12 @@ use pezframe_system::{
pezpallet_prelude::{BlockNumberFor, OriginFor},
EventRecord, Pezpallet as System,
};
use scale_info::TypeInfo;
use smallvec::Array;
use pezsp_runtime::{
traits::{BadOrigin, Convert, Dispatchable, Saturating, StaticLookup, Zero},
DispatchError, RuntimeDebug,
};
use scale_info::TypeInfo;
use smallvec::Array;
pub use crate::{
address::{AddressGenerator, DefaultAddressGenerator},
@@ -167,8 +168,8 @@ type EventRecordOf<T> =
/// The old weight type.
///
/// This is a copy of the [`pezframe_support::weights::OldWeight`] type since the contracts pezpallet
/// needs to support it indefinitely.
/// This is a copy of the [`pezframe_support::weights::OldWeight`] type since the contracts
/// pezpallet needs to support it indefinitely.
type OldWeight = u64;
/// Used as a sentinel value when reading and writing contract memory.
@@ -277,7 +278,8 @@ pub mod pezpallet {
/// The overarching event type.
#[pezpallet::no_default_bounds]
#[allow(deprecated)]
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
type RuntimeEvent: From<Event<Self>>
+ IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
/// The overarching call type.
#[pezpallet::no_default_bounds]
@@ -1270,8 +1272,8 @@ pub mod pezpallet {
TerminatedInConstructor,
/// A call tried to invoke a contract that is flagged as non-reentrant.
/// The only other cause is that a call from a contract into the runtime tried to call back
/// into `pezpallet-contracts`. This would make the whole pezpallet reentrant with regard to
/// contract code execution which is not supported.
/// into `pezpallet-contracts`. This would make the whole pezpallet reentrant with regard
/// to contract code execution which is not supported.
ReentranceDenied,
/// A contract attempted to invoke a state modifying API while being in read-only mode.
StateChangeDenied,
@@ -67,7 +67,9 @@ pub mod v15;
pub mod v16;
include!(concat!(env!("OUT_DIR"), "/migration_codegen.rs"));
use crate::{weights::WeightInfo, Config, Error, MigrationInProgress, Pezpallet, Weight, LOG_TARGET};
use crate::{
weights::WeightInfo, Config, Error, MigrationInProgress, Pezpallet, Weight, LOG_TARGET,
};
use codec::{Codec, Decode};
use core::marker::PhantomData;
use pezframe_support::{
@@ -578,7 +580,10 @@ mod test {
#[test]
fn test_storage_version_matches_last_migration_file() {
assert_eq!(StorageVersion::new(LATEST_MIGRATION_VERSION), crate::pezpallet::STORAGE_VERSION);
assert_eq!(
StorageVersion::new(LATEST_MIGRATION_VERSION),
crate::pezpallet::STORAGE_VERSION
);
}
#[test]
@@ -63,7 +63,8 @@ pub fn fill_old_queue<T: Config>(len: usize) {
type DeletionQueue<T: Config> = StorageMap<Pezpallet<T>, Twox64Concat, u32, TrieId>;
#[storage_alias]
type DeletionQueueCounter<T: Config> = StorageValue<Pezpallet<T>, DeletionQueueManager<T>, ValueQuery>;
type DeletionQueueCounter<T: Config> =
StorageValue<Pezpallet<T>, DeletionQueueManager<T>, ValueQuery>;
#[derive(Encode, Decode, MaxEncodedLen, DefaultNoBound)]
pub struct Migration<T: Config> {
@@ -29,11 +29,11 @@ use pezframe_support::{
pezpallet_prelude::*, storage_alias, traits::ReservableCurrency, weights::WeightMeter,
DefaultNoBound, Identity,
};
use scale_info::prelude::format;
use pezsp_core::hexdisplay::HexDisplay;
#[cfg(feature = "try-runtime")]
use pezsp_runtime::TryRuntimeError;
use pezsp_runtime::{traits::Zero, FixedPointNumber, FixedU128, Saturating};
use scale_info::prelude::format;
mod v11 {
use super::*;
@@ -72,8 +72,12 @@ pub fn store_old_contract_info<T: Config>(account: T::AccountId, info: crate::Co
}
#[storage_alias]
pub type ContractInfoOf<T: Config> =
StorageMap<Pezpallet<T>, Twox64Concat, <T as pezframe_system::Config>::AccountId, ContractInfo<T>>;
pub type ContractInfoOf<T: Config> = StorageMap<
Pezpallet<T>,
Twox64Concat,
<T as pezframe_system::Config>::AccountId,
ContractInfo<T>,
>;
#[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)]
#[scale_info(skip_type_params(T))]
@@ -111,8 +111,12 @@ struct ContractInfo<T: Config> {
}
#[storage_alias]
type ContractInfoOf<T: Config> =
StorageMap<Pezpallet<T>, Twox64Concat, <T as pezframe_system::Config>::AccountId, ContractInfo<T>>;
type ContractInfoOf<T: Config> = StorageMap<
Pezpallet<T>,
Twox64Concat,
<T as pezframe_system::Config>::AccountId,
ContractInfo<T>,
>;
#[derive(Encode, Decode, MaxEncodedLen, DefaultNoBound)]
pub struct Migration<T: Config> {
@@ -51,8 +51,12 @@ pub fn store_old_contract_info<T: Config>(
}
#[storage_alias]
pub type ContractInfoOf<T: Config> =
StorageMap<Pezpallet<T>, Twox64Concat, <T as pezframe_system::Config>::AccountId, ContractInfo<T>>;
pub type ContractInfoOf<T: Config> = StorageMap<
Pezpallet<T>,
Twox64Concat,
<T as pezframe_system::Config>::AccountId,
ContractInfo<T>,
>;
#[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)]
#[scale_info(skip_type_params(T))]
@@ -21,11 +21,11 @@ use alloc::vec::Vec;
use codec::{Decode, Encode, MaxEncodedLen};
use pezframe_support::weights::Weight;
use pezpallet_contracts_uapi::ReturnFlags;
use scale_info::TypeInfo;
use pezsp_runtime::{
traits::{Saturating, Zero},
DispatchError, RuntimeDebug,
};
use scale_info::TypeInfo;
/// Result type of a `bare_call` or `bare_instantiate` call as well as `ContractsApi::call` and
/// `ContractsApi::instantiate`.
+3 -2
View File
@@ -33,13 +33,13 @@ use pezframe_support::{
weights::{Weight, WeightMeter},
CloneNoBound, DefaultNoBound,
};
use scale_info::TypeInfo;
use pezsp_core::Get;
use pezsp_io::KillStorageResult;
use pezsp_runtime::{
traits::{Hash, Saturating, Zero},
BoundedBTreeMap, DispatchError, DispatchResult, RuntimeDebug,
};
use scale_info::TypeInfo;
use self::meter::Diff;
@@ -458,7 +458,8 @@ impl<T: Config> DeletionQueueManager<T> {
///
/// Note:
/// we use the delete counter to get the next value to read from the queue and thus don't pay
/// the cost of an extra call to `pezsp_io::storage::next_key` to lookup the next entry in the map
/// the cost of an extra call to `pezsp_io::storage::next_key` to lookup the next entry in the
/// map
fn next(&mut self) -> Option<DeletionQueueEntry<'_, T>> {
if self.is_empty() {
return None;
@@ -23,8 +23,8 @@ use crate::{
};
use codec::{Encode, HasCompact};
use core::fmt::Debug;
use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo;
use paste::paste;
use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo;
use scale_info::TypeInfo;
/// Helper macro to generate a builder for contract API calls.
+4 -3
View File
@@ -45,8 +45,8 @@ use pezframe_support::{
assert_err, assert_err_ignore_postinfo, assert_err_with_weight, assert_noop, assert_ok,
derive_impl,
dispatch::{DispatchErrorWithPostInfo, PostDispatchInfo},
pezpallet_prelude::EnsureOrigin,
parameter_types,
pezpallet_prelude::EnsureOrigin,
storage::child,
traits::{
fungible::{BalancedHold, Inspect, Mutate, MutateHold},
@@ -57,7 +57,6 @@ use pezframe_support::{
};
use pezframe_system::{EventRecord, Phase};
use pezpallet_contracts_fixtures::compile_module;
use pretty_assertions::{assert_eq, assert_ne};
use pezsp_core::ByteArray;
use pezsp_io::hashing::blake2_256;
use pezsp_keystore::{testing::MemoryKeystore, KeystoreExt};
@@ -66,6 +65,7 @@ use pezsp_runtime::{
traits::{BlakeTwo256, Convert, IdentityLookup},
AccountId32, BuildStorage, DispatchError, Perbill, TokenError,
};
use pretty_assertions::{assert_eq, assert_ne};
type Block = pezframe_system::mocking::MockBlock<Test>;
@@ -4533,7 +4533,8 @@ fn read_only_subsequent_call_cannot_store() {
builder::bare_instantiate(Code::Upload(wasm_callee)).build_and_unwrap_account_id();
// Subsequent call input.
let input = (&addr_callee, pezpallet_contracts_uapi::CallFlags::empty().bits(), 0u64, 100u32);
let input =
(&addr_callee, pezpallet_contracts_uapi::CallFlags::empty().bits(), 0u64, 100u32);
// Read-only call fails when modifying storage.
assert_err_ignore_postinfo!(
@@ -520,9 +520,9 @@ mod tests {
};
use pezframe_system::pezpallet_prelude::BlockNumberFor;
use pezpallet_contracts_uapi::ReturnFlags;
use pretty_assertions::assert_eq;
use pezsp_core::H256;
use pezsp_runtime::DispatchError;
use pretty_assertions::assert_eq;
use std::{
borrow::BorrowMut,
cell::RefCell,
@@ -28,7 +28,7 @@ use alloc::{boxed::Box, vec, vec::Vec};
use codec::{Decode, DecodeLimit, Encode, MaxEncodedLen};
use core::fmt;
use pezframe_support::{
dispatch::DispatchInfo, ensure, pezpallet_prelude::DispatchResultWithPostInfo, parameter_types,
dispatch::DispatchInfo, ensure, parameter_types, pezpallet_prelude::DispatchResultWithPostInfo,
traits::Get, weights::Weight,
};
use pezpallet_contracts_proc_macro::define_env;
@@ -61,8 +61,8 @@ pub enum AllowUnstableInterface {
Yes,
}
/// Trait implemented by the [`define_env`](pezpallet_contracts_proc_macro::define_env) macro for the
/// emitted `Env` struct.
/// Trait implemented by the [`define_env`](pezpallet_contracts_proc_macro::define_env) macro for
/// the emitted `Env` struct.
pub trait Environment<HostState> {
/// Adds all declared functions to the supplied [`Linker`](wasmi::Linker) and
/// [`Store`](wasmi::Store).