You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: base_miner.rs
    path of file: ./repos/CYFS/src/meta/cyfs-meta/src/chain
    
    the code of the file until where you have to start completion: use cyfs_base_meta::*;

use cyfs_base::*;

use crate::{state_storage::*};

use crate::executor::context::{Config, ConfigRef, UnionWithdrawManager};
use crate::rent::rent_manager::RentManager;
use crate::events::event_manager::EventManager;
use crate::executor::tx_executor::TxExecutor;
use crate::name_auction::auction::Auction;
use crate::mint::btc_mint::{BTCMint};
use crate::chain::{Chain, to_meta_data};
use crate::chain::pending::PendingTransactions;
use async_std::sync::{Mutex, MutexGuard};
use crate::{get_meta_err_code, NFTAuction};
use std::convert::TryFrom;
use crate::chain::storage::chain_storage::ChainStorageRef;
use crate::stat::Stat;

pub struct BaseMiner {
    coinbase: ObjectId,
    interval: u32,
    chain: Chain,
    bfc_spv_node: String,
    pending: Mutex<PendingTransactions>,
    miner_key: Option<PrivateKey>,
}

impl BaseMiner {
    pub fn new(coinba
    
    pub async fn execute_block(header: &BlockDesc, block: &mut BlockBody, ref_state: &StateRef, config: &ConfigRef, chain_storage: Option<&ChainStorageRef>, mint_url: String, miner_key: Option<PrivateKey>, miner_id: ObjectId, stat: Option<Stat>) -> BuckyResult<()> {
        // ref_state.being_transaction().await?;
        let ret = async {
            let event_manager = EventManager::new(&ref_state, &config);
            let rent_manager = RentManager::new(&ref_state, &config, &event_manager);
            let auction = Auction::new(&ref_state, &config, &rent_manager, &event_manager);
            let union_withdraw_manager = UnionWithdrawManager::new(&ref_state, &config, &event_manager);
            let nft_auction = NFTAuction::new(&ref_state, &config, &event_manager);
            let tx_executor = TxExecutor::new(
                ref_state,
                config,
                &rent_manager,
                &auction,
                &event_manager,
                &union_withdraw_manager,
                &nft_auction,
                mint_url,
                miner_key,
                miner_id,
                false, stat);
            let mut receipts = vec![];
            header.calculate_id();
            for tx in block.transactions() {
                if !tx.desc().content().caller.is_miner() {
                    let public_key = {
                        let account_info_ret = ref_state.get_account_info(&tx.desc().content().caller.id()?).await;
                        if let Err(err) = &account_info_ret {
                            if let ERROR_NOT_FOUND = get_meta_err_code(&err)? {
                                let public_key = tx.desc().content().caller.get_public_key()?.clone();
                                ref_state.add_account_info(&AccountInfo::try_from(tx.desc().content().caller.clone())?).await?;
                                public_key
                            } else {
                                return Err(account_info_ret.err().unwrap());
                            }
                        } else {
                            account_info_ret.unwrap().get_public_key()?.clone()
                        }
                    };
                    if !tx.async_verify_signature(public_key).await? {
                        return Err(BuckyError::new(BuckyErrorCode::InvalidInput, "InvalidInput"));
                    }
                }
                let receipt = tx_executor.execute(header, tx, chain_storage).await?;
                receipts.push(receipt);
            }
            block.add_receipts(receipts)?;
            //TODO: execute events

            let ret = event_manager.run_event(header).await;
            if ret.is_err() {
                log::error!("run event error:{}", ret.err().unwrap());
            } else {
                log::info!("event count {}", ret.as_ref().unwrap().len());
                block.set_event_records(ret.unwrap());
            }
            Ok(())
        }.await;

        // if ret.is_ok() {
        //     ref_state.commit().await?;
        // } else {
        //     ref_state.rollback().await?;
        // }
        ret
    }