Skip to content

Commit 3335954

Browse files
fix(key-wallet): satisfy CI rustfmt + drop rustdoc link to private item
- Drop the `[`Self::record_transaction`]` link from the `ManagedCoreFundsAccount` doc comment; `record_transaction` is `pub(crate)` and rustdoc with `-D warnings` rejects intra-doc links from a public item to a private one. - `cargo fmt --all` to fix import ordering (placement of the new `ManagedAccountTrait` use lines) and a long-line wrap in `account_checker.rs`. Tests + clippy still clean locally.
1 parent 6797dc8 commit 3335954

10 files changed

Lines changed: 19 additions & 14 deletions

File tree

dash-spv/tests/dashd_sync/helpers.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ pub(super) async fn count_wallet_transactions(
6363
) -> usize {
6464
let wallet_read = wallet.read().await;
6565
let wallet_info = wallet_read.get_wallet_info(wallet_id).expect("Wallet info not found");
66-
let txids: HashSet<_> =
67-
wallet_info.accounts().all_accounts().iter().flat_map(|a| a.transactions().keys()).collect();
66+
let txids: HashSet<_> = wallet_info
67+
.accounts()
68+
.all_accounts()
69+
.iter()
70+
.flat_map(|a| a.transactions().keys())
71+
.collect();
6872
txids.len()
6973
}
7074

key-wallet-ffi/src/address_pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ use crate::types::{FFIAccountKind, FFIWallet};
1212
use crate::utils::rust_string_to_c;
1313
use crate::{check_ptr, deref_ptr, deref_ptr_mut, unwrap_or_return};
1414
use key_wallet::account::ManagedAccountCollection;
15-
use key_wallet::managed_account::managed_account_trait::ManagedAccountTrait;
1615
use key_wallet::managed_account::address_pool::{
1716
AddressInfo, AddressPool, KeySource, PublicKeyType,
1817
};
18+
use key_wallet::managed_account::managed_account_trait::ManagedAccountTrait;
1919
use key_wallet::managed_account::ManagedCoreFundsAccount;
2020
use key_wallet::AccountType;
2121

key-wallet-ffi/src/managed_account.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ use crate::types::{
2020
use crate::wallet_manager::FFIWalletManager;
2121
use key_wallet::account::account_collection::{DashpayAccountKey, PlatformPaymentAccountKey};
2222
use key_wallet::account::TransactionRecord;
23-
use key_wallet::managed_account::managed_account_trait::ManagedAccountTrait;
2423
use key_wallet::managed_account::address_pool::AddressPool;
24+
use key_wallet::managed_account::managed_account_trait::ManagedAccountTrait;
2525
use key_wallet::managed_account::managed_platform_account::ManagedPlatformAccount;
2626
use key_wallet::managed_account::ManagedCoreFundsAccount;
2727
use key_wallet::AccountType;

key-wallet-ffi/src/managed_wallet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use std::ptr;
1111
use crate::error::{FFIError, FFIErrorCode};
1212
use crate::types::FFIWallet;
1313
use crate::{check_ptr, deref_ptr, deref_ptr_mut, unwrap_or_return};
14-
use key_wallet::managed_account::managed_account_trait::ManagedAccountTrait;
1514
use key_wallet::managed_account::address_pool::KeySource;
15+
use key_wallet::managed_account::managed_account_trait::ManagedAccountTrait;
1616
use key_wallet::wallet::managed_wallet_info::wallet_info_interface::WalletInfoInterface;
1717
use key_wallet::wallet::managed_wallet_info::ManagedWalletInfo;
1818
use std::ffi::c_void;

key-wallet-ffi/src/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use std::os::raw::c_char;
55
use std::ptr;
66
use std::slice;
77

8-
use key_wallet::managed_account::managed_account_trait::ManagedAccountTrait;
98
use crate::error::{FFIError, FFIErrorCode};
109
use crate::types::{
1110
transaction_context_from_ffi, FFIBlockInfo, FFITransactionContextType, FFIWallet,
@@ -17,6 +16,7 @@ use dashcore::{
1716
consensus, hashes::Hash, sighash::SighashCache, EcdsaSighashType, Network, OutPoint, Script,
1817
ScriptBuf, Transaction, TxIn, TxOut, Txid,
1918
};
19+
use key_wallet::managed_account::managed_account_trait::ManagedAccountTrait;
2020
use key_wallet::wallet::managed_wallet_info::asset_lock_builder::{
2121
AssetLockFundingType, CreditOutputFunding,
2222
};

key-wallet/src/managed_account/managed_account_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ use crate::managed_account::address_pool;
1414
#[cfg(any(feature = "bls", feature = "eddsa"))]
1515
use crate::managed_account::address_pool::PublicKeyType;
1616
use crate::managed_account::managed_account_type::ManagedAccountType;
17-
use crate::Network;
1817
#[cfg(feature = "eddsa")]
1918
use crate::AddressInfo;
2019
use crate::ExtendedPubKey;
20+
use crate::Network;
2121
use dashcore::{Address, ScriptBuf, Txid};
2222

2323
/// Common trait for "core" managed account types — both funds-bearing

key-wallet/src/managed_account/managed_core_funds_account.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ use std::collections::{BTreeSet, HashSet};
4242
///
4343
/// Most read/write surface comes from [`ManagedAccountTrait`] default methods
4444
/// — which delegate to the inner keys account via the primitive accessors —
45-
/// so this struct only carries the funds-specific inherent methods
46-
/// ([`Self::record_transaction`], the Standard-account receive/change paths,
47-
/// etc.). The funds-specific state (`balance`, `utxos`) is reachable as a
48-
/// public field directly.
45+
/// so this struct only carries the funds-specific inherent methods (transaction
46+
/// recording, the Standard-account receive/change paths, etc.). The
47+
/// funds-specific state (`balance`, `utxos`) is reachable as a public field
48+
/// directly.
4949
#[derive(Debug, Clone)]
5050
#[cfg_attr(feature = "serde", derive(Serialize))]
5151
pub struct ManagedCoreFundsAccount {

key-wallet/src/transaction_checking/account_checker.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,8 @@ impl ManagedCoreFundsAccount {
595595
if let Some(payout_info) = self.check_provider_payout(payout_script) {
596596
provider_payout_involved = true;
597597
// Classify the payout address
598-
if let Ok(payout_address) = Address::from_script(payout_script, self.network()) {
598+
if let Ok(payout_address) = Address::from_script(payout_script, self.network())
599+
{
599600
match self.classify_address(&payout_address) {
600601
AddressClassification::External => {
601602
involved_receive_addresses.push(payout_info);

key-wallet/src/transaction_checking/transaction_router/tests/routing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
33
use super::helpers::{test_addr, test_block_info};
44
use crate::account::{AccountType, StandardAccountType};
5-
use crate::managed_account::managed_account_trait::ManagedAccountTrait;
65
use crate::managed_account::address_pool::KeySource;
6+
use crate::managed_account::managed_account_trait::ManagedAccountTrait;
77
use crate::managed_account::managed_account_type::ManagedAccountType;
88
use crate::test_utils::TestWalletContext;
99
use crate::transaction_checking::transaction_router::{

key-wallet/src/wallet/managed_wallet_info/managed_accounts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ use crate::account::BLSAccount;
88
#[cfg(feature = "eddsa")]
99
use crate::account::EdDSAAccount;
1010
use crate::account::{Account, AccountType, ManagedCoreFundsAccount};
11-
use crate::managed_account::managed_account_trait::ManagedAccountTrait;
1211
use crate::bip32::ExtendedPubKey;
1312
use crate::error::{Error, Result};
13+
use crate::managed_account::managed_account_trait::ManagedAccountTrait;
1414
use crate::wallet::{Wallet, WalletType};
1515

1616
impl ManagedAccountOperations for ManagedWalletInfo {

0 commit comments

Comments
 (0)