pub fn sanitize_deposit_cells(
    ctx: &RollupContext,
    unsanitize_deposits: Vec<DepositInfo>,
    state: &MemStateTree,
) -> Vec<DepositInfo> {
    log::debug!(target: "collect-deposit-cells", "sanitize {} deposits", unsanitize_deposits.len());
    let mut deposit_cells = Vec::with_capacity(unsanitize_deposits.len());
    for cell in unsanitize_deposits {
        // check deposit lock
        // the lock should be correct unless the upstream ckb-indexer has bugs
        if let Err(err) = check_deposit_cell(ctx, &cell, state) {
            log::debug!(target: "collect-deposit-cells", "invalid deposit cell: {}", err);
            continue;
        }
        deposit_cells.push(cell);
    }
    log::debug!(target: "collect-deposit-cells", "return {} sanitized deposits", deposit_cells.len());
    deposit_cells
}
/// check and reject invalid deposit cells
check and reject invalid deposit cells
check and reject invalid deposit cells
pub fn sanitize_deposit_cells(
    ctx: &RollupContext,
    unsanitize_deposits: Vec<DepositInfo>,
    state: &MemStateTree,
) -> Vec<DepositInfo> {
    log::debug!(target: "collect-deposit-cells", "sanitize {} deposits", unsanitize_deposits.len());
    let mut deposit_cells = Vec::with_capacity(unsanitize_deposits.len());
    for cell in unsanitize_deposits {
        // check deposit lock
        // the lock should be correct unless the upstream ckb-indexer has bugs
        if let Err(err) = check_deposit_cell(ctx, &cell, state) {
            log::debug!(target: "collect-deposit-cells", "invalid deposit cell: {}", err);
            continue;
        }
        deposit_cells.push(cell);
    }
    log::debug!(target: "collect-deposit-cells", "return {} sanitized deposits", deposit_cells.len());
    deposit_cells
}
pub fn sanitize_deposit_cells ( ctx : & RollupContext , unsanitize_deposits : Vec < DepositInfo > , state : & MemStateTree , ) -> Vec < DepositInfo > { log :: debug ! ( target " " " " unsanitize_deposits len ( ) ) ; let mut deposit_cells = Vec :: with_capacity ( unsanitize_deposits . len ( ) ) ; for cell in unsanitize_deposits { // check deposit lock // the lock should be correct unless the upstream ckb-indexer has bugs if let Err ( err ) = check_deposit_cell ( ctx , & cell , state ) { log :: debug ! ( target " " " " err ) ; continue ; } deposit_cells . push ( cell ) ; } log :: debug ! ( target " " " " deposit_cells len ( ) ) ; deposit_cells }
check and reject invalid deposit cells
check and reject invalid deposit cells
ctx
&RollupContext
unsanitize_deposits
Vec<DepositInfo>
state
&MemStateTree
ctx
&RollupContext
unsanitize_deposits
Vec<DepositInfo>
state
&MemStateTree