Skip to content

Commit

Permalink
refactor: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
crisdut committed Dec 11, 2023
1 parent ce2700c commit 34f062a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/rgb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1958,9 +1958,11 @@ async fn internal_next_auction(
.await
.map_err(|op| RgbSwapError::WrongPsbtFinal(op.to_string()))?;

let psbt = Psbt::from_str(&psbt).expect("");
let psbt =
Psbt::from_str(&psbt).map_err(|op| RgbSwapError::WrongPsbtFinal(op.to_string()))?;
let txid = psbt.to_txid();
let txid = bp::Txid::from_str(&txid.to_hex()).expect("");
let txid = bp::Txid::from_str(&txid.to_hex())
.map_err(|op| RgbSwapError::WrongPsbtFinal(op.to_string()))?;

let outpoint = Outpoint::new(txid, 0);
next_auction_offer(offer, outpoint)
Expand Down
2 changes: 1 addition & 1 deletion src/rgb/swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ impl RgbAuctionSwaps {
let mut collection_updated = vec![];
for mut offer in offer_collection {
let RgbOfferSwap { seller_psbt, .. } = offer.clone();
let mut psbt = Psbt::from_str(&seller_psbt).expect("");
let mut psbt = Psbt::from_str(&seller_psbt).expect("invalid psbt hex format");

for (index, input) in psbt.clone().inputs.into_iter().enumerate() {
if input
Expand Down

0 comments on commit 34f062a

Please sign in to comment.