diff --git a/bindings/python/src/error.rs b/bindings/python/src/error.rs index 21698c988a..83e35b6685 100644 --- a/bindings/python/src/error.rs +++ b/bindings/python/src/error.rs @@ -17,7 +17,7 @@ pub struct Error { impl From for Error { fn from(err: serde_json::Error) -> Self { - Error { + Self { error: PyErr::new::(err.to_string()), } } @@ -31,7 +31,7 @@ impl From for PyErr { impl From for Error { fn from(err: std::io::Error) -> Self { - Error { + Self { error: PyErr::new::(err.to_string()), } } @@ -39,7 +39,7 @@ impl From for Error { impl From for Error { fn from(err: iota_sdk_bindings_core::iota_sdk::types::block::Error) -> Self { - Error { + Self { error: PyErr::new::(err.to_string()), } } @@ -47,7 +47,7 @@ impl From for Error { impl From for Error { fn from(err: iota_sdk_bindings_core::Error) -> Self { - Error { + Self { error: PyErr::new::(err.to_string()), } } @@ -55,7 +55,7 @@ impl From for Error { impl From for Error { fn from(err: iota_sdk_bindings_core::iota_sdk::client::Error) -> Self { - Error { + Self { error: PyErr::new::(err.to_string()), } } @@ -63,7 +63,7 @@ impl From for Error { impl From for Error { fn from(err: iota_sdk_bindings_core::iota_sdk::client::mqtt::Error) -> Self { - Error { + Self { error: PyErr::new::(err.to_string()), } } @@ -71,7 +71,7 @@ impl From for Error { impl From for Error { fn from(err: iota_sdk_bindings_core::iota_sdk::wallet::Error) -> Self { - Error { + Self { error: PyErr::new::(err.to_string()), } } @@ -79,7 +79,7 @@ impl From for Error { impl From for Error { fn from(err: Infallible) -> Self { - Error { + Self { error: PyErr::new::(err.to_string()), } } diff --git a/bindings/wasm/src/wallet.rs b/bindings/wasm/src/wallet.rs index 0f4890af73..874f03042d 100644 --- a/bindings/wasm/src/wallet.rs +++ b/bindings/wasm/src/wallet.rs @@ -50,9 +50,10 @@ pub async fn destroy_wallet(method_handler: &WalletMethodHandler) -> Result<(), #[wasm_bindgen(js_name = getClientFromWallet)] pub async fn get_client(method_handler: &WalletMethodHandler) -> Result { - let wallet = method_handler.wallet.lock().await; - - let client = wallet + let client = method_handler + .wallet + .lock() + .await .as_ref() .ok_or_else(|| "wallet got destroyed".to_string())? .client() @@ -63,9 +64,10 @@ pub async fn get_client(method_handler: &WalletMethodHandler) -> Result Result { - let wallet = method_handler.wallet.lock().await; - - let secret_manager = wallet + let secret_manager = method_handler + .wallet + .lock() + .await .as_ref() .ok_or_else(|| "wallet got destroyed".to_string())? .get_secret_manager() @@ -79,10 +81,19 @@ pub async fn get_secret_manager(method_handler: &WalletMethodHandler) -> Result< /// Returns an error if the response itself is an error or panic. #[wasm_bindgen(js_name = callWalletMethodAsync)] pub async fn call_wallet_method_async(method: String, method_handler: &WalletMethodHandler) -> Result { - let wallet = method_handler.wallet.lock().await; let method: WalletMethod = serde_json::from_str(&method).map_err(|err| err.to_string())?; - let response = call_wallet_method(wallet.as_ref().expect("wallet got destroyed"), method).await; + let response = call_wallet_method( + method_handler + .wallet + .lock() + .await + .as_ref() + .expect("wallet got destroyed"), + method, + ) + .await; + match response { Response::Error(e) => Err(e.to_string().into()), Response::Panic(p) => Err(p.into()), diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 6b5a52052c..41b234cd57 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -4,8 +4,11 @@ version = "1.1.0" authors = ["IOTA Stiftung"] edition = "2021" homepage = "https://iota.org" +repository = "https://github.com/iotaledger/iota-sdk" description = "Command line interface wallet application based on the IOTA SDK" license = "Apache-2.0" +keywords = ["iota", "tangle", "sdk", "cli", "wallet"] +categories = ["cryptography::cryptocurrencies"] [[bin]] name = "wallet" diff --git a/cli/src/command/wallet.rs b/cli/src/command/wallet.rs index 7d4c26f5a5..b9781880b5 100644 --- a/cli/src/command/wallet.rs +++ b/cli/src/command/wallet.rs @@ -256,7 +256,7 @@ pub async fn restore_command(storage_path: &Path, snapshot_path: &Path, backup_p let password = get_password("Stronghold password", false)?; let secret_manager = SecretManager::Stronghold( StrongholdSecretManager::builder() - .password(password.clone()) + .password(password) .build(snapshot_path)?, ); builder = builder.with_secret_manager(secret_manager); @@ -321,8 +321,8 @@ pub async fn sync_command(storage_path: &Path, snapshot_path: &Path) -> Result>, - password: impl Into>, + snapshot_path: impl Into> + Send, + password: impl Into> + Send, ) -> Result { let secret_manager = if let Some(password) = password.into() { let snapshot_path = snapshot_path.into(); diff --git a/cli/src/error.rs b/cli/src/error.rs index 6c6887a293..4d94fd45ff 100644 --- a/cli/src/error.rs +++ b/cli/src/error.rs @@ -35,7 +35,7 @@ pub enum Error { impl From for Error { fn from(error: ClientError) -> Self { - Error::Client(Box::new(error)) + Self::Client(Box::new(error)) } } diff --git a/cli/src/helper.rs b/cli/src/helper.rs index 5be5970080..0a0fe7b936 100644 --- a/cli/src/helper.rs +++ b/cli/src/helper.rs @@ -146,7 +146,7 @@ pub async fn generate_mnemonic( println!("{}", mnemonic.as_ref()); } if [1, 2].contains(&selected_choice) { - let file_path = output_file_name.unwrap_or(DEFAULT_MNEMONIC_FILE_PATH.to_string()); + let file_path = output_file_name.unwrap_or_else(|| DEFAULT_MNEMONIC_FILE_PATH.to_string()); write_mnemonic_to_file(&file_path, &mnemonic).await?; println_log_info!("Mnemonic has been written to '{file_path}'."); diff --git a/sdk/examples/client/07_mqtt.rs b/sdk/examples/client/07_mqtt.rs index eadff775ba..feea2da895 100644 --- a/sdk/examples/client/07_mqtt.rs +++ b/sdk/examples/client/07_mqtt.rs @@ -23,7 +23,7 @@ async fn main() -> Result<()> { let address: Bech32Address = std::env::args() .nth(2) - .unwrap_or("atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r".to_string()) + .unwrap_or_else(|| "atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r".to_string()) .parse()?; // Create a node client. diff --git a/sdk/examples/client/offline_signing/0_address_generation.rs b/sdk/examples/client/offline_signing/0_address_generation.rs index 1262e95a12..783224ff42 100644 --- a/sdk/examples/client/offline_signing/0_address_generation.rs +++ b/sdk/examples/client/offline_signing/0_address_generation.rs @@ -37,7 +37,7 @@ async fn main() -> Result<()> { Ok(()) } -async fn write_address_to_file(path: impl AsRef, address: &[Bech32Address]) -> Result<()> { +async fn write_address_to_file(path: impl AsRef + Send, address: &[Bech32Address]) -> Result<()> { use tokio::io::AsyncWriteExt; let json = serde_json::to_string_pretty(&address)?; diff --git a/sdk/examples/client/offline_signing/1_transaction_preparation.rs b/sdk/examples/client/offline_signing/1_transaction_preparation.rs index 81b9cedf55..bd5ed8cb70 100644 --- a/sdk/examples/client/offline_signing/1_transaction_preparation.rs +++ b/sdk/examples/client/offline_signing/1_transaction_preparation.rs @@ -67,7 +67,7 @@ async fn main() -> Result<()> { Ok(()) } -async fn read_addresses_from_file(path: impl AsRef) -> Result> { +async fn read_addresses_from_file(path: impl AsRef + Send) -> Result> { use tokio::io::AsyncReadExt; let mut file = tokio::fs::File::open(&path).await.expect("failed to open file"); @@ -78,7 +78,7 @@ async fn read_addresses_from_file(path: impl AsRef) -> Result, + path: impl AsRef + Send, prepared_transaction: &PreparedTransactionData, ) -> Result<()> { use tokio::io::AsyncWriteExt; diff --git a/sdk/examples/client/offline_signing/2_transaction_signing.rs b/sdk/examples/client/offline_signing/2_transaction_signing.rs index 74519986dd..fae203b491 100644 --- a/sdk/examples/client/offline_signing/2_transaction_signing.rs +++ b/sdk/examples/client/offline_signing/2_transaction_signing.rs @@ -49,7 +49,9 @@ async fn main() -> Result<()> { Ok(()) } -async fn read_prepared_transaction_from_file(path: impl AsRef) -> Result { +async fn read_prepared_transaction_from_file( + path: impl AsRef + Send, +) -> Result { use tokio::io::AsyncReadExt; let mut file = tokio::fs::File::open(&path).await.expect("failed to open file"); @@ -62,7 +64,7 @@ async fn read_prepared_transaction_from_file(path: impl AsRef) } async fn write_signed_transaction_to_file( - path: impl AsRef, + path: impl AsRef + Send, signed_transaction_data: &SignedTransactionData, ) -> Result<()> { use tokio::io::AsyncWriteExt; diff --git a/sdk/examples/client/offline_signing/3_send_block.rs b/sdk/examples/client/offline_signing/3_send_block.rs index b452bd8ec6..9f31b1c265 100644 --- a/sdk/examples/client/offline_signing/3_send_block.rs +++ b/sdk/examples/client/offline_signing/3_send_block.rs @@ -64,7 +64,7 @@ async fn main() -> Result<()> { Ok(()) } -async fn read_signed_transaction_from_file(path: impl AsRef) -> Result { +async fn read_signed_transaction_from_file(path: impl AsRef + Send) -> Result { use tokio::io::AsyncReadExt; let mut file = tokio::fs::File::open(path).await.expect("failed to open file"); diff --git a/sdk/examples/client/output/build_alias_output.rs b/sdk/examples/client/output/build_alias_output.rs index 727097cca7..27d31f1ed4 100644 --- a/sdk/examples/client/output/build_alias_output.rs +++ b/sdk/examples/client/output/build_alias_output.rs @@ -25,7 +25,7 @@ async fn main() -> Result<()> { // This example uses secrets in environment variables for simplicity which should not be done in production. dotenvy::dotenv().ok(); - let metadata = std::env::args().nth(1).unwrap_or("hello".to_string()); + let metadata = std::env::args().nth(1).unwrap_or_else(|| "hello".to_string()); let metadata = metadata.as_bytes(); // Create a node client. @@ -39,7 +39,7 @@ async fn main() -> Result<()> { let address = std::env::args() .nth(1) - .unwrap_or("rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy".to_string()); + .unwrap_or_else(|| "rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy".to_string()); let address = Address::try_from_bech32(address)?; // Alias id needs to be null the first time diff --git a/sdk/examples/client/output/build_basic_output.rs b/sdk/examples/client/output/build_basic_output.rs index 900cadfa19..f4ac4680d6 100644 --- a/sdk/examples/client/output/build_basic_output.rs +++ b/sdk/examples/client/output/build_basic_output.rs @@ -40,7 +40,7 @@ async fn main() -> Result<()> { let address = std::env::args() .nth(1) - .unwrap_or("rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy".to_string()); + .unwrap_or_else(|| "rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy".to_string()); let address = Address::try_from_bech32(address)?; let basic_output_builder = diff --git a/sdk/examples/client/output/build_nft_output.rs b/sdk/examples/client/output/build_nft_output.rs index e75aa942ba..2b5a9a6c53 100644 --- a/sdk/examples/client/output/build_nft_output.rs +++ b/sdk/examples/client/output/build_nft_output.rs @@ -39,7 +39,7 @@ async fn main() -> Result<()> { let address = std::env::args() .nth(1) - .unwrap_or("rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy".to_string()); + .unwrap_or_else(|| "rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy".to_string()); let address = Address::try_from_bech32(address)?; // IOTA NFT Standard - IRC27: https://github.com/iotaledger/tips/blob/main/tips/TIP-0027/tip-0027.md diff --git a/sdk/examples/client/output/native_tokens.rs b/sdk/examples/client/output/native_tokens.rs index 18c0828bb2..5a02f5dff7 100644 --- a/sdk/examples/client/output/native_tokens.rs +++ b/sdk/examples/client/output/native_tokens.rs @@ -55,9 +55,9 @@ async fn main() -> Result<()> { .unwrap(); // Replace with the token ID of native tokens you own. - let token_id = std::env::args() - .nth(1) - .unwrap_or("0x08e68f7616cd4948efebc6a77c4f935eaed770ac53869cba56d104f2b472a8836d0100000000".to_string()); + let token_id = std::env::args().nth(1).unwrap_or_else(|| { + "0x08e68f7616cd4948efebc6a77c4f935eaed770ac53869cba56d104f2b472a8836d0100000000".to_string() + }); let token_id: [u8; 38] = prefix_hex::decode(token_id)?; let outputs = [ diff --git a/sdk/src/client/node_api/mqtt/types.rs b/sdk/src/client/node_api/mqtt/types.rs index 960750b258..2acba99c6e 100644 --- a/sdk/src/client/node_api/mqtt/types.rs +++ b/sdk/src/client/node_api/mqtt/types.rs @@ -20,7 +20,6 @@ type TopicHandler = Box; pub(crate) type TopicHandlerMap = HashMap>>; /// An event from a MQTT topic. - #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] pub struct TopicEvent { /// the MQTT topic. @@ -30,7 +29,6 @@ pub struct TopicEvent { } /// The payload of an `TopicEvent`. - #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub enum MqttPayload { @@ -45,7 +43,6 @@ pub enum MqttPayload { } /// Mqtt events. - #[derive(Debug, Clone, PartialEq, Eq)] pub enum MqttEvent { /// Client was connected. @@ -55,7 +52,6 @@ pub enum MqttEvent { } /// The MQTT broker options. - #[derive(Copy, Debug, Clone, serde::Deserialize, serde::Serialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] #[must_use] diff --git a/sdk/src/client/secret/mod.rs b/sdk/src/client/secret/mod.rs index fbbc311def..8881f93c71 100644 --- a/sdk/src/client/secret/mod.rs +++ b/sdk/src/client/secret/mod.rs @@ -127,7 +127,6 @@ pub trait SecretManagerConfig: SecretManage { } /// Supported secret managers - #[non_exhaustive] pub enum SecretManager { /// Secret manager that uses [`iota_stronghold`] as the backing storage. diff --git a/sdk/src/wallet/account/mod.rs b/sdk/src/wallet/account/mod.rs index e071a2d75d..e938d54394 100644 --- a/sdk/src/wallet/account/mod.rs +++ b/sdk/src/wallet/account/mod.rs @@ -397,7 +397,7 @@ impl AccountInner { ..Default::default() }) .await - .map(|res| res.get(0).cloned()) + .map(|res| res.first().cloned()) } /// Gets the unspent foundry output matching the given ID. @@ -407,7 +407,7 @@ impl AccountInner { ..Default::default() }) .await - .map(|res| res.get(0).cloned()) + .map(|res| res.first().cloned()) } /// Gets the unspent nft output matching the given ID. @@ -417,7 +417,7 @@ impl AccountInner { ..Default::default() }) .await - .map(|res| res.get(0).cloned()) + .map(|res| res.first().cloned()) } /// Returns all incoming transactions of the account diff --git a/sdk/tests/client/common/mod.rs b/sdk/tests/client/common/mod.rs index 5a0ff66a34..44466e80a1 100644 --- a/sdk/tests/client/common/mod.rs +++ b/sdk/tests/client/common/mod.rs @@ -29,7 +29,8 @@ pub async fn create_client_and_secret_manager_with_funds( ) -> Result<(Client, SecretManager)> { let client = Client::builder().with_node(NODE_LOCAL)?.finish().await?; - let secret_manager = SecretManager::try_from_mnemonic(mnemonic.unwrap_or(Client::generate_mnemonic().unwrap()))?; + let secret_manager = + SecretManager::try_from_mnemonic(mnemonic.unwrap_or_else(|| Client::generate_mnemonic().unwrap()))?; let address = secret_manager .generate_ed25519_addresses( diff --git a/sdk/tests/client/signing/alias.rs b/sdk/tests/client/signing/alias.rs index 883cf78f58..2a9a9564a5 100644 --- a/sdk/tests/client/signing/alias.rs +++ b/sdk/tests/client/signing/alias.rs @@ -109,7 +109,7 @@ async fn sign_alias_state_transition() -> Result<()> { .await?; assert_eq!(unlocks.len(), 1); - assert_eq!((*unlocks).get(0).unwrap().kind(), SignatureUnlock::KIND); + assert_eq!((*unlocks).first().unwrap().kind(), SignatureUnlock::KIND); let tx_payload = TransactionPayload::new(prepared_transaction_data.essence.clone(), unlocks)?; @@ -200,7 +200,7 @@ async fn sign_alias_governance_transition() -> Result<()> { .await?; assert_eq!(unlocks.len(), 1); - assert_eq!((*unlocks).get(0).unwrap().kind(), SignatureUnlock::KIND); + assert_eq!((*unlocks).first().unwrap().kind(), SignatureUnlock::KIND); let tx_payload = TransactionPayload::new(prepared_transaction_data.essence.clone(), unlocks)?; @@ -330,7 +330,7 @@ async fn alias_reference_unlocks() -> Result<()> { .await?; assert_eq!(unlocks.len(), 3); - assert_eq!((*unlocks).get(0).unwrap().kind(), SignatureUnlock::KIND); + assert_eq!((*unlocks).first().unwrap().kind(), SignatureUnlock::KIND); match (*unlocks).get(1).unwrap() { Unlock::Alias(a) => { assert_eq!(a.index(), 0); diff --git a/sdk/tests/client/signing/basic.rs b/sdk/tests/client/signing/basic.rs index be2252ac78..d48d39817e 100644 --- a/sdk/tests/client/signing/basic.rs +++ b/sdk/tests/client/signing/basic.rs @@ -92,7 +92,7 @@ async fn single_ed25519_unlock() -> Result<()> { .await?; assert_eq!(unlocks.len(), 1); - assert_eq!((*unlocks).get(0).unwrap().kind(), SignatureUnlock::KIND); + assert_eq!((*unlocks).first().unwrap().kind(), SignatureUnlock::KIND); let tx_payload = TransactionPayload::new(prepared_transaction_data.essence.clone(), unlocks)?; @@ -194,7 +194,7 @@ async fn ed25519_reference_unlocks() -> Result<()> { .await?; assert_eq!(unlocks.len(), 3); - assert_eq!((*unlocks).get(0).unwrap().kind(), SignatureUnlock::KIND); + assert_eq!((*unlocks).first().unwrap().kind(), SignatureUnlock::KIND); match (*unlocks).get(1).unwrap() { Unlock::Reference(r) => { assert_eq!(r.index(), 0); @@ -306,7 +306,7 @@ async fn two_signature_unlocks() -> Result<()> { .await?; assert_eq!(unlocks.len(), 2); - assert_eq!((*unlocks).get(0).unwrap().kind(), SignatureUnlock::KIND); + assert_eq!((*unlocks).first().unwrap().kind(), SignatureUnlock::KIND); assert_eq!((*unlocks).get(1).unwrap().kind(), SignatureUnlock::KIND); let tx_payload = TransactionPayload::new(prepared_transaction_data.essence.clone(), unlocks)?; diff --git a/sdk/tests/client/signing/mod.rs b/sdk/tests/client/signing/mod.rs index 3a9e58bad7..6dfcefd1f8 100644 --- a/sdk/tests/client/signing/mod.rs +++ b/sdk/tests/client/signing/mod.rs @@ -395,7 +395,7 @@ async fn all_combined() -> Result<()> { .await?; assert_eq!(unlocks.len(), 15); - assert_eq!((*unlocks).get(0).unwrap().kind(), SignatureUnlock::KIND); + assert_eq!((*unlocks).first().unwrap().kind(), SignatureUnlock::KIND); match (*unlocks).get(1).unwrap() { Unlock::Reference(a) => { assert_eq!(a.index(), 0); diff --git a/sdk/tests/client/signing/nft.rs b/sdk/tests/client/signing/nft.rs index 2498bfbef0..e02a873c9f 100644 --- a/sdk/tests/client/signing/nft.rs +++ b/sdk/tests/client/signing/nft.rs @@ -138,7 +138,7 @@ async fn nft_reference_unlocks() -> Result<()> { .await?; assert_eq!(unlocks.len(), 3); - assert_eq!((*unlocks).get(0).unwrap().kind(), SignatureUnlock::KIND); + assert_eq!((*unlocks).first().unwrap().kind(), SignatureUnlock::KIND); match (*unlocks).get(1).unwrap() { Unlock::Nft(a) => { assert_eq!(a.index(), 0); diff --git a/sdk/tests/types/unlock/mod.rs b/sdk/tests/types/unlock/mod.rs index 51a2ef91e0..ef14c76b4b 100644 --- a/sdk/tests/types/unlock/mod.rs +++ b/sdk/tests/types/unlock/mod.rs @@ -128,7 +128,7 @@ fn get_none() { fn get_signature() { let signature = Unlock::from(SignatureUnlock::from(rand_signature())); - assert_eq!(Unlocks::new([signature.clone()]).unwrap().get(0), Some(&signature)); + assert_eq!(Unlocks::new([signature.clone()]).unwrap().first(), Some(&signature)); } #[test] diff --git a/sdk/tests/wallet/accounts.rs b/sdk/tests/wallet/accounts.rs index 1b4b329d47..3d06ee0cbc 100644 --- a/sdk/tests/wallet/accounts.rs +++ b/sdk/tests/wallet/accounts.rs @@ -54,7 +54,7 @@ async fn remove_latest_account() -> Result<()> { let accounts = wallet.get_accounts().await.unwrap(); assert!(accounts.len() == 1); assert_eq!( - *accounts.get(0).unwrap().details().await.index(), + *accounts.first().unwrap().details().await.index(), *first_account.details().await.index() ); @@ -94,7 +94,7 @@ async fn remove_latest_account() -> Result<()> { // Check if accounts with `recreated_account_index` exist. assert_eq!(accounts.len(), 1); assert_eq!( - *accounts.get(0).unwrap().details().await.index(), + *accounts.first().unwrap().details().await.index(), recreated_account_index ); diff --git a/sdk/tests/wallet/common/mod.rs b/sdk/tests/wallet/common/mod.rs index 394e99b900..afeb40ace8 100644 --- a/sdk/tests/wallet/common/mod.rs +++ b/sdk/tests/wallet/common/mod.rs @@ -32,7 +32,7 @@ pub use self::constants::*; pub(crate) async fn make_wallet(storage_path: &str, mnemonic: Option, node: Option<&str>) -> Result { let client_options = ClientOptions::new().with_node(node.unwrap_or(NODE_LOCAL))?; let secret_manager = - MnemonicSecretManager::try_from_mnemonic(mnemonic.unwrap_or(Client::generate_mnemonic().unwrap()))?; + MnemonicSecretManager::try_from_mnemonic(mnemonic.unwrap_or_else(|| Client::generate_mnemonic().unwrap()))?; #[allow(unused_mut)] let mut wallet_builder = Wallet::builder() diff --git a/sdk/tests/wallet/wallet_storage.rs b/sdk/tests/wallet/wallet_storage.rs index 82a0e863f2..6d8bb93022 100644 --- a/sdk/tests/wallet/wallet_storage.rs +++ b/sdk/tests/wallet/wallet_storage.rs @@ -195,8 +195,8 @@ async fn check_existing_db_2() -> Result<()> { if let iota_sdk::types::block::payload::Payload::TaggedData(tagged_data_payload) = tx.payload.essence().as_regular().payload().unwrap() { - assert_eq!(tagged_data_payload.tag(), "Stardust".as_bytes()); - assert_eq!(tagged_data_payload.data(), "Stardust".as_bytes()); + assert_eq!(tagged_data_payload.tag(), b"Stardust"); + assert_eq!(tagged_data_payload.data(), b"Stardust"); } else { panic!("expected tagged data payload") }