Fix get_block_committed_info and get_withdrawal
@@ -829,9 +829,7 @@ async fn get_block_committed_info(
store: Data<Store>,
) -> Result<Option<L2BlockCommittedInfo>> {
if let Some(number) = store.get_block_number(&to_h256(block_hash))? {
- let transaction_hash = store
- .get_block_submit_tx_hash(number)
- .context("get submit tx")?;
+ if let Some(transaction_hash) = store.get_block_submit_tx_hash(number) {
let opt_block_hash = rpc_client
.ckb
.get_transaction_block_hash(transaction_hash)
@@ -854,6 +852,9 @@ async fn get_block_committed_info(
} else {
Ok(None)
}
+ } else {
+ Ok(None)
+ }
}
async fn get_block(
