Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Coats committed Feb 9, 2024
1 parent 44c3c4d commit b79e361
Show file tree
Hide file tree
Showing 37 changed files with 67 additions and 99 deletions.
2 changes: 1 addition & 1 deletion sdk/examples/client/node_api_core/05_post_block_raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crypto::keys::bip44::Bip44;
use iota_sdk::{
client::{
constants::IOTA_COIN_TYPE,
secret::{mnemonic::MnemonicSecretManager, BlockSignExt, SecretManager},
secret::{mnemonic::MnemonicSecretManager, BlockSignExt},
Client, Result,
},
types::block::output::AccountId,
Expand Down
4 changes: 2 additions & 2 deletions sdk/examples/how_tos/account/implicit_account_creation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
use iota_sdk::{
client::{
constants::SHIMMER_COIN_TYPE,
secret::{mnemonic::MnemonicSecretManager, PublicKeyOptions, SecretManager},
secret::{mnemonic::MnemonicSecretManager, PublicKeyOptions},
},
crypto::keys::bip44::Bip44,
wallet::{ClientOptions, Result, Wallet, WalletBuilder},
wallet::{ClientOptions, Result, WalletBuilder},
};

#[tokio::main]
Expand Down
5 changes: 1 addition & 4 deletions sdk/examples/how_tos/account_wallet/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
//! `cargo run --release --all-features --example account_wallet_transaction`

use iota_sdk::{
client::{
node_api::indexer::query_parameters::BasicOutputQueryParameters,
secret::{stronghold::StrongholdSecretManager, SecretManager},
},
client::{node_api::indexer::query_parameters::BasicOutputQueryParameters, secret::SecretManager},
types::block::address::{AccountAddress, ToBech32Ext},
wallet::{AccountSyncOptions, Result, SyncOptions, TransactionOptions},
Wallet,
Expand Down
4 changes: 2 additions & 2 deletions sdk/examples/how_tos/accounts_and_addresses/create_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
use iota_sdk::{
client::{
constants::SHIMMER_COIN_TYPE,
secret::{stronghold::StrongholdSecretManager, PublicKeyOptions, SecretManager},
secret::{stronghold::StrongholdSecretManager, PublicKeyOptions},
},
crypto::keys::{bip39::Mnemonic, bip44::Bip44},
wallet::{ClientOptions, Result, Wallet, WalletBuilder},
wallet::{ClientOptions, Result, WalletBuilder},
};

#[tokio::main]
Expand Down
2 changes: 1 addition & 1 deletion sdk/examples/how_tos/nft_collection/00_mint_issuer_nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//! ```

use iota_sdk::{
client::secret::{stronghold::StrongholdSecretManager, SecretManager},
client::secret::SecretManager,
types::block::{
output::{feature::MetadataFeature, NftId, Output, OutputId},
payload::signed_transaction::TransactionId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use iota_sdk::{
client::{
constants::SHIMMER_COIN_TYPE,
hex_public_key_to_bech32_address,
secret::{stronghold::StrongholdSecretManager, SecretManage, SecretManageExt, SecretManager},
secret::{stronghold::StrongholdSecretManager, SecretManageExt},
},
crypto::keys::bip39::Mnemonic,
types::block::signature::Ed25519Signature,
Expand Down
2 changes: 0 additions & 2 deletions sdk/src/wallet/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,12 +600,10 @@ impl<S: SecretManage> OptionalSecretManager<S> for Wallet<SecretData<S>> {
mod test {
use core::str::FromStr;

use crypto::keys::bip44::Bip44;
use pretty_assertions::assert_eq;

use super::*;
use crate::{
client::secret::{mnemonic::MnemonicSecretManager, PublicKeyOptions},
types::block::{
address::{Address, Ed25519Address},
input::{Input, UtxoInput},
Expand Down
5 changes: 1 addition & 4 deletions sdk/src/wallet/core/operations/background_syncing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ use std::time::Duration;

use tokio::time::timeout;

use crate::{
client::secret::SecretManage,
wallet::{operations::syncing::SyncOptions, task, Wallet},
};
use crate::wallet::{operations::syncing::SyncOptions, task, Wallet};

/// The default interval for background syncing
pub(crate) const DEFAULT_BACKGROUNDSYNCING_INTERVAL: Duration = Duration::from_secs(7);
Expand Down
1 change: 0 additions & 1 deletion sdk/src/wallet/operations/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use primitive_types::U256;

use crate::{
client::secret::SecretManage,
types::block::output::{
unlock_condition::UnlockCondition, DecayedMana, FoundryId, MinimumOutputAmount, NativeTokensBuilder, Output,
},
Expand Down
7 changes: 2 additions & 5 deletions sdk/src/wallet/operations/output_claiming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ use std::collections::HashSet;
use serde::{Deserialize, Serialize};

use crate::{
client::{
api::PreparedTransactionData,
secret::{SecretManage, Sign},
},
client::{api::PreparedTransactionData, secret::SecretManage},
types::block::{
address::{Address, Ed25519Address},
output::{
Expand Down Expand Up @@ -188,7 +185,7 @@ impl<T> Wallet<T> {
}
}

impl<S: SecretManage> Wallet<SecretData<S>> {
impl<S: SecretManage + 'static> Wallet<SecretData<S>> {
/// Try to claim basic or nft outputs that have additional unlock conditions to their [AddressUnlockCondition]
/// from [`Wallet::claimable_outputs()`].
pub async fn claim_outputs<I: IntoIterator<Item = OutputId> + Send>(
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/wallet/operations/participation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::collections::HashMap;
use serde::{Deserialize, Serialize};

use crate::{
client::{node_manager::node::Node, secret::SecretManage},
client::node_manager::node::Node,
types::{
api::plugins::participation::{
responses::TrackedParticipation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
use std::collections::HashSet;

use crate::{
client::{
node_api::indexer::query_parameters::{AccountOutputQueryParameters, FoundryOutputQueryParameters},
secret::SecretManage,
},
client::node_api::indexer::query_parameters::{AccountOutputQueryParameters, FoundryOutputQueryParameters},
types::{
api::plugins::indexer::OutputIdsResponse,
block::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

use crate::{
client::{node_api::indexer::query_parameters::BasicOutputQueryParameters, secret::SecretManage},
client::node_api::indexer::query_parameters::BasicOutputQueryParameters,
types::block::{address::Bech32Address, output::OutputId},
utils::ConvertTo,
wallet::Wallet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

use crate::{
client::{node_api::indexer::query_parameters::NftOutputQueryParameters, secret::SecretManage},
client::node_api::indexer::query_parameters::NftOutputQueryParameters,
types::block::{address::Bech32Address, output::OutputId},
utils::ConvertTo,
wallet::Wallet,
Expand Down
1 change: 0 additions & 1 deletion sdk/src/wallet/operations/syncing/foundries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use std::collections::HashSet;

use crate::{
client::secret::SecretManage,
types::block::output::{FoundryId, Output},
wallet::{task, Wallet},
};
Expand Down
1 change: 0 additions & 1 deletion sdk/src/wallet/operations/syncing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use std::collections::{HashMap, HashSet};

pub use self::options::SyncOptions;
use crate::{
client::secret::SecretManage,
types::block::{
address::{AccountAddress, Address, Bech32Address, NftAddress},
output::{FoundryId, Output, OutputId, OutputMetadata},
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/wallet/operations/syncing/outputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use instant::Instant;

use crate::{
client::{secret::SecretManage, Client, Error as ClientError},
client::{Client, Error as ClientError},
types::{
api::core::OutputWithMetadataResponse,
block::{
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/wallet/operations/syncing/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

use crate::{
client::{secret::SecretManage, unix_timestamp_now},
client::unix_timestamp_now,
types::{
api::core::TransactionState,
block::{input::Input, output::OutputId, BlockId},
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/wallet/operations/transaction/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::{
},
};

impl<S: SecretManage> Wallet<SecretData<S>> {
impl<S: SecretManage + 'static> Wallet<SecretData<S>> {
/// Transitions an implicit account to an account.
pub async fn implicit_account_transition(
&self,
Expand Down
5 changes: 1 addition & 4 deletions sdk/src/wallet/operations/transaction/build_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ use std::collections::HashSet;
use instant::Instant;

use crate::{
client::{
api::{input_selection::Selected, transaction::validate_transaction_length, PreparedTransactionData},
secret::SecretManage,
},
client::api::{input_selection::Selected, transaction::validate_transaction_length, PreparedTransactionData},
types::block::{
context_input::{BlockIssuanceCreditContextInput, CommitmentContextInput, ContextInput, RewardContextInput},
input::{Input, UtxoInput},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{
},
};

impl<S: SecretManage> Wallet<SecretData<S>> {
impl<S: SecretManage + 'static> Wallet<SecretData<S>> {
pub async fn allot_mana(
&self,
allotments: impl IntoIterator<Item = impl Into<ManaAllotment>> + Send,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::{
},
};

impl<S: SecretManage> Wallet<SecretData<S>> {
impl<S: SecretManage + 'static> Wallet<SecretData<S>> {
/// Melts native tokens.
///
/// This happens with the foundry output which minted them, by increasing it's
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{

pub(crate) mod melt_native_token;

impl<S: SecretManage> Wallet<SecretData<S>> {
impl<S: SecretManage + 'static> Wallet<SecretData<S>> {
/// A generic function that can be used to burn native tokens, nfts, delegations, foundries and accounts.
///
/// Note that burning **native tokens** doesn't require the foundry output which minted them, but will not increase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub struct CreateAccountParams {
pub metadata: Option<MetadataFeature>,
}

impl<S: SecretManage> Wallet<SecretData<S>> {
impl<S: SecretManage + 'static> Wallet<SecretData<S>> {
/// Creates an account output.
/// ```ignore
/// let params = CreateAccountParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub struct PreparedCreateNativeTokenTransaction {
pub transaction: PreparedTransactionData,
}

impl<S: SecretManage> Wallet<SecretData<S>> {
impl<S: SecretManage + 'static> Wallet<SecretData<S>> {
/// Creates a new foundry output with minted native tokens.
///
/// Calls [Wallet::send_outputs()] internally, the options may define the remainder value strategy or custom inputs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
},
};

impl<S: SecretManage> Wallet<SecretData<S>> {
impl<S: SecretManage + 'static> Wallet<SecretData<S>> {
/// Mints additional native tokens.
///
/// The max supply must not be reached yet. The foundry needs to be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl MintNftParams {
}
}

impl<S: SecretManage> Wallet<SecretData<S>> {
impl<S: SecretManage + 'static> Wallet<SecretData<S>> {
/// Mints NFTs.
///
/// Calls [Wallet::send_outputs()] internally. The options may define the remainder value strategy or custom inputs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/wallet/operations/transaction/high_level/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl SendParams {
}
}

impl<S: SecretManage> Wallet<SecretData<S>> {
impl<S: SecretManage + 'static> Wallet<SecretData<S>> {
/// Sends a certain amount of base coins to a single address.
///
/// Calls [Wallet::send_with_params()] internally.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl SendNativeTokenParams {
}
}

impl<S: SecretManage> Wallet<SecretData<S>> {
impl<S: SecretManage + 'static> Wallet<SecretData<S>> {
/// Sends native tokens in basic outputs with a
/// [`StorageDepositReturnUnlockCondition`](crate::types::block::output::unlock_condition::StorageDepositReturnUnlockCondition)
/// and an [`ExpirationUnlockCondition`], so that the storage deposit is returned to the sender and the sender
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl SendNftParams {
}
}

impl<S: SecretManage> Wallet<SecretData<S>> {
impl<S: SecretManage + 'static> Wallet<SecretData<S>> {
/// Sends native tokens in basic outputs with a
/// [`StorageDepositReturnUnlockCondition`](crate::types::block::output::unlock_condition::StorageDepositReturnUnlockCondition) and an
/// [`ExpirationUnlockCondition`](crate::types::block::output::unlock_condition::ExpirationUnlockCondition), so that
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/wallet/operations/transaction/input_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::wallet::events::types::{TransactionProgressEvent, WalletEvent};
use crate::{
client::{
api::input_selection::{Burn, InputSelection, Selected},
secret::{types::InputSigningData, SecretManage},
secret::types::InputSigningData,
},
types::block::{
address::Address,
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/wallet/operations/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use crate::{
},
};

impl<S: SecretManage> Wallet<SecretData<S>> {
impl<S: SecretManage + 'static> Wallet<SecretData<S>> {
/// Sends a transaction by specifying its outputs.
///
/// Note that, if sending a block fails, the method will return `None` for the block id, but the wallet
Expand Down
1 change: 0 additions & 1 deletion sdk/src/wallet/operations/transaction/prepare_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use serde::{Deserialize, Serialize};

use crate::{
client::secret::SecretManage,
types::block::{
address::{Address, Bech32Address, Ed25519Address},
output::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use instant::Instant;
use packable::bounded::TryIntoBoundedU16Error;

use crate::{
client::{api::PreparedTransactionData, secret::SecretManage},
client::api::PreparedTransactionData,
types::block::{input::INPUT_COUNT_RANGE, output::Output},
wallet::{
operations::transaction::{RemainderValueStrategy, TransactionOptions},
Expand Down
Loading

0 comments on commit b79e361

Please sign in to comment.