mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-02-12 01:55:48 +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,
|
consensus,
|
||||||
keys::OutgoingViewingKey,
|
keys::OutgoingViewingKey,
|
||||||
legacy::TransparentAddress,
|
legacy::TransparentAddress,
|
||||||
|
legacy::Script,
|
||||||
merkle_tree::MerklePath,
|
merkle_tree::MerklePath,
|
||||||
note_encryption::{generate_esk, Memo, SaplingNoteEncryption},
|
note_encryption::{generate_esk, Memo, SaplingNoteEncryption},
|
||||||
prover::TxProver,
|
prover::TxProver,
|
||||||
@ -419,6 +420,25 @@ impl<R: RngCore + CryptoRng> Builder<R> {
|
|||||||
Ok(())
|
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.
|
/// 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
|
/// By default, change is sent to the Sapling address corresponding to the first note
|
||||||
|
Loading…
x
Reference in New Issue
Block a user