Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(features): remove fs and vault feature gates #2592

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions ant-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ ant-build-info = { path = "../ant-build-info", version = "0.1.21" }
ant-logging = { path = "../ant-logging", version = "0.2.42" }
ant-protocol = { path = "../ant-protocol", version = "0.3.1" }
autonomi = { path = "../autonomi", version = "0.3.1", features = [
"fs",
"vault",
"registers",
"loud",
] }
Expand Down Expand Up @@ -60,7 +58,7 @@ tracing = { version = "~0.1.26" }
walkdir = "2.5.0"

[dev-dependencies]
autonomi = { path = "../autonomi", version = "0.3.1", features = ["fs"]}
autonomi = { path = "../autonomi", version = "0.3.1"}
criterion = "0.5.1"
eyre = "0.6.8"
rand = { version = "~0.8.5", features = ["small_rng"] }
Expand Down
26 changes: 19 additions & 7 deletions autonomi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ name = "put_and_dir_upload"
required-features = ["full"]

[features]
default = ["vault"]
default = []
external-signer = ["ant-evm/external-signer"]
extension-module = ["pyo3/extension-module"]
fs = ["tokio/fs"]
full = ["vault", "fs"]
full = []
local = ["ant-networking/local", "ant-evm/local"]
loud = []
registers = []
vault = []

[dependencies]
ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.1" }
Expand All @@ -47,21 +45,35 @@ const-hex = "1.12.0"
futures = "0.3.30"
hex = "~0.4.3"
libp2p = "0.54.1"
pyo3 = { version = "0.20", optional = true, features = ["extension-module", "abi3-py38"] }
pyo3 = { version = "0.20", optional = true, features = [
"extension-module",
"abi3-py38",
] }
rand = "0.8.5"
rayon = "1.8.0"
rmp-serde = "1.1.1"
self_encryption = "~0.30.0"
serde = { version = "1.0.133", features = ["derive", "rc"] }
sha2 = "0.10.6"
thiserror = "1.0.23"
tokio = { version = "1.35.0", features = ["sync"] }
tokio = { version = "1.35.0", features = ["sync", "fs"] }
tracing = { version = "~0.1.26" }
walkdir = "2.5.0"
xor_name = "5.0.0"

[dev-dependencies]
alloy = { version = "0.7.3", default-features = false, features = ["contract", "json-rpc", "network", "node-bindings", "provider-http", "reqwest-rustls-tls", "rpc-client", "rpc-types", "signer-local", "std"] }
alloy = { version = "0.7.3", default-features = false, features = [
"contract",
"json-rpc",
"network",
"node-bindings",
"provider-http",
"reqwest-rustls-tls",
"rpc-client",
"rpc-types",
"signer-local",
"std",
] }
ant-logging = { path = "../ant-logging", version = "0.2.42" }
eyre = "0.6.5"
sha2 = "0.10.6"
Expand Down
6 changes: 0 additions & 6 deletions autonomi/src/client/files/mod.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
#[cfg(feature = "fs")]
use std::path::{Path, PathBuf};

pub mod archive;
pub mod archive_public;
#[cfg(feature = "fs")]
#[cfg_attr(docsrs, doc(cfg(feature = "fs")))]
pub mod fs;
#[cfg(feature = "fs")]
#[cfg_attr(docsrs, doc(cfg(feature = "fs")))]
pub mod fs_public;

#[cfg(feature = "fs")]
pub(crate) fn get_relative_file_path_from_abs_file_and_folder_path(
abs_file_pah: &Path,
abs_folder_path: &Path,
Expand Down
2 changes: 0 additions & 2 deletions autonomi/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ pub mod external_signer;
#[cfg(feature = "registers")]
#[cfg_attr(docsrs, doc(cfg(feature = "registers")))]
pub mod registers;
#[cfg(feature = "vault")]
#[cfg_attr(docsrs, doc(cfg(feature = "vault")))]
pub mod vault;

// private module with utility functions
Expand Down
1 change: 0 additions & 1 deletion autonomi/tests/evm/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ mod test {
Ok(())
}

#[cfg(feature = "vault")]
#[tokio::test]
async fn file_into_vault() -> eyre::Result<()> {
common::enable_logging();
Expand Down
5 changes: 1 addition & 4 deletions autonomi/tests/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// KIND, either express or implied. Please review the Licences for the specific language governing
// permissions and limitations relating to use of the SAFE Network Software.

#![cfg(feature = "fs")]

use ant_logging::LogBuilder;
use autonomi::Client;
use eyre::Result;
Expand All @@ -20,7 +18,7 @@ use tokio::time::sleep;
use walkdir::WalkDir;

// With a local evm network, and local network, run:
// EVM_NETWORK=local cargo test --features="fs,local" --package autonomi --test file
// EVM_NETWORK=local cargo test --features="local" --package autonomi --test fs
#[tokio::test]
async fn dir_upload_download() -> Result<()> {
let _log_appender_guard =
Expand Down Expand Up @@ -76,7 +74,6 @@ fn compute_dir_sha256(dir: &str) -> Result<String> {
Ok(format!("{:x}", hasher.finalize()))
}

#[cfg(feature = "vault")]
#[tokio::test]
async fn file_into_vault() -> Result<()> {
let _log_appender_guard = LogBuilder::init_single_threaded_tokio_test("file", false);
Expand Down
Loading