Skip to content

Commit

Permalink
fixed up feature gates
Browse files Browse the repository at this point in the history
  • Loading branch information
fluidvanadium committed Sep 24, 2024
1 parent 51a3b0b commit 28a03c5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 25 deletions.
4 changes: 2 additions & 2 deletions zingolib/src/lightclient/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ pub mod send_with_proposal {
#[tokio::test]
async fn complete_and_broadcast_unconnected_error() {
use crate::{
config::ZingoConfigBuilder, lightclient::LightClient, mocks::ProposalBuilder,
testvectors::seeds::ABANDON_ART_SEED,
config::ZingoConfigBuilder, lightclient::LightClient,
mocks::proposal::ProposalBuilder, testvectors::seeds::ABANDON_ART_SEED,
};
let lc = LightClient::create_unconnected(
&ZingoConfigBuilder::default().create(),
Expand Down
3 changes: 0 additions & 3 deletions zingolib/src/mocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

//! Tools to facilitate mocks for structs of external crates and general mocking utilities for testing

#[cfg(feature = "test-elevation")]
pub use proposal::ProposalBuilder;

pub use sapling_crypto_note::SaplingCryptoNoteBuilder;

fn zaddr_from_seed(
Expand Down
50 changes: 30 additions & 20 deletions zingolib/src/wallet/describe.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
//! Wallet-State reporters as LightWallet methods.
use zcash_client_backend::PoolType;
use zcash_client_backend::ShieldedProtocol;

use orchard::note_encryption::OrchardDomain;
use sapling_crypto::note_encryption::SaplingDomain;

use zcash_primitives::consensus::NetworkConstants as _;
use zcash_primitives::transaction::components::amount::NonNegativeAmount;
use zcash_primitives::transaction::fees::zip317::MARGINAL_FEE;

Expand Down Expand Up @@ -308,27 +306,15 @@ impl LightWallet {

#[cfg(any(test, feature = "test-elevation"))]
mod test {
use orchard::note_encryption::OrchardDomain;
use sapling_crypto::note_encryption::SaplingDomain;
use zcash_client_backend::{PoolType, ShieldedProtocol};

use zcash_client_backend::PoolType;
use zcash_client_backend::ShieldedProtocol;
use zcash_primitives::consensus::NetworkConstants as _;

use crate::config::ZingoConfigBuilder;
use zingo_status::confirmation_status::ConfirmationStatus;
use crate::wallet::LightWallet;

use crate::{
mocks::{orchard_note::OrchardCryptoNoteBuilder, SaplingCryptoNoteBuilder},
wallet::{
notes::{
orchard::mocks::OrchardNoteBuilder, sapling::mocks::SaplingNoteBuilder,
transparent::mocks::TransparentOutputBuilder,
},
transaction_record::mocks::TransactionRecordBuilder,
LightWallet, WalletBase,
},
};

// these functions are totally good, and a better pattern for address lookup. maybe they can be gated in.
// these functions are tested gold and a better pattern for address lookup.
// maybe later they can be gated in.
impl LightWallet {
#[allow(clippy::result_unit_err)]
/// gets a UnifiedAddress, the first the wallet. this is the only receiver implemented as 2024-09-22
Expand Down Expand Up @@ -383,6 +369,30 @@ mod test {
}
}

#[cfg(test)]
use orchard::note_encryption::OrchardDomain;
#[cfg(test)]
use sapling_crypto::note_encryption::SaplingDomain;
#[cfg(test)]
use zingo_status::confirmation_status::ConfirmationStatus;

#[cfg(test)]
use crate::config::ZingoConfigBuilder;
#[cfg(test)]
use crate::mocks::orchard_note::OrchardCryptoNoteBuilder;
#[cfg(test)]
use crate::mocks::SaplingCryptoNoteBuilder;
#[cfg(test)]
use crate::wallet::notes::orchard::mocks::OrchardNoteBuilder;
#[cfg(test)]
use crate::wallet::notes::sapling::mocks::SaplingNoteBuilder;
#[cfg(test)]
use crate::wallet::notes::transparent::mocks::TransparentOutputBuilder;
#[cfg(test)]
use crate::wallet::transaction_record::mocks::TransactionRecordBuilder;
#[cfg(test)]
use crate::wallet::WalletBase;

#[tokio::test]
async fn confirmed_balance_excluding_dust() {
let wallet = LightWallet::new(
Expand Down

0 comments on commit 28a03c5

Please sign in to comment.