From abdaa957035244319b3f06101bd567e6ff0a298d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadeusz=20=E2=80=9Etadzik=E2=80=9D=20So=C5=9Bnierz?= Date: Fri, 3 Nov 2023 13:52:26 +0100 Subject: [PATCH 1/4] Clarify the need to run tests with "storage" feature enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tadeusz „tadzik” Sośnierz --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index c0df14bca9..fdff63e53a 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,14 @@ brew install cmake openssl@1.1 You can install `cmake`, `clang`, and `openssl` with your distro's package manager or download them from their websites. On Debian and Ubuntu, you will also need the `build-essential` and `libudev-dev` packages. +### Testing + +When working on the SDK itself, run its tests using `cargo` with `storage` feature enabled: + +``` +cargo test --features "storage" +``` + ## Getting Started ### Install the IOTA SDK From a22aff79f981973c73f51976cd6f3cc54804460d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadeusz=20=E2=80=9Etadzik=E2=80=9D=20So=C5=9Bnierz?= Date: Fri, 3 Nov 2023 13:52:49 +0100 Subject: [PATCH 2/4] Put WalletOptions::with_storage_path behind the feature flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows us to fail early if the storage feature is not enabled, rather than having code which appears to work but doesn't. Signed-off-by: Tadeusz „tadzik” Sośnierz --- bindings/core/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/bindings/core/src/lib.rs b/bindings/core/src/lib.rs index ea1bac6fdd..351a375703 100644 --- a/bindings/core/src/lib.rs +++ b/bindings/core/src/lib.rs @@ -50,6 +50,7 @@ pub struct WalletOptions { } impl WalletOptions { + #[cfg(feature = "storage")] pub fn with_storage_path(mut self, storage_path: impl Into>) -> Self { self.storage_path = storage_path.into(); self From e1007983101b863402fed22d81cf71d732ac0f19 Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Wed, 22 Nov 2023 10:39:42 +0100 Subject: [PATCH 3/4] Feature gate tests --- bindings/core/tests/combined.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bindings/core/tests/combined.rs b/bindings/core/tests/combined.rs index ffe7fe20d3..68ae893166 100644 --- a/bindings/core/tests/combined.rs +++ b/bindings/core/tests/combined.rs @@ -22,6 +22,7 @@ use iota_sdk_bindings_core::{ }; use pretty_assertions::assert_eq; +#[cfg(feature = "storage")] #[tokio::test] async fn create_wallet() -> Result<()> { let storage_path = "test-storage/create_wallet"; @@ -59,6 +60,7 @@ async fn create_wallet() -> Result<()> { Ok(()) } +#[cfg(feature = "storage")] #[tokio::test] async fn client_from_wallet() -> Result<()> { let storage_path = "test-storage/client_from_wallet"; @@ -100,6 +102,7 @@ async fn client_from_wallet() -> Result<()> { } // TODO reenable +// #[cfg(feature = "storage")] // #[tokio::test] // async fn build_and_sign_block() -> Result<()> { // let storage_path = "test-storage/build_and_sign_block"; From 58dc89baa857cf0fb4ea5d01a2a5e3a02dbfee91 Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Wed, 22 Nov 2023 10:41:59 +0100 Subject: [PATCH 4/4] Revert README changes --- README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.md b/README.md index fdff63e53a..c0df14bca9 100644 --- a/README.md +++ b/README.md @@ -104,14 +104,6 @@ brew install cmake openssl@1.1 You can install `cmake`, `clang`, and `openssl` with your distro's package manager or download them from their websites. On Debian and Ubuntu, you will also need the `build-essential` and `libudev-dev` packages. -### Testing - -When working on the SDK itself, run its tests using `cargo` with `storage` feature enabled: - -``` -cargo test --features "storage" -``` - ## Getting Started ### Install the IOTA SDK