Fix get cell panic when dump_transaction.
@@ -405,8 +405,8 @@ impl RPCClient {
)
.await?,
)?;
- let cell_info = cell_with_status.map(|cell_with_status| {
- let cell = cell_with_status.cell.expect("get cell");
+ let cell_info = if let Some(cell_with_status) = cell_with_status {
+ cell_with_status.cell.map(|cell| {
let output: ckb_types::packed::CellOutput = cell.output.into();
let output = CellOutput::new_unchecked(output.as_bytes());
let data = cell
@@ -419,7 +419,10 @@ impl RPCClient {
data,
out_point,
}
- });
+ })
+ } else {
+ None
+ };
Ok(cell_info)
}
