Skip to content

Commit f483435

Browse files
committed
state read returns option
1 parent 9bfa929 commit f483435

File tree

1 file changed

+5
-5
lines changed
  • crates/core/component/funding/src/component

1 file changed

+5
-5
lines changed

crates/core/component/funding/src/component/view.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub trait StateReadExt: StateRead {
1717
}
1818

1919
/// Gets the funding module chain parameters from the JMT.
20-
async fn get_txid_from_nullifier(&self, nullifier: Nullifier) -> Result<TransactionId> {
20+
async fn get_txid_from_nullifier(&self, nullifier: Nullifier) -> Option<TransactionId> {
2121
// Grab the ambient epoch index.
2222
let epoch_index = self
2323
.get_current_epoch()
@@ -27,12 +27,12 @@ pub trait StateReadExt: StateRead {
2727

2828
let nullifier_key = &state_key::lqt_nullifier_lookup_for_txid(epoch_index, &nullifier);
2929

30-
let tx_id: TransactionId = self
30+
let tx_id: Option<TransactionId> = self
3131
.nonverifiable_get(&nullifier_key.as_bytes())
32-
.await?
33-
.ok_or_else(|| anyhow::anyhow!("infallible"))?;
32+
.await
33+
.expect("infallible");
3434

35-
Ok(tx_id)
35+
tx_id
3636
}
3737
}
3838

0 commit comments

Comments
 (0)