mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-02-07 06:44:11 +00:00
Added add_transparent_output_with_script_pubkey()
This commit is contained in:
parent
82ba685f61
commit
ec3828b108
@ -13,6 +13,7 @@ use crate::{
|
||||
consensus,
|
||||
keys::OutgoingViewingKey,
|
||||
legacy::TransparentAddress,
|
||||
legacy::Script,
|
||||
merkle_tree::MerklePath,
|
||||
note_encryption::{generate_esk, Memo, SaplingNoteEncryption},
|
||||
prover::TxProver,
|
||||
@ -419,6 +420,25 @@ impl<R: RngCore + CryptoRng> Builder<R> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Adds a transparent address to send funds to, using supplied script pubkey
|
||||
pub fn add_transparent_output_with_script_pubkey(
|
||||
&mut self,
|
||||
to: &TransparentAddress,
|
||||
value: Amount,
|
||||
script_pubkey: Script,
|
||||
) -> Result<(), Error> {
|
||||
if value.is_negative() {
|
||||
return Err(Error::InvalidAmount);
|
||||
}
|
||||
|
||||
self.mtx.vout.push(TxOut {
|
||||
value,
|
||||
script_pubkey
|
||||
});
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Sets the Sapling address to which any change will be sent.
|
||||
///
|
||||
/// By default, change is sent to the Sapling address corresponding to the first note
|
||||
|
Loading…
Reference in New Issue
Block a user