Skip to content

Commit

Permalink
Update pskt.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
saefstroem committed Jan 31, 2025
1 parent 55c9028 commit 5ba17dc
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions wallet/pskt/src/wasm/pskt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,18 +360,13 @@ impl PSKT {

let cloned_pskt = self.clone();
let extractor = cloned_pskt.extractor()?;
let state = extractor.state().clone();
if let Some(pskt) = state {
match pskt {
State::Extractor(pskt) => {
let tx = pskt.extract_tx(&network_id.into()).map_err(|_| Error::custom("Failed to extract transaction"))?;
Ok(tx.tx.mass())
}
_ => panic!("Extractor state is not valid"),
let state = extractor.state().clone().expect("Extractor state is not valid");
match pskt {
State::Extractor(pskt) => {
let tx = pskt.extract_tx(&network_id.into()).map_err(|_| Error::custom("Failed to extract transaction"))?;
Ok(tx.tx.mass())
}
} else {
log_error!("PSKT inner state is None");
Err(Error::NotInitialized)
_ => panic!("Extractor state is not valid"),
}
}
}

0 comments on commit 5ba17dc

Please sign in to comment.