pub fn update_tree_state(
    connection_pool: &ConnectionPool,
    block: Block,
    accounts_updated: AccountUpdates,
) {
    let storage = connection_pool.access_storage().expect("db failed");

    if accounts_updated.is_empty() && block.number_of_processed_prior_ops() == 0 {
        storage
            .data_restore_schema()
            .save_block_transactions(block)
            .expect("Cant save block transactions");
    } else {
        let commit_op = Operation {
            action: Action::Commit,
            block: block.clone(),
            accounts_updated,
            id: None,
        };

        let verify_op = Operation {
            action: Action::Verify {
                proof: Box::new(EncodedProofPlonk::default()),
            },
            block,
            accounts_updated: Vec::new(),
            id: None,
        };

        storage
            .data_restore_schema()
            .save_block_operations(commit_op, verify_op)
            .expect("Cant execute verify operation");
    }
}
/// Updates stored tree state: saves block transactions in storage, stores blocks and account updates
///
/// # Arguments
///
/// * `connection_pool` - Database Connection Pool
/// * `block` - Rollup block
/// * `accounts_updated` - accounts updates
///
Updates stored tree state: saves block transactions in storage, stores blocks and account updates
Updates stored tree state : saves block transactions in storage stores blocks and account updates
pub fn update_tree_state(
    connection_pool: &ConnectionPool,
    block: Block,
    accounts_updated: AccountUpdates,
) {
    let storage = connection_pool.access_storage().expect("db failed");
    if accounts_updated.is_empty() && block.number_of_processed_prior_ops() == 0 {
        storage
            .data_restore_schema()
            .save_block_transactions(block)
            .expect("Cant save block transactions");
    } else {
        let commit_op = Operation {
            action: Action::Commit,
            block: block.clone(),
            accounts_updated,
            id: None,
        };
        let verify_op = Operation {
            action: Action::Verify {
                proof: Box::new(EncodedProofPlonk::default()),
            },
            block,
            accounts_updated: Vec::new(),
            id: None,
        };
        storage
            .data_restore_schema()
            .save_block_operations(commit_op, verify_op)
            .expect("Cant execute verify operation");
    }
}
pub fn update_tree_state ( connection_pool : & ConnectionPool , block : Block , accounts_updated : AccountUpdates , ) { let storage = connection_pool . access_storage ( ) . expect ( " " ) ; if accounts_updated . is_empty ( ) && block . number_of_processed_prior_ops ( ) == 0 { storage . data_restore_schema ( ) . save_block_transactions ( block ) . expect ( " " ) ; } else { let commit_op = Operation { action : Action :: Commit , block : block . clone ( ) , accounts_updated , id : None , } ; let verify_op = Operation { action : Action :: Verify { proof : Box :: new ( EncodedProofPlonk :: default ( ) ) , } , block , accounts_updated : Vec :: new ( ) , id : None , } ; storage . data_restore_schema ( ) . save_block_operations ( commit_op , verify_op ) . expect ( " " ) ; } }
Updates stored tree state: saves block transactions in storage, stores blocks and account updates
Updates stored tree state : saves block transactions in storage stores blocks and account updates
connection_pool
&ConnectionPool
block
Block
accounts_updated
AccountUpdates