Skip to content

Commit

Permalink
fix(deps): use toml 0.7 in server-config (#2097)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
folex committed Feb 21, 2024
1 parent b07e524 commit a4221cb
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ console-subscriber = "0.2.0"
futures = "0.3.30"
thiserror = "1.0.56"
serde = "1.0.196"
toml = "0.5.10"
toml = "0.5.11"
itertools = "0.12.1"
humantime-serde = "1.1.1"
cid = "0.11.0"
Expand Down
1 change: 1 addition & 0 deletions crates/nox-tests/tests/network/network_explore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ async fn explore_services_heavy() {
assert_eq!(external_addrs, expected_addrs);
}

#[ignore]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn explore_services_fixed_heavy() {
enable_logs();
Expand Down
2 changes: 1 addition & 1 deletion crates/server-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fluence-keypair = { workspace = true }
types = { workspace = true }
core-manager = { workspace = true }
log = "0.4.20"
toml = { workspace = true }
toml = "0.7.3" # otherwise deserialisation of Cargo.toml doesn't work

libp2p = { workspace = true }
libp2p-metrics = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/workers/src/persistence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub(crate) async fn persist_keypair(
) -> Result<(), KeyStorageError> {
let path = keypairs_dir.join(keypair_file_name(worker_id));
let bytes =
toml::to_vec(&persisted_keypair).map_err(|err| SerializePersistedKeypair { err })?;
toml::ser::to_vec(&persisted_keypair).map_err(|err| SerializePersistedKeypair { err })?;
tokio::fs::write(&path, bytes)
.await
.map_err(|err| WriteErrorPersistedKeypair { path, err })
Expand Down
6 changes: 3 additions & 3 deletions particle-modules/src/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn load_blueprint(bp_dir: &Path, blueprint_id: &str) -> Result<Blueprint> {
let blueprint =
std::fs::read(&bp_path).map_err(|err| NoSuchBlueprint { path: bp_path, err })?;
let blueprint: Blueprint =
toml::from_slice(blueprint.as_slice()).map_err(|err| IncorrectBlueprint { err })?;
toml::de::from_slice(blueprint.as_slice()).map_err(|err| IncorrectBlueprint { err })?;

Ok(blueprint)
}
Expand Down Expand Up @@ -62,7 +62,7 @@ pub fn load_config_by_path(path: &Path) -> Result<TomlMarineNamedModuleConfig> {
err,
})?;
let config: TomlMarineNamedModuleConfig =
toml::from_slice(config.as_slice()).map_err(|err| IncorrectModuleConfig { err })?;
toml::de::from_slice(config.as_slice()).map_err(|err| IncorrectModuleConfig { err })?;

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

// Save blueprint to disk
let bytes = toml::to_vec(&blueprint).map_err(|err| SerializeBlueprint {
let bytes = toml::ser::to_vec(&blueprint).map_err(|err| SerializeBlueprint {
err,
blueprint: blueprint.clone(),
})?;
Expand Down
2 changes: 1 addition & 1 deletion particle-modules/src/modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ impl ModuleRepository {
let blueprint: eyre::Result<_> = try {
// Read & deserialize TOML
let bytes = std::fs::read(&path)?;
let blueprint: Blueprint = toml::from_slice(&bytes)?;
let blueprint: Blueprint = toml::de::from_slice(&bytes)?;
blueprint
};

Expand Down

0 comments on commit a4221cb

Please sign in to comment.