Skip to content

Commit

Permalink
remove usk_to_tkey
Browse files Browse the repository at this point in the history
  • Loading branch information
fluidvanadium committed Jul 24, 2024
1 parent ae0d477 commit 3148b96
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions zcash_client_backend/src/data_api/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,6 @@ where
&step_results,
step,
None,
None,
)?;
step_results.push((step, step_result));
}
Expand Down Expand Up @@ -648,9 +647,6 @@ pub fn calculate_proposed_transaction<DbT, ParamsT, InputsErrT, FeeRuleT, N>(
min_target_height: BlockHeight,
prior_step_results: &[(&proposal::Step<N>, BuildResult)],
proposal_step: &proposal::Step<N>,
usk_to_tkey: Option<
fn(&UnifiedSpendingKey, &TransparentAddressMetadata) -> hdwallet::secp256k1::SecretKey,
>,
override_sapling_change_address: Option<sapling::PaymentAddress>,
) -> Result<
BuildResult,
Expand Down Expand Up @@ -830,16 +826,10 @@ where
.clone()
.ok_or_else(|| Error::NoSpendingKey(addr.encode(params)))?;

let secret_key = usk_to_tkey
.map(|f| f(usk, &address_metadata))
.unwrap_or_else(|| {
usk.transparent()
.derive_secret_key(
address_metadata.scope(),
address_metadata.address_index(),
)
.unwrap()
});
let secret_key = usk
.transparent()
.derive_secret_key(address_metadata.scope(), address_metadata.address_index())
.unwrap();

utxos_spent.push(outpoint.clone());
builder.add_transparent_input(secret_key, outpoint, utxo)?;
Expand Down

0 comments on commit 3148b96

Please sign in to comment.