Skip to content

Commit

Permalink
minor leftover
Browse files Browse the repository at this point in the history
  • Loading branch information
wirednkod committed Sep 12, 2023
1 parent 96f7ffd commit 48ea08b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 1 addition & 2 deletions crates/configuration/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,7 @@ mod tests {

#[test]
fn the_toml_config_should_be_imported_and_match_a_network() {
let load_from_toml =
NetworkConfigBuilder::load_from_toml("./testing/snapshots/0000-small-network.toml")
let load_from_toml = NetworkConfig::load_from_toml("./testing/snapshots/0000-small-network.toml")
.unwrap();

let expected = NetworkConfigBuilder::new()
Expand Down
2 changes: 1 addition & 1 deletion crates/configuration/src/relaychain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl<A> RelaychainConfigBuilder<A> {

fn default_chain_context(&self) -> ChainDefaultContext {
let mut chain_default = ChainDefaultContext::default();
chain_default.default_command = self.config.default_command().cloned();
chain_default.default_command = self.config.default_command().cloned();
chain_default.default_image = self.config.default_image().cloned();
chain_default.default_resources = self.config.default_resources.clone();
chain_default.default_db_snapshot = self.config.default_db_snapshot.clone();
Expand Down
11 changes: 9 additions & 2 deletions crates/configuration/src/shared/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@ impl Serialize for NodeConfig {
state.serialize_field("command", &self.command)?;
}

if self.args.is_empty() || self.args() == self.chain_context.default_args.iter().collect::<Vec<&Arg>>() {
if self.args.is_empty()
|| self.args()
== self
.chain_context
.default_args
.iter()
.collect::<Vec<&Arg>>()
{
state.skip_field("args")?;
} else {
state.serialize_field("args", &self.args)?;
Expand Down Expand Up @@ -704,7 +711,7 @@ mod tests {
assert_eq!(node_config.command().unwrap().as_str(), "mycommand");
assert_eq!(node_config.image().unwrap().as_str(), "myrepo:myimage");
let args: Vec<Arg> = vec![("--arg1", "value1").into(), "--option2".into()];
assert_eq!(node_config.args(), args);
assert_eq!(node_config.args(), args.iter().collect::<Vec<_>>());
assert!(node_config.is_validator());
assert!(node_config.is_invulnerable());
assert!(node_config.is_bootnode());
Expand Down

0 comments on commit 48ea08b

Please sign in to comment.