Skip to content

Commit 35a98e6

Browse files
committed
feat: remove network configuration from base-parachain
1 parent 2004ce6 commit 35a98e6

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

crates/pop-chains/src/generator/chain.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,3 @@ pub(crate) struct ChainSpec {
1111
// Identifies the template used to generate the chain.
1212
pub(crate) based_on: String,
1313
}
14-
15-
#[derive(Template)]
16-
#[template(path = "base/network.templ", escape = "none")]
17-
pub(crate) struct Network {
18-
pub(crate) node: String,
19-
}

crates/pop-chains/src/new_chain.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use crate::{
44
ChainTemplate, Config, Provider,
5-
generator::chain::{ChainSpec, Network},
5+
generator::chain::ChainSpec,
66
utils::helpers::{sanitize, write_to_file},
77
};
88
use anyhow::Result;
@@ -73,9 +73,6 @@ pub fn instantiate_standard_template(
7373
&target.join("node/src/chain_spec.rs"),
7474
chainspec.render().expect("infallible").as_ref(),
7575
)?;
76-
// Add network configuration
77-
let network = Network { node: "parachain-template-node".into() };
78-
write_to_file(&target.join("network.toml"), network.render().expect("infallible").as_ref())?;
7976
Ok(tag)
8077
}
8178

@@ -97,7 +94,7 @@ pub fn instantiate_openzeppelin_template(
9794
mod tests {
9895
use super::*;
9996
use anyhow::Result;
100-
use std::{env::current_dir, fs};
97+
use std::fs;
10198

10299
fn setup_template_and_instantiate() -> Result<tempfile::TempDir> {
103100
let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
@@ -129,17 +126,6 @@ mod tests {
129126
);
130127
assert!(generated_file_content.contains("1000000"));
131128

132-
// Verify network.toml contains expected content
133-
let generated_file_content =
134-
fs::read_to_string(temp_dir.path().join("network.toml")).expect("Failed to read file");
135-
let expected_file_content =
136-
fs::read_to_string(current_dir()?.join("./templates/base/network.templ"))
137-
.expect("Failed to read file");
138-
assert_eq!(
139-
generated_file_content,
140-
expected_file_content.replace("^^node^^", "parachain-template-node")
141-
);
142-
143129
Ok(())
144130
}
145131

0 commit comments

Comments
 (0)