fn create_psbt(
        unvault_txin: UnvaultTxIn,
        feebump_txin: Option<FeeBumpTxIn>,
        deposit_txo: DepositTxOut,
        lock_time: u32,
    ) -> Psbt {
        let mut txins = vec![unvault_txin.unsigned_txin()];
        let mut psbtins = vec![PsbtIn {
            witness_script: Some(unvault_txin.txout().witness_script().clone()),
            bip32_derivation: unvault_txin.txout().bip32_derivation().clone(),
            sighash_type: Some(SigHashType::AllPlusAnyoneCanPay),
            witness_utxo: Some(unvault_txin.into_txout().into_txout()),
            ..PsbtIn::default()
        }];
        if let Some(feebump_txin) = feebump_txin {
            txins.push(feebump_txin.unsigned_txin());
            psbtins.push(PsbtIn {
                sighash_type: Some(SigHashType::All),
                witness_utxo: Some(feebump_txin.into_txout().into_txout()),
                ..PsbtIn::default()
            });
        }

        Psbt {
            inputs: psbtins,
            // Deposit txout
            outputs: vec![PsbtOut {
                bip32_derivation: deposit_txo.bip32_derivation().clone(),
                ..PsbtOut::default()
            }],
            global: PsbtGlobal {
                unsigned_tx: Transaction {
                    version: TX_VERSION,
                    lock_time,
                    input: txins,
                    output: vec![deposit_txo.into_txout()],
                },
                version: 0,
                xpub: BTreeMap::new(),
                proprietary: BTreeMap::new(),
                unknown: BTreeMap::new(),
            },
        }
    }
// Internal DRY routine for creating the inner PSBT
Internal DRY routine for creating the inner PSBT
Internal DRY routine for creating the inner PSBT
fn create_psbt(
        unvault_txin: UnvaultTxIn,
        feebump_txin: Option<FeeBumpTxIn>,
        deposit_txo: DepositTxOut,
        lock_time: u32,
    ) -> Psbt {
        let mut txins = vec![unvault_txin.unsigned_txin()];
        let mut psbtins = vec![PsbtIn {
            witness_script: Some(unvault_txin.txout().witness_script().clone()),
            bip32_derivation: unvault_txin.txout().bip32_derivation().clone(),
            sighash_type: Some(SigHashType::AllPlusAnyoneCanPay),
            witness_utxo: Some(unvault_txin.into_txout().into_txout()),
            ..PsbtIn::default()
        }];
        if let Some(feebump_txin) = feebump_txin {
            txins.push(feebump_txin.unsigned_txin());
            psbtins.push(PsbtIn {
                sighash_type: Some(SigHashType::All),
                witness_utxo: Some(feebump_txin.into_txout().into_txout()),
                ..PsbtIn::default()
            });
        }
        Psbt {
            inputs: psbtins,
            // Deposit txout
            outputs: vec![PsbtOut {
                bip32_derivation: deposit_txo.bip32_derivation().clone(),
                ..PsbtOut::default()
            }],
            global: PsbtGlobal {
                unsigned_tx: Transaction {
                    version: TX_VERSION,
                    lock_time,
                    input: txins,
                    output: vec![deposit_txo.into_txout()],
                },
                version: 0,
                xpub: BTreeMap::new(),
                proprietary: BTreeMap::new(),
                unknown: BTreeMap::new(),
            },
        }
    }
fn create_psbt ( unvault_txin : UnvaultTxIn , feebump_txin : Option < FeeBumpTxIn > , deposit_txo : DepositTxOut , lock_time : u32 , ) -> Psbt { let mut txins = vec ! [ unvault_txin unsigned_txin ( ) ] ; let mut psbtins = vec ! [ PsbtIn { witness_script Some ( unvault_txin txout ( ) witness_script ( ) clone ( ) ) bip32_derivation unvault_txin txout ( ) bip32_derivation ( ) clone ( ) sighash_type Some ( SigHashType AllPlusAnyoneCanPay ) witness_utxo Some ( unvault_txin into_txout ( ) into_txout ( ) ) PsbtIn default ( ) } ] ; if let Some ( feebump_txin ) = feebump_txin { txins . push ( feebump_txin . unsigned_txin ( ) ) ; psbtins . push ( PsbtIn { sighash_type : Some ( SigHashType :: All ) , witness_utxo : Some ( feebump_txin . into_txout ( ) . into_txout ( ) ) , .. PsbtIn :: default ( ) } ) ; } Psbt { inputs : psbtins , // Deposit txout outputs : vec ! [ PsbtOut { bip32_derivation deposit_txo bip32_derivation ( ) clone ( ) PsbtOut default ( ) } ] , global : PsbtGlobal { unsigned_tx : Transaction { version : TX_VERSION , lock_time , input : txins , output : vec ! [ deposit_txo into_txout ( ) ] , } , version : 0 , xpub : BTreeMap :: new ( ) , proprietary : BTreeMap :: new ( ) , unknown : BTreeMap :: new ( ) , } , } }
Internal DRY routine for creating the inner PSBT
Internal DRY routine for creating the inner PSBT
unvault_txin
UnvaultTxIn
feebump_txin
Option<FeeBumpTxIn>
deposit_txo
DepositTxOut
lock_time
u32