Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions crates/pop-chains/artifacts/coretime-paseo-local.json

Large diffs are not rendered by default.

70 changes: 0 additions & 70 deletions crates/pop-chains/artifacts/passet-hub-spec.json

This file was deleted.

4 changes: 2 additions & 2 deletions crates/pop-chains/src/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,7 @@ edition = "2021"
profile: Profile::Release,
};
let original_chain_spec_path =
PathBuf::from("artifacts/passet-hub-spec.json").canonicalize()?;
PathBuf::from("artifacts/coretime-paseo-local.json").canonicalize()?;
assert!(original_chain_spec_path.exists());
let chain_spec_path = temp_dir.path().join(original_chain_spec_path.file_name().unwrap());
fs::copy(&original_chain_spec_path, &chain_spec_path)?;
Expand Down Expand Up @@ -1812,7 +1812,7 @@ edition = "2021"
profile: Profile::Release,
};
let original_chain_spec_path =
PathBuf::from("artifacts/passet-hub-spec.json").canonicalize()?;
PathBuf::from("artifacts/coretime-paseo-local.json").canonicalize()?;
let chain_spec_path = temp_dir.path().join(original_chain_spec_path.file_name().unwrap());
fs::copy(&original_chain_spec_path, &chain_spec_path)?;
let final_wasm_path = temp_dir.path().join("runtime.wasm");
Expand Down
5 changes: 0 additions & 5 deletions crates/pop-chains/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,3 @@ pub use templates::{ChainTemplate, Config, Provider};
pub use utils::helpers::{get_preset_names, is_initial_endowment_valid};
/// Information about the Node. External export from Zombienet-SDK.
pub use zombienet_sdk::NetworkNode;

const PASSET_HUB_SPEC_JSON: &str = include_str!("../artifacts/passet-hub-spec.json");
fn get_passet_hub_spec_content() -> &'static str {
PASSET_HUB_SPEC_JSON
}
3 changes: 1 addition & 2 deletions crates/pop-chains/src/registry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const REGISTRAR: fn(Registry) -> Registry = |mut registry| {
BridgeHub::new(1_002, Paseo).into(),
Coretime::new(1_004, Paseo).into(),
People::new(1_005, Paseo).into(),
PassetHub::new(1_111, Paseo).into(),
// Others
Pop::new(4_001, "pop-devnet-local").into(),
],
Expand Down Expand Up @@ -304,7 +303,7 @@ mod tests {
assert!(contains::<BridgeHub>(registry, 1_002));
assert!(contains::<Coretime>(registry, 1_004));
assert!(contains::<People>(registry, 1_005));
assert!(contains::<PassetHub>(registry, 1_111));

assert!(contains::<Pop>(registry, 4_001));
}

Expand Down
29 changes: 0 additions & 29 deletions crates/pop-chains/src/registry/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,24 +169,6 @@ impl People {
}
impl_system_chain!(People);

/// The PassetHub system chain is a temporary chain within the Polkadot ecosystem dedicated
/// to deploy smart contracts..
///
/// See <https://docs.polkadot.com/polkadot-protocol/smart-contract-basics/networks/#passet-hub> for more details.
#[derive(Clone)]
pub struct PassetHub(Chain);
impl PassetHub {
/// A new instance of the PassetHub chain.
///
/// # Arguments
/// * `id` - The chain identifier.
/// * `relay` - The relay chain.
pub fn new(id: Id, relay: Relay) -> Self {
Self(Chain::new("passet-hub", id, format!("passet-hub-{}", relay.chain())))
}
}
impl_system_chain!(PassetHub);

#[cfg(test)]
mod tests {
use super::*;
Expand Down Expand Up @@ -276,15 +258,4 @@ mod tests {
assert_eq!(people.name(), "people");
assert_eq!(people.source().unwrap(), System.source().unwrap());
}

#[test]
fn passet_hub_works() {
let passethub = PassetHub::new(1_111, Relay::Paseo);
assert_eq!(passethub.args(), System.args());
assert_eq!(passethub.binary(), "polkadot-parachain");
assert_eq!(passethub.chain(), "passet-hub-paseo-local");
assert!(passethub.genesis_overrides().is_none());
assert_eq!(passethub.name(), "passet-hub");
assert_eq!(passethub.source().unwrap(), System.source().unwrap());
}
}
17 changes: 2 additions & 15 deletions crates/pop-chains/src/up/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ impl NetworkConfiguration {

// Resolve paths to parachain binary and chain spec generator
let binary_path = NetworkConfiguration::resolve_path(&para.binary.path())?;
let mut chain_spec_generator = match &para.chain_spec_generator {
let chain_spec_generator = match &para.chain_spec_generator {
None => None,
Some(path) => Some(format!(
"{} {}",
Expand All @@ -546,17 +546,6 @@ impl NetworkConfiguration {
// Chain spec
if let Some(chain) = source.chain() {
builder = builder.with_chain(chain.as_str());
// TODO: Just a temporary fix, once Paseo chain-spec-generator supports
// passet-hub just remove this.
if chain.as_str().contains("passet-hub") {
let chain_spec = crate::get_passet_hub_spec_content();
let temp_dir = std::env::temp_dir();
let spec_path = temp_dir.join("passet-hub-spec.json");
std::fs::write(&spec_path, chain_spec)
.expect("Failed to write passet-hub chain spec");
builder = builder.with_chain_spec_path(spec_path);
chain_spec_generator = None;
}
}
if let Some(command) = source.chain_spec_command() {
builder = builder.with_chain_spec_command(command);
Expand Down Expand Up @@ -2008,9 +1997,7 @@ chain = "paseo-local"

let relay_config = config.0.relaychain();
assert_eq!(relay_config.chain().as_str(), relay_chain);
// TODO: Just a temporary removal, once Paseo chain-spec-generator supports
// passet-hub just remove the comment.
//assert_eq!(relay_config.nodes().len(), chains.len().max(2));
assert_eq!(relay_config.nodes().len(), chains.len().max(2));
assert_eq!(
relay_config.nodes().iter().map(|n| n.name()).collect::<Vec<_>>(),
VALIDATORS.into_iter().take(relay_config.nodes().len()).collect::<Vec<_>>()
Expand Down
Loading