diff --git a/sdk/src/types/block/output/account.rs b/sdk/src/types/block/output/account.rs index 3dee4b05f3..e389d899c8 100644 --- a/sdk/src/types/block/output/account.rs +++ b/sdk/src/types/block/output/account.rs @@ -1,7 +1,7 @@ // Copyright 2021 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use alloc::{collections::BTreeSet, vec::Vec}; +use alloc::collections::BTreeSet; use hashbrown::HashMap; use packable::{ @@ -11,24 +11,19 @@ use packable::{ Packable, }; -use crate::types::{ - block::{ - address::{AccountAddress, Address}, - output::{ - feature::{verify_allowed_features, Feature, FeatureFlags, Features}, - unlock_condition::{ - verify_allowed_unlock_conditions, UnlockCondition, UnlockConditionFlags, UnlockConditions, - }, - verify_output_amount_min, verify_output_amount_packable, ChainId, NativeToken, NativeTokens, Output, - OutputBuilderAmount, OutputId, Rent, RentStructure, StateTransitionError, StateTransitionVerifier, - }, - payload::signed_transaction::TransactionCapabilityFlag, - protocol::ProtocolParameters, - semantic::{SemanticValidationContext, TransactionFailureReason}, - unlock::Unlock, - Error, +use crate::types::block::{ + address::{AccountAddress, Address}, + output::{ + feature::{verify_allowed_features, Feature, FeatureFlags, Features}, + unlock_condition::{verify_allowed_unlock_conditions, UnlockCondition, UnlockConditionFlags, UnlockConditions}, + verify_output_amount_min, verify_output_amount_packable, ChainId, NativeToken, NativeTokens, Output, + OutputBuilderAmount, OutputId, Rent, RentStructure, StateTransitionError, StateTransitionVerifier, }, - ValidationParams, + payload::signed_transaction::TransactionCapabilityFlag, + protocol::ProtocolParameters, + semantic::{SemanticValidationContext, TransactionFailureReason}, + unlock::Unlock, + Error, }; crate::impl_id!( @@ -623,13 +618,15 @@ fn verify_unlock_conditions(unlock_conditions: &UnlockConditions, account_id: &A #[cfg(feature = "serde")] pub(crate) mod dto { + use alloc::vec::Vec; + use serde::{Deserialize, Serialize}; use super::*; use crate::{ types::{ block::{output::unlock_condition::dto::UnlockConditionDto, Error}, - TryFromDto, + TryFromDto, ValidationParams, }, utils::serde::string, }; diff --git a/sdk/src/types/block/output/anchor.rs b/sdk/src/types/block/output/anchor.rs index 8dccff6276..e6d5c03e8d 100644 --- a/sdk/src/types/block/output/anchor.rs +++ b/sdk/src/types/block/output/anchor.rs @@ -13,24 +13,19 @@ use packable::{ Packable, }; -use crate::types::{ - block::{ - address::{Address, AnchorAddress}, - output::{ - feature::{verify_allowed_features, Feature, FeatureFlags, Features}, - unlock_condition::{ - verify_allowed_unlock_conditions, UnlockCondition, UnlockConditionFlags, UnlockConditions, - }, - verify_output_amount_min, verify_output_amount_packable, ChainId, NativeToken, NativeTokens, Output, - OutputBuilderAmount, OutputId, Rent, RentStructure, StateTransitionError, StateTransitionVerifier, - }, - payload::signed_transaction::TransactionCapabilityFlag, - protocol::ProtocolParameters, - semantic::{SemanticValidationContext, TransactionFailureReason}, - unlock::Unlock, - Error, +use crate::types::block::{ + address::{Address, AnchorAddress}, + output::{ + feature::{verify_allowed_features, Feature, FeatureFlags, Features}, + unlock_condition::{verify_allowed_unlock_conditions, UnlockCondition, UnlockConditionFlags, UnlockConditions}, + verify_output_amount_min, verify_output_amount_packable, ChainId, NativeToken, NativeTokens, Output, + OutputBuilderAmount, OutputId, Rent, RentStructure, StateTransitionError, StateTransitionVerifier, }, - ValidationParams, + payload::signed_transaction::TransactionCapabilityFlag, + protocol::ProtocolParameters, + semantic::{SemanticValidationContext, TransactionFailureReason}, + unlock::Unlock, + Error, }; crate::impl_id!( @@ -711,7 +706,7 @@ pub(crate) mod dto { use crate::{ types::{ block::{output::unlock_condition::dto::UnlockConditionDto, Error}, - TryFromDto, + TryFromDto, ValidationParams, }, utils::serde::{prefix_hex_bytes, string}, }; diff --git a/sdk/src/types/block/output/basic.rs b/sdk/src/types/block/output/basic.rs index 7b99c1c574..9b104a4022 100644 --- a/sdk/src/types/block/output/basic.rs +++ b/sdk/src/types/block/output/basic.rs @@ -5,23 +5,18 @@ use alloc::collections::BTreeSet; use packable::Packable; -use crate::types::{ - block::{ - address::Address, - output::{ - feature::{verify_allowed_features, Feature, FeatureFlags, Features}, - unlock_condition::{ - verify_allowed_unlock_conditions, UnlockCondition, UnlockConditionFlags, UnlockConditions, - }, - verify_output_amount_min, verify_output_amount_packable, NativeToken, NativeTokens, Output, - OutputBuilderAmount, OutputId, Rent, RentStructure, - }, - protocol::ProtocolParameters, - semantic::{SemanticValidationContext, TransactionFailureReason}, - unlock::Unlock, - Error, +use crate::types::block::{ + address::Address, + output::{ + feature::{verify_allowed_features, Feature, FeatureFlags, Features}, + unlock_condition::{verify_allowed_unlock_conditions, UnlockCondition, UnlockConditionFlags, UnlockConditions}, + verify_output_amount_min, verify_output_amount_packable, NativeToken, NativeTokens, Output, + OutputBuilderAmount, OutputId, Rent, RentStructure, }, - ValidationParams, + protocol::ProtocolParameters, + semantic::{SemanticValidationContext, TransactionFailureReason}, + unlock::Unlock, + Error, }; /// Builder for a [`BasicOutput`]. @@ -361,7 +356,7 @@ pub(crate) mod dto { use crate::{ types::{ block::{output::unlock_condition::dto::UnlockConditionDto, Error}, - TryFromDto, + TryFromDto, ValidationParams, }, utils::serde::string, }; diff --git a/sdk/src/types/block/output/delegation.rs b/sdk/src/types/block/output/delegation.rs index 0097d54dc4..1562a35169 100644 --- a/sdk/src/types/block/output/delegation.rs +++ b/sdk/src/types/block/output/delegation.rs @@ -5,24 +5,19 @@ use alloc::collections::BTreeSet; use packable::Packable; -use crate::types::{ - block::{ - address::{AccountAddress, Address}, - output::{ - chain_id::ChainId, - unlock_condition::{ - verify_allowed_unlock_conditions, UnlockCondition, UnlockConditionFlags, UnlockConditions, - }, - verify_output_amount_min, verify_output_amount_packable, Output, OutputBuilderAmount, OutputId, Rent, - RentStructure, StateTransitionError, StateTransitionVerifier, - }, - protocol::ProtocolParameters, - semantic::{SemanticValidationContext, TransactionFailureReason}, - slot::EpochIndex, - unlock::Unlock, - Error, +use crate::types::block::{ + address::{AccountAddress, Address}, + output::{ + chain_id::ChainId, + unlock_condition::{verify_allowed_unlock_conditions, UnlockCondition, UnlockConditionFlags, UnlockConditions}, + verify_output_amount_min, verify_output_amount_packable, Output, OutputBuilderAmount, OutputId, Rent, + RentStructure, StateTransitionError, StateTransitionVerifier, }, - ValidationParams, + protocol::ProtocolParameters, + semantic::{SemanticValidationContext, TransactionFailureReason}, + slot::EpochIndex, + unlock::Unlock, + Error, }; crate::impl_id!( @@ -442,7 +437,7 @@ pub(crate) mod dto { output::{unlock_condition::dto::UnlockConditionDto, OutputBuilderAmount}, Error, }, - TryFromDto, + TryFromDto, ValidationParams, }, utils::serde::string, }; diff --git a/sdk/src/types/block/output/foundry.rs b/sdk/src/types/block/output/foundry.rs index f979bc1a5d..f918872ca5 100644 --- a/sdk/src/types/block/output/foundry.rs +++ b/sdk/src/types/block/output/foundry.rs @@ -12,26 +12,21 @@ use packable::{ }; use primitive_types::U256; -use crate::types::{ - block::{ - address::{AccountAddress, Address}, - output::{ - account::AccountId, - feature::{verify_allowed_features, Feature, FeatureFlags, Features}, - unlock_condition::{ - verify_allowed_unlock_conditions, UnlockCondition, UnlockConditionFlags, UnlockConditions, - }, - verify_output_amount_min, verify_output_amount_packable, ChainId, NativeToken, NativeTokens, Output, - OutputBuilderAmount, OutputId, Rent, RentStructure, StateTransitionError, StateTransitionVerifier, TokenId, - TokenScheme, - }, - payload::signed_transaction::{TransactionCapabilities, TransactionCapabilityFlag}, - protocol::ProtocolParameters, - semantic::{SemanticValidationContext, TransactionFailureReason}, - unlock::Unlock, - Error, +use crate::types::block::{ + address::{AccountAddress, Address}, + output::{ + account::AccountId, + feature::{verify_allowed_features, Feature, FeatureFlags, Features}, + unlock_condition::{verify_allowed_unlock_conditions, UnlockCondition, UnlockConditionFlags, UnlockConditions}, + verify_output_amount_min, verify_output_amount_packable, ChainId, NativeToken, NativeTokens, Output, + OutputBuilderAmount, OutputId, Rent, RentStructure, StateTransitionError, StateTransitionVerifier, TokenId, + TokenScheme, }, - ValidationParams, + payload::signed_transaction::{TransactionCapabilities, TransactionCapabilityFlag}, + protocol::ProtocolParameters, + semantic::{SemanticValidationContext, TransactionFailureReason}, + unlock::Unlock, + Error, }; crate::impl_id!( @@ -679,7 +674,7 @@ pub(crate) mod dto { use crate::{ types::{ block::{output::unlock_condition::dto::UnlockConditionDto, Error}, - TryFromDto, + TryFromDto, ValidationParams, }, utils::serde::string, }; diff --git a/sdk/src/types/block/output/nft.rs b/sdk/src/types/block/output/nft.rs index 28c32ff138..599d451d07 100644 --- a/sdk/src/types/block/output/nft.rs +++ b/sdk/src/types/block/output/nft.rs @@ -10,24 +10,19 @@ use packable::{ Packable, }; -use crate::types::{ - block::{ - address::{Address, NftAddress}, - output::{ - feature::{verify_allowed_features, Feature, FeatureFlags, Features}, - unlock_condition::{ - verify_allowed_unlock_conditions, UnlockCondition, UnlockConditionFlags, UnlockConditions, - }, - verify_output_amount_min, verify_output_amount_packable, ChainId, NativeToken, NativeTokens, Output, - OutputBuilderAmount, OutputId, Rent, RentStructure, StateTransitionError, StateTransitionVerifier, - }, - payload::signed_transaction::TransactionCapabilityFlag, - protocol::ProtocolParameters, - semantic::{SemanticValidationContext, TransactionFailureReason}, - unlock::Unlock, - Error, +use crate::types::block::{ + address::{Address, NftAddress}, + output::{ + feature::{verify_allowed_features, Feature, FeatureFlags, Features}, + unlock_condition::{verify_allowed_unlock_conditions, UnlockCondition, UnlockConditionFlags, UnlockConditions}, + verify_output_amount_min, verify_output_amount_packable, ChainId, NativeToken, NativeTokens, Output, + OutputBuilderAmount, OutputId, Rent, RentStructure, StateTransitionError, StateTransitionVerifier, }, - ValidationParams, + payload::signed_transaction::TransactionCapabilityFlag, + protocol::ProtocolParameters, + semantic::{SemanticValidationContext, TransactionFailureReason}, + unlock::Unlock, + Error, }; crate::impl_id!( @@ -541,7 +536,7 @@ pub(crate) mod dto { use crate::{ types::{ block::{output::unlock_condition::dto::UnlockConditionDto, Error}, - TryFromDto, + TryFromDto, ValidationParams, }, utils::serde::string, }; diff --git a/sdk/src/types/block/unlock/account.rs b/sdk/src/types/block/unlock/account.rs index 25ade32fcd..f8f7872ac3 100644 --- a/sdk/src/types/block/unlock/account.rs +++ b/sdk/src/types/block/unlock/account.rs @@ -36,6 +36,7 @@ impl AccountUnlock { } } +#[cfg(feature = "serde")] mod dto { use serde::{Deserialize, Serialize}; diff --git a/sdk/src/types/block/unlock/anchor.rs b/sdk/src/types/block/unlock/anchor.rs index cc9f6d9e64..aad3c49b78 100644 --- a/sdk/src/types/block/unlock/anchor.rs +++ b/sdk/src/types/block/unlock/anchor.rs @@ -36,6 +36,7 @@ impl AnchorUnlock { } } +#[cfg(feature = "serde")] mod dto { use serde::{Deserialize, Serialize}; diff --git a/sdk/src/types/block/unlock/empty.rs b/sdk/src/types/block/unlock/empty.rs index a4b89ff15a..2449e7668f 100644 --- a/sdk/src/types/block/unlock/empty.rs +++ b/sdk/src/types/block/unlock/empty.rs @@ -11,6 +11,7 @@ impl EmptyUnlock { pub const KIND: u8 = 6; } +#[cfg(feature = "serde")] mod dto { use serde::{Deserialize, Serialize}; diff --git a/sdk/src/types/block/unlock/multi.rs b/sdk/src/types/block/unlock/multi.rs index 024a9d8c88..99a2f2f0fd 100644 --- a/sdk/src/types/block/unlock/multi.rs +++ b/sdk/src/types/block/unlock/multi.rs @@ -1,7 +1,7 @@ // Copyright 2023 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use alloc::{boxed::Box, vec::Vec}; +use alloc::boxed::Box; use derive_more::Deref; use packable::{prefix::BoxedSlicePrefix, Packable}; @@ -46,7 +46,10 @@ fn verify_unlocks(unlocks: &[Unlock], _visitor: &()) -> Resu } } +#[cfg(feature = "serde")] mod dto { + use alloc::vec::Vec; + use serde::{Deserialize, Serialize}; use super::*;