Skip to content

Commit a4221cb

Browse files
authored
fix(deps): use toml 0.7 in server-config (#2097)
* chore: add debug logs for config * chore: use toml 0.7 in server-config only * chore: cargo.lock * fix(tests): ignore explore_services_fixed_heavy
1 parent b07e524 commit a4221cb

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ console-subscriber = "0.2.0"
147147
futures = "0.3.30"
148148
thiserror = "1.0.56"
149149
serde = "1.0.196"
150-
toml = "0.5.10"
150+
toml = "0.5.11"
151151
itertools = "0.12.1"
152152
humantime-serde = "1.1.1"
153153
cid = "0.11.0"

crates/nox-tests/tests/network/network_explore.rs

+1
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ async fn explore_services_heavy() {
330330
assert_eq!(external_addrs, expected_addrs);
331331
}
332332

333+
#[ignore]
333334
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
334335
async fn explore_services_fixed_heavy() {
335336
enable_logs();

crates/server-config/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fluence-keypair = { workspace = true }
1515
types = { workspace = true }
1616
core-manager = { workspace = true }
1717
log = "0.4.20"
18-
toml = { workspace = true }
18+
toml = "0.7.3" # otherwise deserialisation of Cargo.toml doesn't work
1919

2020
libp2p = { workspace = true }
2121
libp2p-metrics = { workspace = true }

crates/workers/src/persistence.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub(crate) async fn persist_keypair(
104104
) -> Result<(), KeyStorageError> {
105105
let path = keypairs_dir.join(keypair_file_name(worker_id));
106106
let bytes =
107-
toml::to_vec(&persisted_keypair).map_err(|err| SerializePersistedKeypair { err })?;
107+
toml::ser::to_vec(&persisted_keypair).map_err(|err| SerializePersistedKeypair { err })?;
108108
tokio::fs::write(&path, bytes)
109109
.await
110110
.map_err(|err| WriteErrorPersistedKeypair { path, err })

particle-modules/src/files.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub fn load_blueprint(bp_dir: &Path, blueprint_id: &str) -> Result<Blueprint> {
3131
let blueprint =
3232
std::fs::read(&bp_path).map_err(|err| NoSuchBlueprint { path: bp_path, err })?;
3333
let blueprint: Blueprint =
34-
toml::from_slice(blueprint.as_slice()).map_err(|err| IncorrectBlueprint { err })?;
34+
toml::de::from_slice(blueprint.as_slice()).map_err(|err| IncorrectBlueprint { err })?;
3535

3636
Ok(blueprint)
3737
}
@@ -62,7 +62,7 @@ pub fn load_config_by_path(path: &Path) -> Result<TomlMarineNamedModuleConfig> {
6262
err,
6363
})?;
6464
let config: TomlMarineNamedModuleConfig =
65-
toml::from_slice(config.as_slice()).map_err(|err| IncorrectModuleConfig { err })?;
65+
toml::de::from_slice(config.as_slice()).map_err(|err| IncorrectModuleConfig { err })?;
6666

6767
Ok(config)
6868
}
@@ -108,7 +108,7 @@ pub fn add_blueprint(blueprint_dir: &Path, blueprint: &Blueprint) -> Result<()>
108108
let path = blueprint_dir.join(blueprint_file_name(blueprint));
109109

110110
// Save blueprint to disk
111-
let bytes = toml::to_vec(&blueprint).map_err(|err| SerializeBlueprint {
111+
let bytes = toml::ser::to_vec(&blueprint).map_err(|err| SerializeBlueprint {
112112
err,
113113
blueprint: blueprint.clone(),
114114
})?;

particle-modules/src/modules.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ impl ModuleRepository {
250250
let blueprint: eyre::Result<_> = try {
251251
// Read & deserialize TOML
252252
let bytes = std::fs::read(&path)?;
253-
let blueprint: Blueprint = toml::from_slice(&bytes)?;
253+
let blueprint: Blueprint = toml::de::from_slice(&bytes)?;
254254
blueprint
255255
};
256256

0 commit comments

Comments
 (0)