@@ -15,7 +15,7 @@ use std::{
15
15
} ;
16
16
use symlink:: { remove_symlink_file, symlink_file} ;
17
17
use tempfile:: { Builder , NamedTempFile } ;
18
- use toml_edit:: { value, Document , Formatted , Item , Table , Value } ;
18
+ use toml_edit:: { value, DocumentMut , Formatted , Item , Table , Value } ;
19
19
use url:: Url ;
20
20
use zombienet_sdk:: { Network , NetworkConfig , NetworkConfigExt } ;
21
21
use zombienet_support:: fs:: local:: LocalFileSystem ;
@@ -26,7 +26,7 @@ pub struct Zombienet {
26
26
/// The cache location, used for caching binaries.
27
27
cache : PathBuf ,
28
28
/// The config to be used to launch a network.
29
- network_config : ( PathBuf , Document ) ,
29
+ network_config : ( PathBuf , DocumentMut ) ,
30
30
/// The binary required to launch the relay chain.
31
31
relay_chain : Binary ,
32
32
/// The binaries required to launch parachains.
@@ -43,7 +43,7 @@ impl Zombienet {
43
43
) -> Result < Self > {
44
44
// Parse network config
45
45
let network_config_path = PathBuf :: from ( network_config) ;
46
- let config = std:: fs:: read_to_string ( & network_config_path) ?. parse :: < Document > ( ) ?;
46
+ let config = std:: fs:: read_to_string ( & network_config_path) ?. parse :: < DocumentMut > ( ) ?;
47
47
// Determine binaries
48
48
let relay_chain_binary = Self :: relay_chain ( relay_chain_version, & config, & cache) . await ?;
49
49
let mut parachain_binaries = IndexMap :: new ( ) ;
@@ -257,7 +257,7 @@ impl Zombienet {
257
257
258
258
async fn relay_chain (
259
259
version : Option < & String > ,
260
- network_config : & Document ,
260
+ network_config : & DocumentMut ,
261
261
cache : & PathBuf ,
262
262
) -> Result < Binary > {
263
263
const BINARY : & str = "polkadot" ;
@@ -602,7 +602,7 @@ mod tests {
602
602
let cache = PathBuf :: from ( temp_dir. path ( ) ) ;
603
603
604
604
let network_config_path = PathBuf :: from ( CONFIG_FILE_PATH ) ;
605
- let config = std:: fs:: read_to_string ( & network_config_path) ?. parse :: < Document > ( ) ?;
605
+ let config = std:: fs:: read_to_string ( & network_config_path) ?. parse :: < DocumentMut > ( ) ?;
606
606
607
607
let binary_relay_chain =
608
608
Zombienet :: relay_chain ( Some ( & TESTING_POLKADOT_VERSION . to_string ( ) ) , & config, & cache)
@@ -627,7 +627,7 @@ mod tests {
627
627
let cache = PathBuf :: from ( temp_dir. path ( ) ) ;
628
628
629
629
let network_config_path = PathBuf :: from ( CONFIG_FILE_PATH ) ;
630
- let config = std:: fs:: read_to_string ( & network_config_path) ?. parse :: < Document > ( ) ?;
630
+ let config = std:: fs:: read_to_string ( & network_config_path) ?. parse :: < DocumentMut > ( ) ?;
631
631
632
632
// Ideally here we will Mock GitHub struct and its get_latest_release function response
633
633
let binary_relay_chain = Zombienet :: relay_chain ( None , & config, & cache) . await ?;
@@ -651,7 +651,7 @@ mod tests {
651
651
let network_config_path = generate_wrong_config_no_relay ( & temp_dir)
652
652
. expect ( "Error generating the testing toml file" ) ;
653
653
654
- let config = std:: fs:: read_to_string ( & network_config_path) ?. parse :: < Document > ( ) ?;
654
+ let config = std:: fs:: read_to_string ( & network_config_path) ?. parse :: < DocumentMut > ( ) ?;
655
655
656
656
let result_error =
657
657
Zombienet :: relay_chain ( Some ( & TESTING_POLKADOT_VERSION . to_string ( ) ) , & config, & cache)
0 commit comments