fn from_block(
        wallet: &Wallet,
        block: &Block,
        block_result: &BlockResults,
    ) -> Result<FilteredBlock> {
        let app_hash = block
            .header
            .app_hash
            .ok_or_else(|| Error::new(ErrorKind::TendermintRpcError, "app_hash not found"))?
            .to_string();
        let block_height = block.header.height.value();
        let block_time = block.header.time;

        let valid_transaction_ids = block_result.transaction_ids()?;
        let block_filter = block_result.block_filter()?;

        let staking_transactions =
            filter_staking_transactions(&block_result, &wallet.staking_addresses(), block)?;

        let enclave_transaction_ids =
            if block_filter.check_view_key(&wallet.view_key.clone().into()) {
                block.enclave_transaction_ids()?
            } else {
                vec![]
            };

        Ok(FilteredBlock {
            app_hash,
            block_height,
            block_time,
            valid_transaction_ids,
            enclave_transaction_ids,
            block_filter,
            staking_transactions,
        })
    }
/// Decode and filter block data for wallet
Decode and filter block data for wallet
Decode and filter block data for wallet
fn from_block(
        wallet: &Wallet,
        block: &Block,
        block_result: &BlockResults,
    ) -> Result<FilteredBlock> {
        let app_hash = block
            .header
            .app_hash
            .ok_or_else(|| Error::new(ErrorKind::TendermintRpcError, "app_hash not found"))?
            .to_string();
        let block_height = block.header.height.value();
        let block_time = block.header.time;
        let valid_transaction_ids = block_result.transaction_ids()?;
        let block_filter = block_result.block_filter()?;
        let staking_transactions =
            filter_staking_transactions(&block_result, &wallet.staking_addresses(), block)?;
        let enclave_transaction_ids =
            if block_filter.check_view_key(&wallet.view_key.clone().into()) {
                block.enclave_transaction_ids()?
            } else {
                vec![]
            };
        Ok(FilteredBlock {
            app_hash,
            block_height,
            block_time,
            valid_transaction_ids,
            enclave_transaction_ids,
            block_filter,
            staking_transactions,
        })
    }
fn from_block ( wallet : & Wallet , block : & Block , block_result : & BlockResults , ) -> Result < FilteredBlock > { let app_hash = block . header . app_hash . ok_or_else ( | | Error :: new ( ErrorKind :: TendermintRpcError , " " ) ) ? . to_string ( ) ; let block_height = block . header . height . value ( ) ; let block_time = block . header . time ; let valid_transaction_ids = block_result . transaction_ids ( ) ? ; let block_filter = block_result . block_filter ( ) ? ; let staking_transactions = filter_staking_transactions ( & block_result , & wallet . staking_addresses ( ) , block ) ? ; let enclave_transaction_ids = if block_filter . check_view_key ( & wallet . view_key . clone ( ) . into ( ) ) { block . enclave_transaction_ids ( ) ? } else { vec ! [ ] } ; Ok ( FilteredBlock { app_hash , block_height , block_time , valid_transaction_ids , enclave_transaction_ids , block_filter , staking_transactions , } ) }
Decode and filter block data for wallet
Decode and filter block data for wallet
wallet
&Wallet
block
&Block
block_result
&BlockResults