From 21437c8614ded6e2ef20ceecbbb6d30e08c5d0d0 Mon Sep 17 00:00:00 2001 From: Alex Coats Date: Wed, 18 Oct 2023 10:23:15 -0400 Subject: [PATCH 1/2] use `pretty_assertions` --- Cargo.lock | 24 ++ bindings/core/Cargo.toml | 3 + bindings/core/src/method/secret_manager.rs | 1 + bindings/core/tests/combined.rs | 1 + bindings/core/tests/secrets_debug.rs | 1 + bindings/core/tests/secrets_manager.rs | 1 + bindings/core/tests/serialize_error.rs | 1 + bindings/core/tests/utils.rs | 1 + sdk/Cargo.toml | 1 + sdk/src/client/secret/ledger_nano.rs | 2 + sdk/src/client/secret/mnemonic.rs | 2 + sdk/src/client/stronghold/mod.rs | 2 + sdk/src/client/stronghold/secret.rs | 2 + sdk/src/types/block/output/alias.rs | 1 + sdk/src/types/block/output/basic.rs | 1 + .../types/block/output/feature/metadata.rs | 2 + sdk/src/types/block/output/feature/mod.rs | 2 + sdk/src/types/block/output/foundry.rs | 1 + sdk/src/types/block/output/nft.rs | 1 + .../block/output/unlock_condition/mod.rs | 2 + sdk/src/wallet/account/mod.rs | 233 +++++++++--------- .../transaction/high_level/create_alias.rs | 2 + sdk/src/wallet/events/mod.rs | 2 + sdk/src/wallet/storage/manager.rs | 1 + sdk/src/wallet/storage/mod.rs | 1 + sdk/src/wallet/storage/participation.rs | 2 + sdk/tests/client/addresses.rs | 1 + sdk/tests/client/consolidation.rs | 1 + sdk/tests/client/error.rs | 1 + sdk/tests/client/high_level.rs | 1 + .../client/input_selection/alias_outputs.rs | 1 + .../client/input_selection/basic_outputs.rs | 1 + sdk/tests/client/input_selection/burn.rs | 1 + .../client/input_selection/expiration.rs | 1 + .../client/input_selection/foundry_outputs.rs | 1 + .../client/input_selection/native_tokens.rs | 1 + .../client/input_selection/nft_outputs.rs | 1 + sdk/tests/client/input_selection/outputs.rs | 1 + .../input_selection/storage_deposit_return.rs | 1 + sdk/tests/client/input_selection/timelock.rs | 1 + sdk/tests/client/input_signing_data.rs | 1 + sdk/tests/client/node_api/core.rs | 1 + sdk/tests/client/node_api/indexer.rs | 1 + sdk/tests/client/node_api/mqtt.rs | 2 + sdk/tests/client/secret_manager/mnemonic.rs | 1 + .../client/secret_manager/private_key.rs | 1 + sdk/tests/client/secret_manager/stronghold.rs | 1 + sdk/tests/client/signing/alias.rs | 1 + sdk/tests/client/signing/basic.rs | 1 + sdk/tests/client/signing/mod.rs | 1 + sdk/tests/client/signing/nft.rs | 1 + sdk/tests/client/transactions.rs | 1 + sdk/tests/types/address/alias.rs | 1 + sdk/tests/types/address/bech32.rs | 1 + sdk/tests/types/address/ed25519.rs | 1 + sdk/tests/types/address/mod.rs | 1 + sdk/tests/types/address/nft.rs | 1 + sdk/tests/types/api/participation.rs | 1 + sdk/tests/types/block.rs | 1 + sdk/tests/types/block_id.rs | 1 + sdk/tests/types/ed25519_signature.rs | 1 + sdk/tests/types/foundry_id.rs | 1 + sdk/tests/types/input/treasury.rs | 1 + sdk/tests/types/input/utxo.rs | 1 + sdk/tests/types/migrated_funds_entry.rs | 1 + sdk/tests/types/milestone_id.rs | 1 + sdk/tests/types/milestone_index.rs | 1 + sdk/tests/types/milestone_payload.rs | 1 + sdk/tests/types/milestone_payload_essence.rs | 1 + sdk/tests/types/output_id.rs | 1 + sdk/tests/types/parents.rs | 1 + sdk/tests/types/payload.rs | 1 + sdk/tests/types/receipt_milestone_option.rs | 1 + sdk/tests/types/tagged_data_payload.rs | 1 + sdk/tests/types/tail_transaction_hash.rs | 1 + sdk/tests/types/transaction_essence.rs | 1 + sdk/tests/types/transaction_id.rs | 1 + sdk/tests/types/transaction_payload.rs | 1 + .../types/transaction_regular_essence.rs | 1 + sdk/tests/types/treasury_output.rs | 1 + .../types/treasury_transaction_payload.rs | 1 + sdk/tests/types/unlock/alias.rs | 1 + sdk/tests/types/unlock/mod.rs | 1 + sdk/tests/types/unlock/nft.rs | 1 + sdk/tests/types/unlock/reference.rs | 1 + sdk/tests/types/unlock/signature.rs | 1 + sdk/tests/utils/serde.rs | 1 + sdk/tests/wallet/account_recovery.rs | 1 + sdk/tests/wallet/accounts.rs | 1 + sdk/tests/wallet/address_generation.rs | 1 + sdk/tests/wallet/backup_restore.rs | 1 + sdk/tests/wallet/balance.rs | 1 + sdk/tests/wallet/bech32_hrp_validation.rs | 1 + sdk/tests/wallet/burn_outputs.rs | 1 + sdk/tests/wallet/chrysalis_migration.rs | 1 + sdk/tests/wallet/claim_outputs.rs | 1 + sdk/tests/wallet/consolidation.rs | 1 + sdk/tests/wallet/core.rs | 1 + sdk/tests/wallet/error.rs | 1 + sdk/tests/wallet/events.rs | 1 + .../migrate_stronghold_snapshot_v2_to_v3.rs | 1 + sdk/tests/wallet/native_tokens.rs | 1 + sdk/tests/wallet/output_preparation.rs | 1 + sdk/tests/wallet/syncing.rs | 1 + sdk/tests/wallet/transactions.rs | 1 + sdk/tests/wallet/wallet_storage.rs | 1 + 106 files changed, 260 insertions(+), 114 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f78957f128..e26c2ecf3e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -780,6 +780,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + [[package]] name = "digest" version = "0.9.0" @@ -1639,6 +1645,7 @@ dependencies = [ "once_cell", "packable", "prefix-hex", + "pretty_assertions", "primitive-types", "rand", "regex", @@ -1669,6 +1676,7 @@ dependencies = [ "log", "packable", "prefix-hex", + "pretty_assertions", "primitive-types", "serde", "serde_json", @@ -2349,6 +2357,16 @@ dependencies = [ "uint", ] +[[package]] +name = "pretty_assertions" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +dependencies = [ + "diff", + "yansi", +] + [[package]] name = "prettyplease" version = "0.2.15" @@ -4015,6 +4033,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + [[package]] name = "zeroize" version = "1.6.0" diff --git a/bindings/core/Cargo.toml b/bindings/core/Cargo.toml index 2fd285d33c..ba1a8b4f9e 100644 --- a/bindings/core/Cargo.toml +++ b/bindings/core/Cargo.toml @@ -32,6 +32,9 @@ thiserror = { version = "1.0.49", default-features = false } tokio = { version = "1.33.0", default-features = false } zeroize = { version = "1.6.0", default-features = false } +[dev-dependencies] +pretty_assertions = { version = "1.4.0", default-features = false, features = [ "alloc" ] } + [features] events = ["iota-sdk/events"] ledger_nano = ["iota-sdk/ledger_nano"] diff --git a/bindings/core/src/method/secret_manager.rs b/bindings/core/src/method/secret_manager.rs index e4d548d052..7bb25e9a7c 100644 --- a/bindings/core/src/method/secret_manager.rs +++ b/bindings/core/src/method/secret_manager.rs @@ -73,6 +73,7 @@ pub enum SecretManagerMethod { #[cfg(test)] mod test { + use pretty_assertions::assert_eq; #[test] fn bip44_deserialization() { let signature_unlock_method: super::SecretManagerMethod = serde_json::from_str( diff --git a/bindings/core/tests/combined.rs b/bindings/core/tests/combined.rs index 1648b72383..5f7f57e959 100644 --- a/bindings/core/tests/combined.rs +++ b/bindings/core/tests/combined.rs @@ -8,6 +8,7 @@ use iota_sdk::{ wallet::account::types::AccountIdentifier, }; use iota_sdk_bindings_core::{AccountMethod, CallMethod, ClientMethod, Response, Result, WalletMethod, WalletOptions}; +use pretty_assertions::assert_eq; #[tokio::test] async fn create_account() -> Result<()> { diff --git a/bindings/core/tests/secrets_debug.rs b/bindings/core/tests/secrets_debug.rs index 2d948f6e69..576726ebcf 100644 --- a/bindings/core/tests/secrets_debug.rs +++ b/bindings/core/tests/secrets_debug.rs @@ -3,6 +3,7 @@ use iota_sdk::client::secret::SecretManagerDto; use iota_sdk_bindings_core::{ClientMethod, Response, UtilsMethod, WalletOptions}; +use pretty_assertions::assert_eq; #[test] fn method_interface_secrets_debug() { diff --git a/bindings/core/tests/secrets_manager.rs b/bindings/core/tests/secrets_manager.rs index 7ff91e891f..018292e7c8 100644 --- a/bindings/core/tests/secrets_manager.rs +++ b/bindings/core/tests/secrets_manager.rs @@ -5,6 +5,7 @@ use std::sync::Arc; use iota_sdk::client::{api::GetAddressesOptions, constants::ETHER_COIN_TYPE, secret::SecretManager}; use iota_sdk_bindings_core::{call_secret_manager_method, Response, Result, SecretManagerMethod}; +use pretty_assertions::assert_eq; use tokio::sync::RwLock; #[tokio::test] diff --git a/bindings/core/tests/serialize_error.rs b/bindings/core/tests/serialize_error.rs index 812ed0ecc8..472044f86b 100644 --- a/bindings/core/tests/serialize_error.rs +++ b/bindings/core/tests/serialize_error.rs @@ -3,6 +3,7 @@ use iota_sdk::{client::Error as ClientError, wallet::Error as WalletError}; use iota_sdk_bindings_core::Error; +use pretty_assertions::assert_eq; #[test] fn custom_error_serialization() { diff --git a/bindings/core/tests/utils.rs b/bindings/core/tests/utils.rs index 61899cf260..7a0ed8482d 100644 --- a/bindings/core/tests/utils.rs +++ b/bindings/core/tests/utils.rs @@ -3,6 +3,7 @@ use iota_sdk::types::block::address::{Bech32Address, Hrp}; use iota_sdk_bindings_core::{call_utils_method, Response, Result, UtilsMethod}; +use pretty_assertions::assert_eq; #[tokio::test] async fn utils() -> Result<()> { diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index aff0c5695d..ef553381d5 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -125,6 +125,7 @@ wasm-bindgen-futures = { version = "0.4.37", default-features = false, optional [dev-dependencies] iota-sdk = { path = ".", default-features = false, features = ["rand"] } +pretty_assertions = { version = "1.4.0", default-features = false, features = [ "alloc" ] } dotenvy = { version = "0.15.7", default-features = false } fern-logger = { version = "0.5.0", default-features = false } diff --git a/sdk/src/client/secret/ledger_nano.rs b/sdk/src/client/secret/ledger_nano.rs index 27d4797f17..3a46b40dd9 100644 --- a/sdk/src/client/secret/ledger_nano.rs +++ b/sdk/src/client/secret/ledger_nano.rs @@ -594,6 +594,8 @@ fn merge_unlocks( #[cfg(test)] mod tests { + use pretty_assertions::assert_eq; + use super::*; use crate::{ client::{api::GetAddressesOptions, constants::IOTA_COIN_TYPE, secret::SecretManager}, diff --git a/sdk/src/client/secret/mnemonic.rs b/sdk/src/client/secret/mnemonic.rs index d41fe31ce8..8638e8b122 100644 --- a/sdk/src/client/secret/mnemonic.rs +++ b/sdk/src/client/secret/mnemonic.rs @@ -156,6 +156,8 @@ impl MnemonicSecretManager { #[cfg(test)] mod tests { + use pretty_assertions::assert_eq; + use super::*; use crate::types::block::address::ToBech32Ext; diff --git a/sdk/src/client/stronghold/mod.rs b/sdk/src/client/stronghold/mod.rs index 15633df37b..845a5a0c49 100644 --- a/sdk/src/client/stronghold/mod.rs +++ b/sdk/src/client/stronghold/mod.rs @@ -578,6 +578,8 @@ async fn task_key_clear( mod tests { use std::fs; + use pretty_assertions::assert_eq; + use super::*; #[tokio::test] diff --git a/sdk/src/client/stronghold/secret.rs b/sdk/src/client/stronghold/secret.rs index 47010dc5e8..bbba7e84cc 100644 --- a/sdk/src/client/stronghold/secret.rs +++ b/sdk/src/client/stronghold/secret.rs @@ -496,6 +496,8 @@ impl StrongholdAdapter { mod tests { use std::path::Path; + use pretty_assertions::assert_eq; + use super::*; use crate::{ client::constants::{ETHER_COIN_TYPE, IOTA_COIN_TYPE}, diff --git a/sdk/src/types/block/output/alias.rs b/sdk/src/types/block/output/alias.rs index 3ec43d1fe9..fb2cdb10a4 100644 --- a/sdk/src/types/block/output/alias.rs +++ b/sdk/src/types/block/output/alias.rs @@ -885,6 +885,7 @@ pub(crate) mod dto { #[cfg(test)] mod tests { use packable::PackableExt; + use pretty_assertions::assert_eq; use super::*; use crate::types::{ diff --git a/sdk/src/types/block/output/basic.rs b/sdk/src/types/block/output/basic.rs index 3224af5143..899f9a6002 100644 --- a/sdk/src/types/block/output/basic.rs +++ b/sdk/src/types/block/output/basic.rs @@ -447,6 +447,7 @@ pub(crate) mod dto { #[cfg(test)] mod tests { use packable::PackableExt; + use pretty_assertions::assert_eq; use super::*; use crate::types::{ diff --git a/sdk/src/types/block/output/feature/metadata.rs b/sdk/src/types/block/output/feature/metadata.rs index ee2cfab4e3..b6c05e3dc3 100644 --- a/sdk/src/types/block/output/feature/metadata.rs +++ b/sdk/src/types/block/output/feature/metadata.rs @@ -261,6 +261,8 @@ pub(crate) mod irc_27 { #[cfg(test)] mod test { + use pretty_assertions::assert_eq; + use super::*; use crate::types::block::{address::ToBech32Ext, rand::address::rand_address}; diff --git a/sdk/src/types/block/output/feature/mod.rs b/sdk/src/types/block/output/feature/mod.rs index 363fb1befc..b2897f28a1 100644 --- a/sdk/src/types/block/output/feature/mod.rs +++ b/sdk/src/types/block/output/feature/mod.rs @@ -272,6 +272,8 @@ pub(crate) fn verify_allowed_features(features: &Features, allowed_features: Fea #[cfg(test)] mod test { + use pretty_assertions::assert_eq; + use super::*; #[test] diff --git a/sdk/src/types/block/output/foundry.rs b/sdk/src/types/block/output/foundry.rs index 974b0769c2..dfca41bec1 100644 --- a/sdk/src/types/block/output/foundry.rs +++ b/sdk/src/types/block/output/foundry.rs @@ -758,6 +758,7 @@ pub(crate) mod dto { #[cfg(test)] mod tests { use packable::PackableExt; + use pretty_assertions::assert_eq; use super::*; use crate::types::{ diff --git a/sdk/src/types/block/output/nft.rs b/sdk/src/types/block/output/nft.rs index fbe506e5e7..d7f085e3bc 100644 --- a/sdk/src/types/block/output/nft.rs +++ b/sdk/src/types/block/output/nft.rs @@ -622,6 +622,7 @@ pub(crate) mod dto { #[cfg(test)] mod tests { use packable::PackableExt; + use pretty_assertions::assert_eq; use super::*; use crate::types::{ diff --git a/sdk/src/types/block/output/unlock_condition/mod.rs b/sdk/src/types/block/output/unlock_condition/mod.rs index b65e70bb67..29cc517bae 100644 --- a/sdk/src/types/block/output/unlock_condition/mod.rs +++ b/sdk/src/types/block/output/unlock_condition/mod.rs @@ -474,6 +474,8 @@ pub(crate) fn verify_allowed_unlock_conditions( #[cfg(test)] mod test { + use pretty_assertions::assert_eq; + use super::*; #[test] diff --git a/sdk/src/wallet/account/mod.rs b/sdk/src/wallet/account/mod.rs index 14106f544e..e071a2d75d 100644 --- a/sdk/src/wallet/account/mod.rs +++ b/sdk/src/wallet/account/mod.rs @@ -587,135 +587,96 @@ impl From<&AccountDetails> for AccountDetailsDto { } } -#[test] -fn serialize() { +#[cfg(test)] +mod test { use core::str::FromStr; + use pretty_assertions::assert_eq; + + use super::*; use crate::types::block::{ address::{Address, Ed25519Address}, input::{Input, UtxoInput}, - output::{unlock_condition::AddressUnlockCondition, BasicOutput, InputsCommitment, Output}, - payload::{ - transaction::{RegularTransactionEssence, TransactionEssence, TransactionId}, - TransactionPayload, - }, + output::{AddressUnlockCondition, BasicOutput, InputsCommitment, RentStructure}, + payload::transaction::RegularTransactionEssence, protocol::ProtocolParameters, signature::{Ed25519Signature, Signature}, unlock::{ReferenceUnlock, SignatureUnlock, Unlock, Unlocks}, }; - const TRANSACTION_ID: &str = "0x24a1f46bdb6b2bf38f1c59f73cdd4ae5b418804bb231d76d06fbf246498d5883"; - const ED25519_ADDRESS: &str = "0xe594f9a895c0e0a6760dd12cffc2c3d1e1cbf7269b328091f96ce3d0dd550b75"; - const ED25519_PUBLIC_KEY: &str = "0x1da5ddd11ba3f961acab68fafee3177d039875eaa94ac5fdbff8b53f0c50bfb9"; - const ED25519_SIGNATURE: &str = "0xc6a40edf9a089f42c18f4ebccb35fe4b578d93b879e99b87f63573324a710d3456b03fb6d1fcc027e6401cbd9581f790ee3ed7a3f68e9c225fcb9f1cd7b7110d"; - - let protocol_parameters = ProtocolParameters::new( - 2, - String::from("testnet"), - "rms", - 1500, - 15, - crate::types::block::output::RentStructure::new(500, 10, 1), - 1_813_620_509_061_365, - ) - .unwrap(); - - let transaction_id = TransactionId::new(prefix_hex::decode(TRANSACTION_ID).unwrap()); - let input1 = Input::Utxo(UtxoInput::new(transaction_id, 0).unwrap()); - let input2 = Input::Utxo(UtxoInput::new(transaction_id, 1).unwrap()); - let bytes: [u8; 32] = prefix_hex::decode(ED25519_ADDRESS).unwrap(); - let address = Address::from(Ed25519Address::new(bytes)); - let amount = 1_000_000; - let output = Output::Basic( - BasicOutput::build_with_amount(amount) - .add_unlock_condition(AddressUnlockCondition::new(address)) - .finish_with_params(protocol_parameters.clone()) - .unwrap(), - ); - let essence = TransactionEssence::Regular( - RegularTransactionEssence::builder(protocol_parameters.network_id(), InputsCommitment::from([0u8; 32])) - .with_inputs([input1, input2]) - .add_output(output) - .finish_with_params(protocol_parameters) - .unwrap(), - ); - - let pub_key_bytes = prefix_hex::decode(ED25519_PUBLIC_KEY).unwrap(); - let sig_bytes = prefix_hex::decode(ED25519_SIGNATURE).unwrap(); - let signature = Ed25519Signature::try_from_bytes(pub_key_bytes, sig_bytes).unwrap(); - let sig_unlock = Unlock::Signature(SignatureUnlock::from(Signature::from(signature))); - let ref_unlock = Unlock::Reference(ReferenceUnlock::new(0).unwrap()); - let unlocks = Unlocks::new([sig_unlock, ref_unlock]).unwrap(); - - let tx_payload = TransactionPayload::new(essence, unlocks).unwrap(); + #[test] + fn serialize() { + const TRANSACTION_ID: &str = "0x24a1f46bdb6b2bf38f1c59f73cdd4ae5b418804bb231d76d06fbf246498d5883"; + const ED25519_ADDRESS: &str = "0xe594f9a895c0e0a6760dd12cffc2c3d1e1cbf7269b328091f96ce3d0dd550b75"; + const ED25519_PUBLIC_KEY: &str = "0x1da5ddd11ba3f961acab68fafee3177d039875eaa94ac5fdbff8b53f0c50bfb9"; + const ED25519_SIGNATURE: &str = "0xc6a40edf9a089f42c18f4ebccb35fe4b578d93b879e99b87f63573324a710d3456b03fb6d1fcc027e6401cbd9581f790ee3ed7a3f68e9c225fcb9f1cd7b7110d"; + + let protocol_parameters = ProtocolParameters::new( + 2, + String::from("testnet"), + "rms", + 1500, + 15, + RentStructure::new(500, 10, 1), + 1_813_620_509_061_365, + ) + .unwrap(); + + let transaction_id = TransactionId::new(prefix_hex::decode(TRANSACTION_ID).unwrap()); + let input1 = Input::Utxo(UtxoInput::new(transaction_id, 0).unwrap()); + let input2 = Input::Utxo(UtxoInput::new(transaction_id, 1).unwrap()); + let bytes: [u8; 32] = prefix_hex::decode(ED25519_ADDRESS).unwrap(); + let address = Address::from(Ed25519Address::new(bytes)); + let amount = 1_000_000; + let output = Output::Basic( + BasicOutput::build_with_amount(amount) + .add_unlock_condition(AddressUnlockCondition::new(address)) + .finish_with_params(protocol_parameters.clone()) + .unwrap(), + ); + let essence = TransactionEssence::Regular( + RegularTransactionEssence::builder(protocol_parameters.network_id(), InputsCommitment::from([0u8; 32])) + .with_inputs([input1, input2]) + .add_output(output) + .finish_with_params(protocol_parameters) + .unwrap(), + ); - let incoming_transaction = Transaction { - transaction_id: TransactionId::from_str("0x131fc4cb8f315ae36ae3bf6a4e4b3486d5f17581288f1217410da3e0700d195a") - .unwrap(), - payload: tx_payload, - block_id: None, - network_id: 0, - timestamp: 0, - inclusion_state: InclusionState::Pending, - incoming: false, - note: None, - inputs: Vec::new(), - }; + let pub_key_bytes = prefix_hex::decode(ED25519_PUBLIC_KEY).unwrap(); + let sig_bytes = prefix_hex::decode(ED25519_SIGNATURE).unwrap(); + let signature = Ed25519Signature::try_from_bytes(pub_key_bytes, sig_bytes).unwrap(); + let sig_unlock = Unlock::Signature(SignatureUnlock::from(Signature::from(signature))); + let ref_unlock = Unlock::Reference(ReferenceUnlock::new(0).unwrap()); + let unlocks = Unlocks::new([sig_unlock, ref_unlock]).unwrap(); - let mut incoming_transactions = HashMap::new(); - incoming_transactions.insert( - TransactionId::from_str("0x131fc4cb8f315ae36ae3bf6a4e4b3486d5f17581288f1217410da3e0700d195a").unwrap(), - incoming_transaction, - ); - - let account = AccountDetails { - index: 0, - coin_type: 4218, - alias: "0".to_string(), - public_addresses: Vec::new(), - internal_addresses: Vec::new(), - addresses_with_unspent_outputs: Vec::new(), - outputs: HashMap::new(), - locked_outputs: HashSet::new(), - unspent_outputs: HashMap::new(), - transactions: HashMap::new(), - pending_transactions: HashSet::new(), - incoming_transactions, - inaccessible_incoming_transactions: HashSet::new(), - native_token_foundries: HashMap::new(), - }; + let tx_payload = TransactionPayload::new(essence, unlocks).unwrap(); - let deser_account = AccountDetails::try_from_dto( - serde_json::from_str::(&serde_json::to_string(&AccountDetailsDto::from(&account)).unwrap()) + let incoming_transaction = Transaction { + transaction_id: TransactionId::from_str( + "0x131fc4cb8f315ae36ae3bf6a4e4b3486d5f17581288f1217410da3e0700d195a", + ) .unwrap(), - ) - .unwrap(); - - assert_eq!(account, deser_account); -} - -#[cfg(test)] -impl AccountDetails { - /// Returns a mock of this type with the following values: - /// index: 0, coin_type: 4218, alias: "Alice", public_addresses: contains a single public account address - /// (rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy), all other fields are set to their Rust - /// defaults. - #[cfg(feature = "storage")] - pub(crate) fn mock() -> Self { - use core::str::FromStr; - Self { + payload: tx_payload, + block_id: None, + network_id: 0, + timestamp: 0, + inclusion_state: InclusionState::Pending, + incoming: false, + note: None, + inputs: Vec::new(), + }; + + let mut incoming_transactions = HashMap::new(); + incoming_transactions.insert( + TransactionId::from_str("0x131fc4cb8f315ae36ae3bf6a4e4b3486d5f17581288f1217410da3e0700d195a").unwrap(), + incoming_transaction, + ); + + let account = AccountDetails { index: 0, coin_type: 4218, - alias: "Alice".to_string(), - public_addresses: vec![AccountAddress { - address: crate::types::block::address::Bech32Address::from_str( - "rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy", - ) - .unwrap(), - key_index: 0, - internal: false, - used: false, - }], + alias: "0".to_string(), + public_addresses: Vec::new(), internal_addresses: Vec::new(), addresses_with_unspent_outputs: Vec::new(), outputs: HashMap::new(), @@ -723,9 +684,53 @@ impl AccountDetails { unspent_outputs: HashMap::new(), transactions: HashMap::new(), pending_transactions: HashSet::new(), - incoming_transactions: HashMap::new(), + incoming_transactions, inaccessible_incoming_transactions: HashSet::new(), native_token_foundries: HashMap::new(), + }; + + let deser_account = AccountDetails::try_from_dto( + serde_json::from_str::( + &serde_json::to_string(&AccountDetailsDto::from(&account)).unwrap(), + ) + .unwrap(), + ) + .unwrap(); + + assert_eq!(account, deser_account); + } + + impl AccountDetails { + /// Returns a mock of this type with the following values: + /// index: 0, coin_type: 4218, alias: "Alice", public_addresses: contains a single public account address + /// (rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy), all other fields are set to their Rust + /// defaults. + #[cfg(feature = "storage")] + pub(crate) fn mock() -> Self { + Self { + index: 0, + coin_type: 4218, + alias: "Alice".to_string(), + public_addresses: vec![AccountAddress { + address: crate::types::block::address::Bech32Address::from_str( + "rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy", + ) + .unwrap(), + key_index: 0, + internal: false, + used: false, + }], + internal_addresses: Vec::new(), + addresses_with_unspent_outputs: Vec::new(), + outputs: HashMap::new(), + locked_outputs: HashSet::new(), + unspent_outputs: HashMap::new(), + transactions: HashMap::new(), + pending_transactions: HashSet::new(), + incoming_transactions: HashMap::new(), + inaccessible_incoming_transactions: HashSet::new(), + native_token_foundries: HashMap::new(), + } } } } diff --git a/sdk/src/wallet/account/operations/transaction/high_level/create_alias.rs b/sdk/src/wallet/account/operations/transaction/high_level/create_alias.rs index f173f2f547..4d7501a9b6 100644 --- a/sdk/src/wallet/account/operations/transaction/high_level/create_alias.rs +++ b/sdk/src/wallet/account/operations/transaction/high_level/create_alias.rs @@ -150,6 +150,8 @@ where #[cfg(test)] mod tests { + use pretty_assertions::assert_eq; + use super::*; #[test] diff --git a/sdk/src/wallet/events/mod.rs b/sdk/src/wallet/events/mod.rs index 140159d0a6..a47774ba6f 100644 --- a/sdk/src/wallet/events/mod.rs +++ b/sdk/src/wallet/events/mod.rs @@ -113,6 +113,8 @@ mod tests { }, }; + use pretty_assertions::assert_eq; + use super::{ types::{TransactionInclusionEvent, TransactionProgressEvent, WalletEvent, WalletEventType}, EventEmitter, diff --git a/sdk/src/wallet/storage/manager.rs b/sdk/src/wallet/storage/manager.rs index bb46993fc8..b8a9c30560 100644 --- a/sdk/src/wallet/storage/manager.rs +++ b/sdk/src/wallet/storage/manager.rs @@ -133,6 +133,7 @@ impl StorageAdapter for StorageManager { #[cfg(test)] mod tests { + use pretty_assertions::assert_eq; use serde::{Deserialize, Serialize}; use super::*; diff --git a/sdk/src/wallet/storage/mod.rs b/sdk/src/wallet/storage/mod.rs index 4a3baffa2d..63149817f2 100644 --- a/sdk/src/wallet/storage/mod.rs +++ b/sdk/src/wallet/storage/mod.rs @@ -65,6 +65,7 @@ impl StorageAdapter for Storage { #[cfg(test)] mod tests { + use pretty_assertions::assert_eq; use serde::{Deserialize, Serialize}; use super::*; diff --git a/sdk/src/wallet/storage/participation.rs b/sdk/src/wallet/storage/participation.rs index bb464a9362..6b717e0692 100644 --- a/sdk/src/wallet/storage/participation.rs +++ b/sdk/src/wallet/storage/participation.rs @@ -114,6 +114,8 @@ impl StorageManager { #[cfg(test)] mod tests { + use pretty_assertions::assert_eq; + use super::*; use crate::{types::block::payload::transaction::TransactionId, wallet::storage::adapter::memory::Memory}; diff --git a/sdk/tests/client/addresses.rs b/sdk/tests/client/addresses.rs index 1f06942b8f..33515fe33d 100644 --- a/sdk/tests/client/addresses.rs +++ b/sdk/tests/client/addresses.rs @@ -15,6 +15,7 @@ use iota_sdk::{ }, types::block::address::{Address, Hrp}, }; +use pretty_assertions::assert_eq; use serde::{Deserialize, Serialize}; #[tokio::test] diff --git a/sdk/tests/client/consolidation.rs b/sdk/tests/client/consolidation.rs index 84224d0f04..ba2c90c30b 100644 --- a/sdk/tests/client/consolidation.rs +++ b/sdk/tests/client/consolidation.rs @@ -10,6 +10,7 @@ use iota_sdk::{ output::{unlock_condition::AddressUnlockCondition, BasicOutputBuilder}, }, }; +use pretty_assertions::assert_eq; use crate::client::common::create_client_and_secret_manager_with_funds; diff --git a/sdk/tests/client/error.rs b/sdk/tests/client/error.rs index ace934cc9f..57ceef1889 100644 --- a/sdk/tests/client/error.rs +++ b/sdk/tests/client/error.rs @@ -5,6 +5,7 @@ use iota_sdk::{ client::{api::input_selection::Error as IsaError, Error}, types::block::Error as BlockError, }; +use pretty_assertions::assert_eq; #[test] fn stringified_error() { diff --git a/sdk/tests/client/high_level.rs b/sdk/tests/client/high_level.rs index 308aa2f290..067fdaea56 100644 --- a/sdk/tests/client/high_level.rs +++ b/sdk/tests/client/high_level.rs @@ -5,6 +5,7 @@ use iota_sdk::types::block::{ address::ToBech32Ext, payload::{transaction::TransactionEssence, Payload}, }; +use pretty_assertions::assert_eq; use crate::client::{common::setup_client_with_node_health_ignored, node_api::setup_transaction_block}; diff --git a/sdk/tests/client/input_selection/alias_outputs.rs b/sdk/tests/client/input_selection/alias_outputs.rs index 5479bf5eeb..b237ce1b9f 100644 --- a/sdk/tests/client/input_selection/alias_outputs.rs +++ b/sdk/tests/client/input_selection/alias_outputs.rs @@ -18,6 +18,7 @@ use iota_sdk::{ rand::{block::rand_block_id, output::rand_output_id}, }, }; +use pretty_assertions::{assert_eq, assert_ne}; use crate::client::{ addresses, build_inputs, build_outputs, is_remainder_or_return, unsorted_eq, diff --git a/sdk/tests/client/input_selection/basic_outputs.rs b/sdk/tests/client/input_selection/basic_outputs.rs index dbc316970d..3e42547ce7 100644 --- a/sdk/tests/client/input_selection/basic_outputs.rs +++ b/sdk/tests/client/input_selection/basic_outputs.rs @@ -11,6 +11,7 @@ use iota_sdk::{ protocol::protocol_parameters, }, }; +use pretty_assertions::assert_eq; use crate::client::{ addresses, build_inputs, build_outputs, is_remainder_or_return, unsorted_eq, diff --git a/sdk/tests/client/input_selection/burn.rs b/sdk/tests/client/input_selection/burn.rs index 9ef9136a04..49abd98aef 100644 --- a/sdk/tests/client/input_selection/burn.rs +++ b/sdk/tests/client/input_selection/burn.rs @@ -14,6 +14,7 @@ use iota_sdk::{ protocol::protocol_parameters, }, }; +use pretty_assertions::assert_eq; use crate::client::{ addresses, build_inputs, build_outputs, is_remainder_or_return, unsorted_eq, diff --git a/sdk/tests/client/input_selection/expiration.rs b/sdk/tests/client/input_selection/expiration.rs index ddb0457e4d..dccb86a90e 100644 --- a/sdk/tests/client/input_selection/expiration.rs +++ b/sdk/tests/client/input_selection/expiration.rs @@ -10,6 +10,7 @@ use iota_sdk::{ protocol::protocol_parameters, }, }; +use pretty_assertions::assert_eq; use crate::client::{ addresses, build_inputs, build_outputs, is_remainder_or_return, unsorted_eq, diff --git a/sdk/tests/client/input_selection/foundry_outputs.rs b/sdk/tests/client/input_selection/foundry_outputs.rs index f6684359be..7c3fbfc313 100644 --- a/sdk/tests/client/input_selection/foundry_outputs.rs +++ b/sdk/tests/client/input_selection/foundry_outputs.rs @@ -19,6 +19,7 @@ use iota_sdk::{ rand::{block::rand_block_id, output::rand_output_id}, }, }; +use pretty_assertions::assert_eq; use crate::client::{ addresses, build_inputs, build_outputs, is_remainder_or_return, unsorted_eq, diff --git a/sdk/tests/client/input_selection/native_tokens.rs b/sdk/tests/client/input_selection/native_tokens.rs index e56929f518..3d770dbce3 100644 --- a/sdk/tests/client/input_selection/native_tokens.rs +++ b/sdk/tests/client/input_selection/native_tokens.rs @@ -7,6 +7,7 @@ use iota_sdk::{ client::api::input_selection::{Burn, Error, InputSelection}, types::block::{output::TokenId, protocol::protocol_parameters}, }; +use pretty_assertions::assert_eq; use primitive_types::U256; use crate::client::{ diff --git a/sdk/tests/client/input_selection/nft_outputs.rs b/sdk/tests/client/input_selection/nft_outputs.rs index 59980c680b..3d59afc0ef 100644 --- a/sdk/tests/client/input_selection/nft_outputs.rs +++ b/sdk/tests/client/input_selection/nft_outputs.rs @@ -18,6 +18,7 @@ use iota_sdk::{ rand::{block::rand_block_id, output::rand_output_id}, }, }; +use pretty_assertions::{assert_eq, assert_ne}; use crate::client::{ addresses, build_inputs, build_outputs, is_remainder_or_return, unsorted_eq, diff --git a/sdk/tests/client/input_selection/outputs.rs b/sdk/tests/client/input_selection/outputs.rs index d2ca8a370b..7f5c134314 100644 --- a/sdk/tests/client/input_selection/outputs.rs +++ b/sdk/tests/client/input_selection/outputs.rs @@ -7,6 +7,7 @@ use iota_sdk::{ client::api::input_selection::{Burn, Error, InputSelection}, types::block::{output::AliasId, protocol::protocol_parameters}, }; +use pretty_assertions::assert_eq; use crate::client::{ addresses, build_inputs, build_outputs, is_remainder_or_return, unsorted_eq, diff --git a/sdk/tests/client/input_selection/storage_deposit_return.rs b/sdk/tests/client/input_selection/storage_deposit_return.rs index ba28e82cd1..9ed3c14364 100644 --- a/sdk/tests/client/input_selection/storage_deposit_return.rs +++ b/sdk/tests/client/input_selection/storage_deposit_return.rs @@ -7,6 +7,7 @@ use iota_sdk::{ client::api::input_selection::{Error, InputSelection}, types::block::{output::AliasId, protocol::protocol_parameters}, }; +use pretty_assertions::assert_eq; use crate::client::{ addresses, build_inputs, build_outputs, is_remainder_or_return, unsorted_eq, diff --git a/sdk/tests/client/input_selection/timelock.rs b/sdk/tests/client/input_selection/timelock.rs index 4f94df0e43..1cac100350 100644 --- a/sdk/tests/client/input_selection/timelock.rs +++ b/sdk/tests/client/input_selection/timelock.rs @@ -5,6 +5,7 @@ use iota_sdk::{ client::api::input_selection::{Error, InputSelection}, types::block::protocol::protocol_parameters, }; +use pretty_assertions::assert_eq; use crate::client::{ addresses, build_inputs, build_outputs, unsorted_eq, Build::Basic, BECH32_ADDRESS_ED25519_0, diff --git a/sdk/tests/client/input_signing_data.rs b/sdk/tests/client/input_signing_data.rs index ccf25b4373..e733c80f8b 100644 --- a/sdk/tests/client/input_signing_data.rs +++ b/sdk/tests/client/input_signing_data.rs @@ -19,6 +19,7 @@ use iota_sdk::{ TryFromDto, }, }; +use pretty_assertions::assert_eq; #[test] fn input_signing_data_conversion() { diff --git a/sdk/tests/client/node_api/core.rs b/sdk/tests/client/node_api/core.rs index 1c9be1c4c6..a73d75f252 100644 --- a/sdk/tests/client/node_api/core.rs +++ b/sdk/tests/client/node_api/core.rs @@ -12,6 +12,7 @@ use iota_sdk::{ }, }; use packable::PackableExt; +use pretty_assertions::assert_eq; use super::{setup_secret_manager, setup_tagged_data_block, setup_transaction_block}; use crate::client::common::{setup_client_with_node_health_ignored, NODE_LOCAL}; diff --git a/sdk/tests/client/node_api/indexer.rs b/sdk/tests/client/node_api/indexer.rs index 30435d108c..624213169b 100644 --- a/sdk/tests/client/node_api/indexer.rs +++ b/sdk/tests/client/node_api/indexer.rs @@ -15,6 +15,7 @@ use iota_sdk::{ }, }, }; +use pretty_assertions::assert_eq; use super::{get_alias_output_id, get_foundry_output_id, get_nft_output_id}; use crate::client::common::create_client_and_secret_manager_with_funds; diff --git a/sdk/tests/client/node_api/mqtt.rs b/sdk/tests/client/node_api/mqtt.rs index ff93d98b71..06fa0d88fe 100644 --- a/sdk/tests/client/node_api/mqtt.rs +++ b/sdk/tests/client/node_api/mqtt.rs @@ -1,6 +1,8 @@ // Copyright 2023 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 +use pretty_assertions::assert_eq; + use crate::client::common::setup_client_with_node_health_ignored; #[ignore] diff --git a/sdk/tests/client/secret_manager/mnemonic.rs b/sdk/tests/client/secret_manager/mnemonic.rs index 453fc9861c..e97e1a962a 100644 --- a/sdk/tests/client/secret_manager/mnemonic.rs +++ b/sdk/tests/client/secret_manager/mnemonic.rs @@ -4,6 +4,7 @@ use iota_sdk::client::{ api::GetAddressesOptions, constants::SHIMMER_TESTNET_BECH32_HRP, secret::SecretManager, Result, }; +use pretty_assertions::assert_eq; #[tokio::test] async fn mnemonic_secret_manager() -> Result<()> { diff --git a/sdk/tests/client/secret_manager/private_key.rs b/sdk/tests/client/secret_manager/private_key.rs index 31c8d6f10b..d4fb09e4b1 100644 --- a/sdk/tests/client/secret_manager/private_key.rs +++ b/sdk/tests/client/secret_manager/private_key.rs @@ -7,6 +7,7 @@ use iota_sdk::client::{ secret::{private_key::PrivateKeySecretManager, SecretManager}, Result, }; +use pretty_assertions::assert_eq; #[tokio::test] async fn private_key_secret_manager_hex() -> Result<()> { diff --git a/sdk/tests/client/secret_manager/stronghold.rs b/sdk/tests/client/secret_manager/stronghold.rs index 0ff2515c72..b915d9364f 100644 --- a/sdk/tests/client/secret_manager/stronghold.rs +++ b/sdk/tests/client/secret_manager/stronghold.rs @@ -4,6 +4,7 @@ use iota_sdk::client::{ api::GetAddressesOptions, constants::SHIMMER_TESTNET_BECH32_HRP, secret::SecretManager, Result, }; +use pretty_assertions::assert_eq; #[tokio::test] async fn stronghold_secret_manager() -> Result<()> { diff --git a/sdk/tests/client/signing/alias.rs b/sdk/tests/client/signing/alias.rs index 72c97001a6..883cf78f58 100644 --- a/sdk/tests/client/signing/alias.rs +++ b/sdk/tests/client/signing/alias.rs @@ -27,6 +27,7 @@ use iota_sdk::{ unlock::{SignatureUnlock, Unlock}, }, }; +use pretty_assertions::assert_eq; use crate::client::{ build_inputs, build_outputs, diff --git a/sdk/tests/client/signing/basic.rs b/sdk/tests/client/signing/basic.rs index ca325ff6ba..be2252ac78 100644 --- a/sdk/tests/client/signing/basic.rs +++ b/sdk/tests/client/signing/basic.rs @@ -25,6 +25,7 @@ use iota_sdk::{ unlock::{SignatureUnlock, Unlock}, }, }; +use pretty_assertions::assert_eq; use crate::client::{build_inputs, build_outputs, Build::Basic}; diff --git a/sdk/tests/client/signing/mod.rs b/sdk/tests/client/signing/mod.rs index 05ca12091c..3a9e58bad7 100644 --- a/sdk/tests/client/signing/mod.rs +++ b/sdk/tests/client/signing/mod.rs @@ -31,6 +31,7 @@ use iota_sdk::{ unlock::{SignatureUnlock, Unlock}, }, }; +use pretty_assertions::assert_eq; use crate::client::{ build_inputs, build_outputs, diff --git a/sdk/tests/client/signing/nft.rs b/sdk/tests/client/signing/nft.rs index 0beccf4fa5..2498bfbef0 100644 --- a/sdk/tests/client/signing/nft.rs +++ b/sdk/tests/client/signing/nft.rs @@ -27,6 +27,7 @@ use iota_sdk::{ unlock::{SignatureUnlock, Unlock}, }, }; +use pretty_assertions::assert_eq; use crate::client::{ build_inputs, build_outputs, diff --git a/sdk/tests/client/transactions.rs b/sdk/tests/client/transactions.rs index fd847133a4..db4fb9aaf9 100644 --- a/sdk/tests/client/transactions.rs +++ b/sdk/tests/client/transactions.rs @@ -12,6 +12,7 @@ use iota_sdk::{ payload::Payload, }, }; +use pretty_assertions::assert_eq; use crate::client::common::create_client_and_secret_manager_with_funds; diff --git a/sdk/tests/types/address/alias.rs b/sdk/tests/types/address/alias.rs index 237b7c9824..626ef557f3 100644 --- a/sdk/tests/types/address/alias.rs +++ b/sdk/tests/types/address/alias.rs @@ -12,6 +12,7 @@ use iota_sdk::types::block::{ Error, }; use packable::PackableExt; +use pretty_assertions::assert_eq; const ALIAS_ID: &str = "0xe9ba80ad1561e437b663a1f1efbfabd544b0d7da7bb33e0a62e99b20ee450bee"; const ALIAS_BECH32: &str = "rms1pr5m4q9dz4s7gdakvwslrmal4025fvxhmfamx0s2vt5ekg8wg597um6lcnn"; diff --git a/sdk/tests/types/address/bech32.rs b/sdk/tests/types/address/bech32.rs index 86d1c704c7..971a6bb052 100644 --- a/sdk/tests/types/address/bech32.rs +++ b/sdk/tests/types/address/bech32.rs @@ -8,6 +8,7 @@ use iota_sdk::types::block::{ Error, }; use packable::PackableExt; +use pretty_assertions::assert_eq; const ED25519_ADDRESS: &str = "0xebe40a263480190dcd7939447ee01aefa73d6f3cc33c90ef7bf905abf8728655"; const ED25519_BECH32: &str = "rms1qr47gz3xxjqpjrwd0yu5glhqrth6w0t08npney8000ust2lcw2r92j5a8rt"; diff --git a/sdk/tests/types/address/ed25519.rs b/sdk/tests/types/address/ed25519.rs index 4d196f7780..2f071d8639 100644 --- a/sdk/tests/types/address/ed25519.rs +++ b/sdk/tests/types/address/ed25519.rs @@ -11,6 +11,7 @@ use iota_sdk::types::block::{ Error, }; use packable::PackableExt; +use pretty_assertions::assert_eq; const ED25519_ADDRESS: &str = "0xebe40a263480190dcd7939447ee01aefa73d6f3cc33c90ef7bf905abf8728655"; const ED25519_BECH32: &str = "rms1qr47gz3xxjqpjrwd0yu5glhqrth6w0t08npney8000ust2lcw2r92j5a8rt"; diff --git a/sdk/tests/types/address/mod.rs b/sdk/tests/types/address/mod.rs index efc2d54dc8..91057f8e08 100644 --- a/sdk/tests/types/address/mod.rs +++ b/sdk/tests/types/address/mod.rs @@ -12,6 +12,7 @@ use iota_sdk::types::block::{ address::{Address, AliasAddress, Ed25519Address, NftAddress}, Error, }; +use pretty_assertions::assert_eq; const ED25519_ADDRESS: &str = "0xebe40a263480190dcd7939447ee01aefa73d6f3cc33c90ef7bf905abf8728655"; const ALIAS_ID: &str = "0xe9ba80ad1561e437b663a1f1efbfabd544b0d7da7bb33e0a62e99b20ee450bee"; diff --git a/sdk/tests/types/address/nft.rs b/sdk/tests/types/address/nft.rs index 3255203d2f..2fdc9b8c45 100644 --- a/sdk/tests/types/address/nft.rs +++ b/sdk/tests/types/address/nft.rs @@ -12,6 +12,7 @@ use iota_sdk::types::block::{ Error, }; use packable::PackableExt; +use pretty_assertions::assert_eq; const NFT_ID: &str = "0xa9ede98a7f0223fa7a49fbc586f7a88bb4f0d152f282b19bcebd05c9e8a02370"; const NFT_BECH32: &str = "rms1zz57m6v20upz87n6f8autphh4z9mfux32teg9vvme67stj0g5q3hqd6l53z"; diff --git a/sdk/tests/types/api/participation.rs b/sdk/tests/types/api/participation.rs index bd76d06838..8e6d05ab4a 100644 --- a/sdk/tests/types/api/participation.rs +++ b/sdk/tests/types/api/participation.rs @@ -4,6 +4,7 @@ use std::str::FromStr; use iota_sdk::types::api::plugins::participation::types::{Participation, ParticipationEventId, Participations}; +use pretty_assertions::assert_eq; #[test] fn serialize_deserialize() { diff --git a/sdk/tests/types/block.rs b/sdk/tests/types/block.rs index d9eace847f..ed80f29831 100644 --- a/sdk/tests/types/block.rs +++ b/sdk/tests/types/block.rs @@ -17,6 +17,7 @@ use iota_sdk::{ }, }; use packable::{error::UnpackError, PackableExt}; +use pretty_assertions::assert_eq; #[test] fn default_finish_zero_nonce() { diff --git a/sdk/tests/types/block_id.rs b/sdk/tests/types/block_id.rs index 7159730a34..7970329beb 100644 --- a/sdk/tests/types/block_id.rs +++ b/sdk/tests/types/block_id.rs @@ -5,6 +5,7 @@ use core::str::FromStr; use iota_sdk::types::block::BlockId; use packable::PackableExt; +use pretty_assertions::assert_eq; const BLOCK_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; diff --git a/sdk/tests/types/ed25519_signature.rs b/sdk/tests/types/ed25519_signature.rs index 1e51e876dc..9217482343 100644 --- a/sdk/tests/types/ed25519_signature.rs +++ b/sdk/tests/types/ed25519_signature.rs @@ -3,6 +3,7 @@ use iota_sdk::types::block::signature::Ed25519Signature; use packable::PackableExt; +use pretty_assertions::assert_eq; const ED25519_PUBLIC_KEY: &str = "0x1da5ddd11ba3f961acab68fafee3177d039875eaa94ac5fdbff8b53f0c50bfb9"; const ED25519_SIGNATURE: &str = "0xc6a40edf9a089f42c18f4ebccb35fe4b578d93b879e99b87f63573324a710d3456b03fb6d1fcc027e6401cbd9581f790ee3ed7a3f68e9c225fcb9f1cd7b7110d"; diff --git a/sdk/tests/types/foundry_id.rs b/sdk/tests/types/foundry_id.rs index 422b2ce44d..1d7ab11215 100644 --- a/sdk/tests/types/foundry_id.rs +++ b/sdk/tests/types/foundry_id.rs @@ -7,6 +7,7 @@ use iota_sdk::types::block::{ address::AliasAddress, output::{AliasId, FoundryId, SimpleTokenScheme, TokenScheme}, }; +use pretty_assertions::assert_eq; #[test] fn getters() { diff --git a/sdk/tests/types/input/treasury.rs b/sdk/tests/types/input/treasury.rs index 488c059942..cad40eec9d 100644 --- a/sdk/tests/types/input/treasury.rs +++ b/sdk/tests/types/input/treasury.rs @@ -12,6 +12,7 @@ use iota_sdk::types::block::{ Error, }; use packable::PackableExt; +use pretty_assertions::assert_eq; const MILESTONE_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; const MILESTONE_ID_INVALID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c64"; diff --git a/sdk/tests/types/input/utxo.rs b/sdk/tests/types/input/utxo.rs index 83f918752e..b8ffdbcdaf 100644 --- a/sdk/tests/types/input/utxo.rs +++ b/sdk/tests/types/input/utxo.rs @@ -12,6 +12,7 @@ use iota_sdk::types::block::{ Error, }; use packable::{bounded::InvalidBoundedU16, PackableExt}; +use pretty_assertions::assert_eq; const OUTPUT_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c6492a00"; const TRANSACTION_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; diff --git a/sdk/tests/types/migrated_funds_entry.rs b/sdk/tests/types/migrated_funds_entry.rs index cf239b8ae8..b7801079a8 100644 --- a/sdk/tests/types/migrated_funds_entry.rs +++ b/sdk/tests/types/migrated_funds_entry.rs @@ -11,6 +11,7 @@ use iota_sdk::types::block::{ Error, }; use packable::{error::UnpackError, PackableExt}; +use pretty_assertions::assert_eq; const ED25519_ADDRESS: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; diff --git a/sdk/tests/types/milestone_id.rs b/sdk/tests/types/milestone_id.rs index c40c6389ac..83f9fc051b 100644 --- a/sdk/tests/types/milestone_id.rs +++ b/sdk/tests/types/milestone_id.rs @@ -5,6 +5,7 @@ use core::str::FromStr; use iota_sdk::types::block::payload::milestone::MilestoneId; use packable::PackableExt; +use pretty_assertions::assert_eq; const MILESTONE_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; diff --git a/sdk/tests/types/milestone_index.rs b/sdk/tests/types/milestone_index.rs index dd277598ef..13f9e05c5c 100644 --- a/sdk/tests/types/milestone_index.rs +++ b/sdk/tests/types/milestone_index.rs @@ -3,6 +3,7 @@ pub use iota_sdk::types::block::payload::milestone::MilestoneIndex; pub use packable::PackableExt; +use pretty_assertions::assert_eq; #[test] fn debug_impl() { diff --git a/sdk/tests/types/milestone_payload.rs b/sdk/tests/types/milestone_payload.rs index 05f34b06dc..45460b4b44 100644 --- a/sdk/tests/types/milestone_payload.rs +++ b/sdk/tests/types/milestone_payload.rs @@ -15,6 +15,7 @@ use iota_sdk::types::block::{ Error, }; use packable::{bounded::TryIntoBoundedU8Error, PackableExt}; +use pretty_assertions::assert_eq; #[test] fn kind() { diff --git a/sdk/tests/types/milestone_payload_essence.rs b/sdk/tests/types/milestone_payload_essence.rs index 9b1c17cef6..aaaf7e94cf 100644 --- a/sdk/tests/types/milestone_payload_essence.rs +++ b/sdk/tests/types/milestone_payload_essence.rs @@ -21,6 +21,7 @@ use iota_sdk::types::block::{ }, }; use packable::PackableExt; +use pretty_assertions::assert_eq; #[test] fn new_valid() { diff --git a/sdk/tests/types/output_id.rs b/sdk/tests/types/output_id.rs index f8ae874c7d..571475f1d2 100644 --- a/sdk/tests/types/output_id.rs +++ b/sdk/tests/types/output_id.rs @@ -5,6 +5,7 @@ use core::str::FromStr; use iota_sdk::types::block::{output::OutputId, payload::transaction::TransactionId, Error}; use packable::{bounded::InvalidBoundedU16, error::UnpackError, PackableExt}; +use pretty_assertions::assert_eq; const TRANSACTION_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; const OUTPUT_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c6492a00"; diff --git a/sdk/tests/types/parents.rs b/sdk/tests/types/parents.rs index c8333045fb..438f01edc0 100644 --- a/sdk/tests/types/parents.rs +++ b/sdk/tests/types/parents.rs @@ -10,6 +10,7 @@ use iota_sdk::types::block::{ BlockId, Error, }; use packable::{bounded::TryIntoBoundedU8Error, error::UnpackError, prefix::VecPrefix, PackableExt}; +use pretty_assertions::assert_eq; #[test] fn len() { diff --git a/sdk/tests/types/payload.rs b/sdk/tests/types/payload.rs index 1822cd9034..327f74dc9a 100644 --- a/sdk/tests/types/payload.rs +++ b/sdk/tests/types/payload.rs @@ -23,6 +23,7 @@ use iota_sdk::types::block::{ unlock::{ReferenceUnlock, SignatureUnlock, Unlock, Unlocks}, }; use packable::PackableExt; +use pretty_assertions::assert_eq; const TRANSACTION_ID: &str = "0x24a1f46bdb6b2bf38f1c59f73cdd4ae5b418804bb231d76d06fbf246498d5883"; const ED25519_ADDRESS: &str = "0xe594f9a895c0e0a6760dd12cffc2c3d1e1cbf7269b328091f96ce3d0dd550b75"; diff --git a/sdk/tests/types/receipt_milestone_option.rs b/sdk/tests/types/receipt_milestone_option.rs index 630e2b76ab..8c3708aca8 100644 --- a/sdk/tests/types/receipt_milestone_option.rs +++ b/sdk/tests/types/receipt_milestone_option.rs @@ -19,6 +19,7 @@ use iota_sdk::types::block::{ Error, }; use packable::{bounded::TryIntoBoundedU16Error, PackableExt}; +use pretty_assertions::assert_eq; const AMOUNT: u64 = 1_000_000; const ED25519_ADDRESS: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; diff --git a/sdk/tests/types/tagged_data_payload.rs b/sdk/tests/types/tagged_data_payload.rs index b66d3ebbb1..34a6939b83 100644 --- a/sdk/tests/types/tagged_data_payload.rs +++ b/sdk/tests/types/tagged_data_payload.rs @@ -11,6 +11,7 @@ use packable::{ error::UnpackError, PackableExt, }; +use pretty_assertions::assert_eq; #[test] fn kind() { diff --git a/sdk/tests/types/tail_transaction_hash.rs b/sdk/tests/types/tail_transaction_hash.rs index cc5ef2f750..8a91eebff6 100644 --- a/sdk/tests/types/tail_transaction_hash.rs +++ b/sdk/tests/types/tail_transaction_hash.rs @@ -3,6 +3,7 @@ use iota_sdk::types::block::{payload::milestone::option::TailTransactionHash, Error}; use packable::{error::UnpackError, PackableExt}; +use pretty_assertions::assert_eq; const HASH_TRYTES: &str = "TZTXLMTAURX9DYQICXZEUMCDBPNXVOHNBBZDSSVCNCTWKSMUALAYPMHUCKGOGSTBUHSQIMSY9HQEP9AXJ"; const HASH_BYTES: [u8; 49] = [ diff --git a/sdk/tests/types/transaction_essence.rs b/sdk/tests/types/transaction_essence.rs index 3ffb703a66..2bf2b36f08 100644 --- a/sdk/tests/types/transaction_essence.rs +++ b/sdk/tests/types/transaction_essence.rs @@ -11,6 +11,7 @@ use iota_sdk::types::block::{ Error, }; use packable::{error::UnpackError, PackableExt}; +use pretty_assertions::assert_eq; const TRANSACTION_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; const ED25519_ADDRESS: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; diff --git a/sdk/tests/types/transaction_id.rs b/sdk/tests/types/transaction_id.rs index 05de12008c..c4acd6e219 100644 --- a/sdk/tests/types/transaction_id.rs +++ b/sdk/tests/types/transaction_id.rs @@ -5,6 +5,7 @@ use core::str::FromStr; use iota_sdk::types::block::payload::transaction::TransactionId; use packable::PackableExt; +use pretty_assertions::assert_eq; const TRANSACTION_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; diff --git a/sdk/tests/types/transaction_payload.rs b/sdk/tests/types/transaction_payload.rs index e060926079..5c9ee49580 100644 --- a/sdk/tests/types/transaction_payload.rs +++ b/sdk/tests/types/transaction_payload.rs @@ -13,6 +13,7 @@ use iota_sdk::types::block::{ Error, }; use packable::PackableExt; +use pretty_assertions::assert_eq; const TRANSACTION_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; const ED25519_ADDRESS: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; diff --git a/sdk/tests/types/transaction_regular_essence.rs b/sdk/tests/types/transaction_regular_essence.rs index 723d2429bc..d113d1c981 100644 --- a/sdk/tests/types/transaction_regular_essence.rs +++ b/sdk/tests/types/transaction_regular_essence.rs @@ -26,6 +26,7 @@ use iota_sdk::types::block::{ Error, }; use packable::bounded::TryIntoBoundedU16Error; +use pretty_assertions::assert_eq; const TRANSACTION_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; const ED25519_ADDRESS_1: &str = "0xd56da1eb7726ed482dfe9d457cf548c2ae2a6ce3e053dbf82f11223be476adb9"; diff --git a/sdk/tests/types/treasury_output.rs b/sdk/tests/types/treasury_output.rs index 1e55a0ff7b..8fb6567f58 100644 --- a/sdk/tests/types/treasury_output.rs +++ b/sdk/tests/types/treasury_output.rs @@ -3,6 +3,7 @@ use iota_sdk::types::block::{output::TreasuryOutput, protocol::protocol_parameters, Error}; use packable::{error::UnpackError, PackableExt}; +use pretty_assertions::assert_eq; #[test] fn kind() { diff --git a/sdk/tests/types/treasury_transaction_payload.rs b/sdk/tests/types/treasury_transaction_payload.rs index c21378a9f6..ce20dceb65 100644 --- a/sdk/tests/types/treasury_transaction_payload.rs +++ b/sdk/tests/types/treasury_transaction_payload.rs @@ -7,6 +7,7 @@ use iota_sdk::types::block::{ input::TreasuryInput, output::TreasuryOutput, payload::TreasuryTransactionPayload, protocol::protocol_parameters, }; use packable::PackableExt; +use pretty_assertions::assert_eq; const BLOCK_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; diff --git a/sdk/tests/types/unlock/alias.rs b/sdk/tests/types/unlock/alias.rs index 44d3961296..e872626819 100644 --- a/sdk/tests/types/unlock/alias.rs +++ b/sdk/tests/types/unlock/alias.rs @@ -3,6 +3,7 @@ use iota_sdk::types::block::{unlock::AliasUnlock, Error}; use packable::{bounded::InvalidBoundedU16, PackableExt}; +use pretty_assertions::assert_eq; #[test] fn kind() { diff --git a/sdk/tests/types/unlock/mod.rs b/sdk/tests/types/unlock/mod.rs index ba8e231490..51a2ef91e0 100644 --- a/sdk/tests/types/unlock/mod.rs +++ b/sdk/tests/types/unlock/mod.rs @@ -12,6 +12,7 @@ use iota_sdk::types::block::{ Error, }; use packable::bounded::TryIntoBoundedU16Error; +use pretty_assertions::assert_eq; #[test] fn kind() { diff --git a/sdk/tests/types/unlock/nft.rs b/sdk/tests/types/unlock/nft.rs index f708c8e5a5..356c0d9c71 100644 --- a/sdk/tests/types/unlock/nft.rs +++ b/sdk/tests/types/unlock/nft.rs @@ -3,6 +3,7 @@ use iota_sdk::types::block::{unlock::NftUnlock, Error}; use packable::{bounded::InvalidBoundedU16, PackableExt}; +use pretty_assertions::assert_eq; #[test] fn kind() { diff --git a/sdk/tests/types/unlock/reference.rs b/sdk/tests/types/unlock/reference.rs index ba50ced2f9..6938d60b12 100644 --- a/sdk/tests/types/unlock/reference.rs +++ b/sdk/tests/types/unlock/reference.rs @@ -3,6 +3,7 @@ use iota_sdk::types::block::{unlock::ReferenceUnlock, Error}; use packable::{bounded::InvalidBoundedU16, error::UnpackError, PackableExt}; +use pretty_assertions::assert_eq; #[test] fn kind() { diff --git a/sdk/tests/types/unlock/signature.rs b/sdk/tests/types/unlock/signature.rs index 20d3466f17..0833a13616 100644 --- a/sdk/tests/types/unlock/signature.rs +++ b/sdk/tests/types/unlock/signature.rs @@ -3,6 +3,7 @@ use iota_sdk::types::block::{rand::signature::rand_signature, unlock::SignatureUnlock, Error}; use packable::{error::UnpackError, PackableExt}; +use pretty_assertions::assert_eq; #[test] fn unlock_kind() { diff --git a/sdk/tests/utils/serde.rs b/sdk/tests/utils/serde.rs index 4e6cb66369..5c84cc70ae 100644 --- a/sdk/tests/utils/serde.rs +++ b/sdk/tests/utils/serde.rs @@ -4,6 +4,7 @@ use core::str::FromStr; use iota_sdk::types::block::BlockId; +use pretty_assertions::assert_eq; use serde::{Deserialize, Serialize}; const BLOCK_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; diff --git a/sdk/tests/wallet/account_recovery.rs b/sdk/tests/wallet/account_recovery.rs index 2168ef797b..9113d188ba 100644 --- a/sdk/tests/wallet/account_recovery.rs +++ b/sdk/tests/wallet/account_recovery.rs @@ -14,6 +14,7 @@ use iota_sdk::{ }, wallet::Result, }; +use pretty_assertions::assert_eq; use crate::wallet::common::{make_wallet, setup, tear_down}; diff --git a/sdk/tests/wallet/accounts.rs b/sdk/tests/wallet/accounts.rs index a6ee7baac5..1b4b329d47 100644 --- a/sdk/tests/wallet/accounts.rs +++ b/sdk/tests/wallet/accounts.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use iota_sdk::wallet::Result; +use pretty_assertions::assert_eq; #[cfg(feature = "stronghold")] use { iota_sdk::client::{ diff --git a/sdk/tests/wallet/address_generation.rs b/sdk/tests/wallet/address_generation.rs index 7677855da0..2d89c6d382 100644 --- a/sdk/tests/wallet/address_generation.rs +++ b/sdk/tests/wallet/address_generation.rs @@ -18,6 +18,7 @@ use iota_sdk::{ types::block::address::ToBech32Ext, wallet::{ClientOptions, Error, Result, Wallet}, }; +use pretty_assertions::assert_eq; use crate::wallet::common::{setup, tear_down, DEFAULT_MNEMONIC, NODE_LOCAL}; diff --git a/sdk/tests/wallet/backup_restore.rs b/sdk/tests/wallet/backup_restore.rs index ae981c1196..dcaef000d1 100644 --- a/sdk/tests/wallet/backup_restore.rs +++ b/sdk/tests/wallet/backup_restore.rs @@ -13,6 +13,7 @@ use iota_sdk::{ wallet::{ClientOptions, Result, Wallet}, Url, }; +use pretty_assertions::assert_eq; use crate::wallet::common::{setup, tear_down, NODE_LOCAL, NODE_OTHER}; diff --git a/sdk/tests/wallet/balance.rs b/sdk/tests/wallet/balance.rs index 860d0c625b..2b04573435 100644 --- a/sdk/tests/wallet/balance.rs +++ b/sdk/tests/wallet/balance.rs @@ -9,6 +9,7 @@ use iota_sdk::{ }, wallet::{account::types::Balance, Result}, }; +use pretty_assertions::assert_eq; use crate::wallet::common::{create_accounts_with_funds, make_wallet, setup, tear_down}; diff --git a/sdk/tests/wallet/bech32_hrp_validation.rs b/sdk/tests/wallet/bech32_hrp_validation.rs index a5e43fdc47..d50fafefe0 100644 --- a/sdk/tests/wallet/bech32_hrp_validation.rs +++ b/sdk/tests/wallet/bech32_hrp_validation.rs @@ -6,6 +6,7 @@ use iota_sdk::{ types::block::address::{Bech32Address, ToBech32Ext}, wallet::{account::OutputParams, Error, Result, SendParams}, }; +use pretty_assertions::assert_eq; use crate::wallet::common::{make_wallet, setup, tear_down}; diff --git a/sdk/tests/wallet/burn_outputs.rs b/sdk/tests/wallet/burn_outputs.rs index 2fad7104f7..ef3cc57980 100644 --- a/sdk/tests/wallet/burn_outputs.rs +++ b/sdk/tests/wallet/burn_outputs.rs @@ -10,6 +10,7 @@ use iota_sdk::{ wallet::{Account, CreateNativeTokenParams, MintNftParams, Result}, U256, }; +use pretty_assertions::assert_eq; use crate::wallet::common::{create_accounts_with_funds, make_wallet, setup, tear_down}; diff --git a/sdk/tests/wallet/chrysalis_migration.rs b/sdk/tests/wallet/chrysalis_migration.rs index 0885f02043..71d1ff18ae 100644 --- a/sdk/tests/wallet/chrysalis_migration.rs +++ b/sdk/tests/wallet/chrysalis_migration.rs @@ -13,6 +13,7 @@ use iota_sdk::{ }, Wallet, }; +use pretty_assertions::assert_eq; use zeroize::Zeroizing; use crate::wallet::common::{setup, tear_down}; diff --git a/sdk/tests/wallet/claim_outputs.rs b/sdk/tests/wallet/claim_outputs.rs index 0e0736fdad..39768b7f35 100644 --- a/sdk/tests/wallet/claim_outputs.rs +++ b/sdk/tests/wallet/claim_outputs.rs @@ -12,6 +12,7 @@ use iota_sdk::{ }, U256, }; +use pretty_assertions::assert_eq; use crate::wallet::common::{create_accounts_with_funds, make_wallet, setup, tear_down}; diff --git a/sdk/tests/wallet/consolidation.rs b/sdk/tests/wallet/consolidation.rs index 68ae94793c..fa7aec8afe 100644 --- a/sdk/tests/wallet/consolidation.rs +++ b/sdk/tests/wallet/consolidation.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use iota_sdk::wallet::{account::ConsolidationParams, Result, SendParams}; +use pretty_assertions::assert_eq; use crate::wallet::common::{create_accounts_with_funds, make_wallet, setup, tear_down}; diff --git a/sdk/tests/wallet/core.rs b/sdk/tests/wallet/core.rs index 7976603615..77fc9a0dad 100644 --- a/sdk/tests/wallet/core.rs +++ b/sdk/tests/wallet/core.rs @@ -17,6 +17,7 @@ use iota_sdk::{ types::block::address::Bech32Address, wallet::{ClientOptions, Result, Wallet}, }; +use pretty_assertions::assert_eq; #[cfg(feature = "storage")] use crate::wallet::common::NODE_OTHER; diff --git a/sdk/tests/wallet/error.rs b/sdk/tests/wallet/error.rs index 06282eeb5b..a80fd657b9 100644 --- a/sdk/tests/wallet/error.rs +++ b/sdk/tests/wallet/error.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use iota_sdk::wallet::Error; +use pretty_assertions::assert_eq; #[test] fn stringified_error() { diff --git a/sdk/tests/wallet/events.rs b/sdk/tests/wallet/events.rs index 26db224256..80735a3123 100644 --- a/sdk/tests/wallet/events.rs +++ b/sdk/tests/wallet/events.rs @@ -19,6 +19,7 @@ use iota_sdk::{ }, }, }; +use pretty_assertions::assert_eq; const ED25519_ADDRESS: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; const TRANSACTION_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"; diff --git a/sdk/tests/wallet/migrate_stronghold_snapshot_v2_to_v3.rs b/sdk/tests/wallet/migrate_stronghold_snapshot_v2_to_v3.rs index 794e9f8247..5862ce3aef 100644 --- a/sdk/tests/wallet/migrate_stronghold_snapshot_v2_to_v3.rs +++ b/sdk/tests/wallet/migrate_stronghold_snapshot_v2_to_v3.rs @@ -14,6 +14,7 @@ use iota_sdk::{ }, wallet::{ClientOptions, Error as WalletError, Wallet}, }; +use pretty_assertions::assert_eq; use crate::wallet::common::{setup, tear_down, NODE_LOCAL}; diff --git a/sdk/tests/wallet/native_tokens.rs b/sdk/tests/wallet/native_tokens.rs index 67761e0dc2..40dc1aa405 100644 --- a/sdk/tests/wallet/native_tokens.rs +++ b/sdk/tests/wallet/native_tokens.rs @@ -5,6 +5,7 @@ use iota_sdk::{ wallet::{account::SyncOptions, CreateNativeTokenParams, Result}, U256, }; +use pretty_assertions::assert_eq; use crate::wallet::common::{create_accounts_with_funds, make_wallet, setup, tear_down}; diff --git a/sdk/tests/wallet/output_preparation.rs b/sdk/tests/wallet/output_preparation.rs index 7037eaffa9..4c1bd5a53f 100644 --- a/sdk/tests/wallet/output_preparation.rs +++ b/sdk/tests/wallet/output_preparation.rs @@ -13,6 +13,7 @@ use iota_sdk::{ MintNftParams, Result, }, }; +use pretty_assertions::assert_eq; use crate::wallet::common::{create_accounts_with_funds, make_wallet, setup, tear_down}; diff --git a/sdk/tests/wallet/syncing.rs b/sdk/tests/wallet/syncing.rs index 8b83721f0c..1743e992f6 100644 --- a/sdk/tests/wallet/syncing.rs +++ b/sdk/tests/wallet/syncing.rs @@ -11,6 +11,7 @@ use iota_sdk::{ }, wallet::{account::SyncOptions, Result}, }; +use pretty_assertions::assert_eq; use crate::wallet::common::{create_accounts_with_funds, make_wallet, setup, tear_down}; diff --git a/sdk/tests/wallet/transactions.rs b/sdk/tests/wallet/transactions.rs index 14952185fa..ccadd4c953 100644 --- a/sdk/tests/wallet/transactions.rs +++ b/sdk/tests/wallet/transactions.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use iota_sdk::wallet::{account::TransactionOptions, MintNftParams, Result, SendNftParams, SendParams}; +use pretty_assertions::assert_eq; use crate::wallet::common::{create_accounts_with_funds, make_wallet, setup, tear_down}; diff --git a/sdk/tests/wallet/wallet_storage.rs b/sdk/tests/wallet/wallet_storage.rs index b491345913..82a0e863f2 100644 --- a/sdk/tests/wallet/wallet_storage.rs +++ b/sdk/tests/wallet/wallet_storage.rs @@ -6,6 +6,7 @@ use std::{fs, io, path::Path}; #[cfg(feature = "stronghold")] use iota_sdk::client::stronghold::StrongholdAdapter; use iota_sdk::{wallet::Result, Wallet}; +use pretty_assertions::assert_eq; use crate::wallet::common::{setup, tear_down}; From 06d8d6f2acdd150b436181b448bead32dac6643a Mon Sep 17 00:00:00 2001 From: DaughterOfMars Date: Wed, 18 Oct 2023 10:45:23 -0400 Subject: [PATCH 2/2] Update bindings/core/src/method/secret_manager.rs Co-authored-by: Thibault Martinez --- bindings/core/src/method/secret_manager.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/bindings/core/src/method/secret_manager.rs b/bindings/core/src/method/secret_manager.rs index 7bb25e9a7c..c52b32fcee 100644 --- a/bindings/core/src/method/secret_manager.rs +++ b/bindings/core/src/method/secret_manager.rs @@ -74,6 +74,7 @@ pub enum SecretManagerMethod { #[cfg(test)] mod test { use pretty_assertions::assert_eq; + #[test] fn bip44_deserialization() { let signature_unlock_method: super::SecretManagerMethod = serde_json::from_str(