Refactoring Checkpoint: (WIP)

This commit is contained in:
2025-12-14 10:29:31 +03:00
parent 09735eb97a
commit c89d7cac55
1424 changed files with 6415 additions and 6064 deletions
+6 -6
View File
@@ -1,5 +1,5 @@
[package]
name = "node-testing"
name = "pez-node-testing"
version = "3.0.0-dev"
authors.workspace = true
description = "Test utilities for Bizinikiwi node."
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage.workspace = true
repository.workspace = true
publish = false
documentation = "https://docs.rs/node-testing"
documentation = "https://docs.rs/pez-node-testing"
[lints]
workspace = true
@@ -22,10 +22,10 @@ pezframe-metadata-hash-extension = { workspace = true, default-features = true }
pezframe-system = { workspace = true, default-features = true }
fs_extra = { workspace = true }
futures = { workspace = true }
kitchensink-runtime = { workspace = true }
pez-kitchensink-runtime = { workspace = true }
log = { workspace = true, default-features = true }
node-cli = { workspace = true }
node-primitives = { workspace = true, default-features = true }
pez-node-primitives = { workspace = true, default-features = true }
pezpallet-asset-conversion = { workspace = true, default-features = true }
pezpallet-asset-conversion-tx-payment = { workspace = true, default-features = true }
pezpallet-revive = { workspace = true, default-features = true }
@@ -57,9 +57,9 @@ tempfile = { workspace = true }
runtime-benchmarks = [
"pezframe-metadata-hash-extension/runtime-benchmarks",
"pezframe-system/runtime-benchmarks",
"kitchensink-runtime/runtime-benchmarks",
"pez-kitchensink-runtime/runtime-benchmarks",
"node-cli/runtime-benchmarks",
"node-primitives/runtime-benchmarks",
"pez-node-primitives/runtime-benchmarks",
"pezpallet-asset-conversion-tx-payment/runtime-benchmarks",
"pezpallet-asset-conversion/runtime-benchmarks",
"pezpallet-revive/runtime-benchmarks",
+8 -8
View File
@@ -34,11 +34,11 @@ use crate::{
};
use codec::{Decode, Encode};
use futures::executor;
use kitchensink_runtime::{
use pez_kitchensink_runtime::{
constants::currency::DOLLARS, AccountId, BalancesCall, CheckedExtrinsic, MinimumPeriod,
RuntimeCall, Signature, SystemCall, UncheckedExtrinsic,
};
use node_primitives::Block;
use pez_node_primitives::Block;
use pezsc_block_builder::BlockBuilderBuilder;
use pezsc_client_api::{execution_extensions::ExecutionExtensions, UsageProvider};
use pezsc_client_db::PruningMode;
@@ -267,7 +267,7 @@ pub struct BlockContentIterator<'a> {
iteration: usize,
content: BlockContent,
runtime_version: pezsc_executor::RuntimeVersion,
genesis_hash: node_primitives::Hash,
genesis_hash: pez_node_primitives::Hash,
keyring: &'a BenchKeyring,
}
@@ -301,13 +301,13 @@ impl<'a> Iterator for BlockContentIterator<'a> {
CheckedExtrinsic {
format: ExtrinsicFormat::Signed(
sender,
tx_ext(0, kitchensink_runtime::ExistentialDeposit::get() + 1),
tx_ext(0, pez_kitchensink_runtime::ExistentialDeposit::get() + 1),
),
function: match self.content.block_type {
BlockType::RandomTransfersKeepAlive =>
RuntimeCall::Balances(BalancesCall::transfer_keep_alive {
dest: pezsp_runtime::MultiAddress::Id(receiver),
value: kitchensink_runtime::ExistentialDeposit::get() + 1,
value: pez_kitchensink_runtime::ExistentialDeposit::get() + 1,
}),
BlockType::RandomTransfersReaping => {
RuntimeCall::Balances(BalancesCall::transfer_allow_death {
@@ -315,7 +315,7 @@ impl<'a> Iterator for BlockContentIterator<'a> {
// Transfer so that ending balance would be 1 less than existential
// deposit so that we kill the sender account.
value: 100 * DOLLARS -
(kitchensink_runtime::ExistentialDeposit::get() - 1),
(pez_kitchensink_runtime::ExistentialDeposit::get() - 1),
})
},
BlockType::Noop =>
@@ -610,7 +610,7 @@ impl BenchKeyring {
}
/// Generate genesis with accounts from this keyring endowed with some balance and
/// kitchensink_runtime code blob.
/// pez_kitchensink_runtime code blob.
pub fn as_storage_builder(&self) -> &dyn pezsp_runtime::BuildStorage {
self
}
@@ -620,7 +620,7 @@ impl pezsp_runtime::BuildStorage for BenchKeyring {
fn assimilate_storage(&self, storage: &mut pezsp_core::storage::Storage) -> Result<(), String> {
storage.top.insert(
pezsp_core::storage::well_known_keys::CODE.to_vec(),
kitchensink_runtime::wasm_binary_unwrap().into(),
pez_kitchensink_runtime::wasm_binary_unwrap().into(),
);
crate::genesis::config_endowed(self.collect_account_ids()).assimilate_storage(storage)
}
+9 -9
View File
@@ -16,24 +16,24 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//! Utilities to build a `TestClient` for `kitchensink-runtime`.
//! Utilities to build a `TestClient` for `pez-kitchensink-runtime`.
use pezsp_runtime::BuildStorage;
/// Re-export test-client utilities.
pub use bizinikiwi_test_client::*;
/// Call executor for `kitchensink-runtime` `TestClient`.
/// Call executor for `pez-kitchensink-runtime` `TestClient`.
use node_cli::service::RuntimeExecutor;
/// Default backend type.
pub type Backend = pezsc_client_db::Backend<node_primitives::Block>;
pub type Backend = pezsc_client_db::Backend<pez_node_primitives::Block>;
/// Test client type.
pub type Client = client::Client<
Backend,
client::LocalCallExecutor<node_primitives::Block, Backend, RuntimeExecutor>,
node_primitives::Block,
kitchensink_runtime::RuntimeApi,
client::LocalCallExecutor<pez_node_primitives::Block, Backend, RuntimeExecutor>,
pez_node_primitives::Block,
pez_kitchensink_runtime::RuntimeApi,
>;
/// Genesis configuration parameters for `TestClient`.
@@ -45,7 +45,7 @@ impl bizinikiwi_test_client::GenesisInit for GenesisParameters {
let mut storage = crate::genesis::config().build_storage().unwrap();
storage.top.insert(
pezsp_core::storage::well_known_keys::CODE.to_vec(),
kitchensink_runtime::wasm_binary_unwrap().into(),
pez_kitchensink_runtime::wasm_binary_unwrap().into(),
);
storage
}
@@ -62,8 +62,8 @@ pub trait TestClientBuilderExt: Sized {
impl TestClientBuilderExt
for bizinikiwi_test_client::TestClientBuilder<
node_primitives::Block,
client::LocalCallExecutor<node_primitives::Block, Backend, RuntimeExecutor>,
pez_node_primitives::Block,
client::LocalCallExecutor<pez_node_primitives::Block, Backend, RuntimeExecutor>,
Backend,
GenesisParameters,
>
+1 -1
View File
@@ -19,7 +19,7 @@
//! Genesis Configuration.
use crate::keyring::*;
use kitchensink_runtime::{
use pez_kitchensink_runtime::{
constants::currency::*, AccountId, AssetsConfig, BalancesConfig, IndicesConfig,
RuntimeGenesisConfig, SessionConfig, SocietyConfig, StakerStatus, StakingConfig,
};
+2 -2
View File
@@ -19,8 +19,8 @@
//! Test accounts.
use codec::Encode;
use kitchensink_runtime::{CheckedExtrinsic, SessionKeys, TxExtension, UncheckedExtrinsic};
use node_primitives::{AccountId, Balance, Nonce};
use pez_kitchensink_runtime::{CheckedExtrinsic, SessionKeys, TxExtension, UncheckedExtrinsic};
use pez_node_primitives::{AccountId, Balance, Nonce};
use pezsp_core::{crypto::get_public_from_string_or_panic, ecdsa, ed25519, sr25519};
use pezsp_crypto_hashing::blake2_256;
use pezsp_keyring::Sr25519Keyring;