pub fn forward_blocks(w3: &Arc<Web3<Http>>, interval: u64, deployer: Address) -> Result<(), Error> {
    let contract = deploy_dummy_miner(&w3, &deployer.to_hex())?;
    println!("deployed dummy contract at address = {:?}", contract.address());
    loop {
        let gas_limit: u64 = 5_999_999;
        let mut options = Options::default();
        options.gas = Some(gas_limit.into());
        // contract.call("mine",(),deployer,options ).wait().expect("error calling mine on miner.");
        let res = contract.call("mine", (), deployer, options).wait();
        match res {
            Ok(_) => println!("\u{2692}"),
            Err(e) => println!("[-] error mining block =>{:?}", e),
        };
        thread::sleep(time::Duration::from_secs(interval));
    }
}
/// TESTING: mimic block creation to test the watch blocks method of the principal node
mimic block creation to test the watch blocks method of the principal node
mimic block creation to test the watch blocks method of the principal node
pub fn forward_blocks(w3: &Arc<Web3<Http>>, interval: u64, deployer: Address) -> Result<(), Error> {
    let contract = deploy_dummy_miner(&w3, &deployer.to_hex())?;
    println!("deployed dummy contract at address = {:?}", contract.address());
    loop {
        let gas_limit: u64 = 5_999_999;
        let mut options = Options::default();
        options.gas = Some(gas_limit.into());
        // contract.call("mine",(),deployer,options ).wait().expect("error calling mine on miner.");
        let res = contract.call("mine", (), deployer, options).wait();
        match res {
            Ok(_) => println!("\u{2692}"),
            Err(e) => println!("[-] error mining block =>{:?}", e),
        };
        thread::sleep(time::Duration::from_secs(interval));
    }
}
pub fn forward_blocks ( w3 : & Arc < Web3 < Http > > , interval : u64 , deployer : Address ) -> Result < ( ) , Error > { let contract = deploy_dummy_miner ( & w3 , & deployer . to_hex ( ) ) ? ; println ! ( " " contract address ( ) ) ; loop { let gas_limit : u64 = 5_999_999 ; let mut options = Options :: default ( ) ; options . gas = Some ( gas_limit . into ( ) ) ; // contract.call("mine",(),deployer,options ).wait().expect("error calling mine on miner."); let res = contract . call ( " " , ( ) , deployer , options ) . wait ( ) ; match res { Ok ( _ ) => println ! ( " \u{2692} " ) , Err ( e ) => println ! ( " " e ) , } ; thread :: sleep ( time :: Duration :: from_secs ( interval ) ) ; } }
TESTING: mimic block creation to test the watch blocks method of the principal node
TESTING : mimic block creation to test the watch blocks method of the principal node
w3
&Arc<Web3<Http>>
interval
u64
deployer
Address
w3
&Arc<Web3<Http>>
interval
u64
deployer
Address