Skip to content

Commit

Permalink
Merge pull request #1342 from fluidvanadium/deconfig
Browse files Browse the repository at this point in the history
simplified parameters
  • Loading branch information
Oscar-Pepper authored Aug 28, 2024
2 parents e60b02e + aa4df1f commit bc35946
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions zingolib/src/wallet/keys/unified.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use sapling_crypto::note_encryption::SaplingDomain;
use zcash_primitives::consensus::{BranchId, NetworkConstants, Parameters};
use zcash_primitives::zip339::Mnemonic;

use crate::config::ZingoConfig;
use crate::config::{ChainType, ZingoConfig};
use secp256k1::SecretKey;
use zcash_address::unified::{Container, Encoding, Typecode, Ufvk};
use zcash_client_backend::address::UnifiedAddress;
Expand Down Expand Up @@ -334,7 +334,7 @@ impl WalletCapability {
/// TODO: Add Doc Comment Here!
pub fn get_taddr_to_secretkey_map(
&self,
config: &ZingoConfig,
chain: &ChainType,
) -> Result<HashMap<String, secp256k1::SecretKey>, String> {
if let Capability::Spend(transparent_sk) = &self.transparent {
self.transparent_child_addresses()
Expand All @@ -345,7 +345,7 @@ impl WalletCapability {
TransparentAddress::ScriptHash(hash) => hash,
};
Ok((
hash.to_base58check(&config.chain.b58_pubkey_address_prefix(), &[]),
hash.to_base58check(&chain.b58_pubkey_address_prefix(), &[]),
transparent_sk
.derive_private_key(KeyIndex::Normal(*i as u32))
.map_err(|e| e.to_string())?
Expand Down Expand Up @@ -461,7 +461,7 @@ impl WalletCapability {
Ok(wc)
}

pub(crate) fn get_all_taddrs(&self, config: &ZingoConfig) -> HashSet<String> {
pub(crate) fn get_all_taddrs(&self, chain: &crate::config::ChainType) -> HashSet<String> {
self.addresses
.iter()
.filter_map(|address| {
Expand All @@ -471,7 +471,7 @@ impl WalletCapability {
{
Some(super::ToBase58Check::to_base58check(
hash.as_slice(),
&config.chain.b58_pubkey_address_prefix(),
&chain.b58_pubkey_address_prefix(),
&[],
))
} else {
Expand Down
2 changes: 1 addition & 1 deletion zingolib/src/wallet/transaction_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ mod decrypt_transaction {
let mut txid_indexed_zingo_memos = Vec::new();

// Collect our t-addresses for easy checking
let taddrs_set = self.key.get_all_taddrs(&self.config);
let taddrs_set = self.key.get_all_taddrs(&self.config.chain);

let mut outgoing_metadatas = vec![];

Expand Down

0 comments on commit bc35946

Please sign in to comment.