Skip to content

Commit b2ff339

Browse files
committed
drop no-std supp for key-wallet
1 parent 665bb7b commit b2ff339

46 files changed

Lines changed: 43 additions & 139 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

key-wallet-ffi/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ eddsa = ["dashcore/eddsa", "key-wallet/eddsa"]
2020
bls = ["dashcore/bls", "key-wallet/bls"]
2121

2222
[dependencies]
23-
key-wallet = { path = "../key-wallet", default-features = false, features = ["std"] }
23+
key-wallet = { path = "../key-wallet" }
2424
key-wallet-manager = { path = "../key-wallet-manager", features = ["std"] }
2525
dashcore = { path = "../dash" }
2626
secp256k1 = { version = "0.30.0", features = ["global-context"] }
@@ -32,6 +32,6 @@ hex = "0.4"
3232
cbindgen = "0.29"
3333

3434
[dev-dependencies]
35-
key-wallet = { path = "../key-wallet", default-features = false, features = ["std", "test-utils"] }
35+
key-wallet = { path = "../key-wallet", features = ["test-utils"] }
3636
tempfile = "3.0"
3737
hex = "0.4"

key-wallet-manager/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ license = "CC0-1.0"
1010

1111
[features]
1212
default = ["std", "bincode"]
13-
std = ["key-wallet/std", "secp256k1/std"]
13+
std = ["secp256k1/std"]
1414
serde = ["dep:serde", "key-wallet/serde", "dashcore/serde"]
1515
getrandom = ["key-wallet/getrandom"]
1616
bincode = ["dep:bincode", "key-wallet/bincode"]
1717
test-utils = []
1818

1919
[dependencies]
20-
key-wallet = { path = "../key-wallet", default-features = false }
20+
key-wallet = { path = "../key-wallet" }
2121
dashcore = { path = "../dash" }
2222
dashcore_hashes = { path = "../hashes" }
2323
secp256k1 = { version = "0.30.0", default-features = false, features = ["recovery"] }

key-wallet-manager/src/wallet_manager/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ mod matching;
88
mod process_block;
99

1010
pub use crate::wallet_manager::matching::{check_compact_filters_for_addresses, FilterMatchKey};
11-
use alloc::collections::BTreeMap;
1211
use alloc::string::String;
1312
use alloc::vec::Vec;
1413
use dashcore::blockdata::transaction::Transaction;
@@ -22,7 +21,7 @@ use key_wallet::wallet::WalletType;
2221
use key_wallet::Utxo;
2322
use key_wallet::{Account, AccountType, Address, ExtendedPrivKey, Mnemonic, Network, Wallet};
2423
use key_wallet::{ExtendedPubKey, WalletCoreBalance};
25-
use std::collections::BTreeSet;
24+
use std::collections::{BTreeMap, BTreeSet};
2625
use std::str::FromStr;
2726
use zeroize::Zeroize;
2827

key-wallet-manager/src/wallet_manager/process_block.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use dashcore::{Address, Block, Transaction};
1010
use key_wallet::transaction_checking::transaction_router::TransactionRouter;
1111
use key_wallet::transaction_checking::TransactionContext;
1212
use key_wallet::wallet::managed_wallet_info::wallet_info_interface::WalletInfoInterface;
13+
use std::collections::BTreeSet;
1314
use tokio::sync::broadcast;
1415

1516
#[async_trait]
@@ -92,7 +93,7 @@ impl<T: WalletInfoInterface + Send + Sync + 'static> WalletInterface for WalletM
9293

9394
if is_relevant_any {
9495
// Deduplicate addresses while preserving order
95-
let mut seen = alloc::collections::BTreeSet::new();
96+
let mut seen = BTreeSet::new();
9697
addresses.retain(|a| seen.insert(a.clone()));
9798
let net = (total_received as i64) - (total_sent as i64);
9899
Some((net, addresses))

key-wallet/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ readme = "README.md"
99
license = "CC0-1.0"
1010

1111
[features]
12-
default = ["std"]
13-
std = ["secp256k1/std", "bip39/std", "getrandom", "rand"]
12+
default = ["secp256k1/std", "bip39/std", "getrandom", "rand"]
1413
serde = ["dep:serde", "dep:serde_json", "dashcore_hashes/serde", "secp256k1/serde", "dashcore/serde"]
1514
bincode = ["serde", "dep:bincode", "dep:bincode_derive", "dashcore_hashes/bincode", "dashcore/bincode"]
1615
bip38 = ["scrypt", "aes", "bs58", "rand"]

key-wallet/src/account/account_collection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
//!
33
//! This module provides a structured way to manage accounts by type.
44
5-
use alloc::collections::BTreeMap;
6-
use alloc::vec::Vec;
5+
use std::collections::BTreeMap;
6+
77
#[cfg(feature = "bincode")]
88
use bincode_derive::{Decode, Encode};
99
#[cfg(feature = "serde")]

key-wallet/src/account/account_trait.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use crate::bip32::DerivationPath;
77
use crate::dip9::DerivationPathReference;
88
use crate::error::Result;
99
use crate::Network;
10-
use alloc::vec::Vec;
1110

1211
/// Common trait for all account types
1312
pub trait AccountTrait {

key-wallet/src/account/bls_account.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use crate::derivation_bls_bip32::{ExtendedBLSPrivKey, ExtendedBLSPubKey};
99
use crate::error::{Error, Result};
1010
use crate::managed_account::address_pool::AddressPoolType;
1111
use crate::{ChildNumber, DerivationPath, Network};
12-
use alloc::vec::Vec;
1312
use core::fmt;
1413
use dashcore::Address;
1514

key-wallet/src/account/eddsa_account.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use crate::account::AccountType;
88
use crate::derivation_slip10::{ExtendedEd25519PrivKey, ExtendedEd25519PubKey, VerifyingKey};
99
use crate::error::{Error, Result};
1010
use crate::{ChildNumber, DerivationPath, Network};
11-
use alloc::vec::Vec;
1211
use core::fmt;
1312
use dashcore::Address;
1413

key-wallet/src/bip32.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use core::default::Default;
2525
use core::fmt;
2626
use core::ops::Index;
2727
use core::str::FromStr;
28-
#[cfg(feature = "std")]
2928
use std::error;
3029

3130
use dashcore_hashes::{hash160, sha512, Hash, HashEngine, Hmac, HmacEngine};
@@ -42,7 +41,6 @@ use crate::dip9::{
4241
IDENTITY_REGISTRATION_PATH_MAINNET, IDENTITY_REGISTRATION_PATH_TESTNET,
4342
IDENTITY_TOPUP_PATH_MAINNET, IDENTITY_TOPUP_PATH_TESTNET,
4443
};
45-
use alloc::{string::String, vec::Vec};
4644
use base58ck;
4745
#[cfg(feature = "bincode")]
4846
use bincode_derive::{Decode, Encode};
@@ -343,7 +341,6 @@ impl<'de> serde::Deserialize<'de> for Fingerprint {
343341

344342
/// Extended private key
345343
#[derive(Copy, Clone, PartialEq, Eq)]
346-
#[cfg_attr(feature = "std", derive(Debug))]
347344
pub struct ExtendedPrivKey {
348345
/// The network this key is to be used on
349346
pub network: Network,
@@ -451,8 +448,6 @@ impl<'de> serde::Deserialize<'de> for ExtendedPrivKey {
451448
}
452449
}
453450

454-
#[cfg(not(feature = "std"))]
455-
#[cfg_attr(docsrs, doc(cfg(not(feature = "std"))))]
456451
impl fmt::Debug for ExtendedPrivKey {
457452
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
458453
f.debug_struct("ExtendedPrivKey")
@@ -1474,7 +1469,6 @@ impl fmt::Display for Error {
14741469
}
14751470
}
14761471

1477-
#[cfg(feature = "std")]
14781472
impl error::Error for Error {
14791473
fn cause(&self) -> Option<&dyn error::Error> {
14801474
if let Error::Secp256k1(ref e) = *self {

0 commit comments

Comments
 (0)