Skip to content

Commit 9ba979c

Browse files
yito88tzemanovic
authored andcommitted
fix to write toml files
1 parent 5fb54e6 commit 9ba979c

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

crates/tests/src/e2e/helpers.rs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,12 @@ pub fn update_cosmos_config(test: &Test) -> Result<()> {
725725
.write(true)
726726
.truncate(true)
727727
.open(&config_path)?;
728-
file.write_all(values.to_string().as_bytes()).map_err(|e| {
728+
file.write_all(
729+
toml::to_string(&values)
730+
.expect("Values should be converted")
731+
.as_bytes(),
732+
)
733+
.map_err(|e| {
729734
eyre!(format!("Writing a Cosmos config file failed: {}", e))
730735
})?;
731736

@@ -742,9 +747,12 @@ pub fn update_cosmos_config(test: &Test) -> Result<()> {
742747
.write(true)
743748
.truncate(true)
744749
.open(&app_path)?;
745-
file.write_all(values.to_string().as_bytes()).map_err(|e| {
746-
eyre!(format!("Writing a Cosmos app.toml failed: {}", e))
747-
})?;
750+
file.write_all(
751+
toml::to_string(&values)
752+
.expect("Values should be converted")
753+
.as_bytes(),
754+
)
755+
.map_err(|e| eyre!(format!("Writing a Cosmos app.toml failed: {}", e)))?;
748756

749757
let genesis_path = cosmos_dir.join("config/genesis.json");
750758
let s = std::fs::read_to_string(&genesis_path)
@@ -782,7 +790,7 @@ pub fn update_cosmos_config(test: &Test) -> Result<()> {
782790
.open(&genesis_path)?;
783791
let writer = std::io::BufWriter::new(file);
784792
serde_json::to_writer_pretty(writer, &genesis)
785-
.expect("Writing Cosmos genesis.toml failed");
793+
.expect("Writing Cosmos genesis.json failed");
786794

787795
if matches!(chain_type, CosmosChainType::Osmosis) {
788796
let client_path = cosmos_dir.join("config/client.toml");
@@ -800,7 +808,12 @@ pub fn update_cosmos_config(test: &Test) -> Result<()> {
800808
.write(true)
801809
.truncate(true)
802810
.open(&client_path)?;
803-
file.write_all(values.to_string().as_bytes()).map_err(|e| {
811+
file.write_all(
812+
toml::to_string(&values)
813+
.expect("Values should be converted")
814+
.as_bytes(),
815+
)
816+
.map_err(|e| {
804817
eyre!(format!(
805818
"Writing a Osmosis client config file failed: {}",
806819
e

crates/tests/src/e2e/ibc_tests.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2335,7 +2335,8 @@ fn run_cosmos(test: &Test, kill: bool) -> Result<NamadaCmd> {
23352335
}
23362336
let port_arg = format!("0.0.0.0:{}", chain_type.get_grpc_port_number());
23372337
let args = ["start", "--pruning", "nothing", "--grpc.address", &port_arg];
2338-
let cosmos = run_cosmos_cmd(test, args, Some(40))?;
2338+
let mut cosmos = run_cosmos_cmd(test, args, Some(40))?;
2339+
cosmos.exp_string("finalized block")?;
23392340
Ok(cosmos)
23402341
}
23412342

0 commit comments

Comments
 (0)