Skip to content

Commit

Permalink
Add utxo context
Browse files Browse the repository at this point in the history
  • Loading branch information
1bananagirl committed Jan 22, 2025
1 parent a3e0452 commit e13cc86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion wallet/core/src/account/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@ pub trait Account: AnySync + Send + Sync + 'static {
match result {
Ok(pskt) => {
let change = self.change_address()?;
let transaction = pskt_to_pending_transaction(pskt, self.wallet().network_id()?, change)?;
let transaction =
pskt_to_pending_transaction(pskt, self.wallet().network_id()?, change, self.utxo_context().clone().into())?;
ids.push(transaction.try_submit(&self.wallet().rpc_api()).await?);
}
Err(e) => {
Expand Down
4 changes: 3 additions & 1 deletion wallet/core/src/account/pskb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ pub fn pskt_to_pending_transaction(
finalized_pskt: PSKT<Finalizer>,
network_id: NetworkId,
change_address: Address,
source_utxo_context: Option<UtxoContext>,
) -> Result<PendingTransaction, Error> {
let mass = 10;
let (signed_tx, _) = match finalized_pskt.clone().extractor() {
Expand Down Expand Up @@ -339,7 +340,7 @@ pub fn pskt_to_pending_transaction(
change_address,
utxo_iterator,
priority_utxo_entries: None,
source_utxo_context: None,
source_utxo_context,
destination_utxo_context: None,
fee_rate: None,
final_transaction_priority_fee: fee_u.into(),
Expand Down Expand Up @@ -495,6 +496,7 @@ pub async fn commit_reveal_batch_bundle(
pskt_finalizer.clone(),
network_id,
account.clone().as_derivation_capable()?.change_address()?,
account.utxo_context().clone().into(),
)
.map_err(|_| Error::CommitTransactionIdExtractionError)?
.id();
Expand Down

0 comments on commit e13cc86

Please sign in to comment.