fn process_search_kernel<'a, I: Iterator<Item = &'a str>>(&self, mut args: I) {
        // let command_arg = args.take(4).collect::<Vec<&str>>();
        let hex = args.next();
        if hex.is_none() {
            self.print_help("search-kernel".split(' '));
            return;
        }
        let public_nonce = match PublicKey::from_hex(&hex.unwrap().to_string()) {
            Ok(v) => v,
            _ => {
                println!("Invalid public nonce provided.");
                self.print_help("search-kernel".split(' '));
                return;
            },
        };

        let hex = args.next();
        if hex.is_none() {
            self.print_help("search-kernel".split(' '));
            return;
        }
        let signature = match PrivateKey::from_hex(&hex.unwrap().to_string()) {
            Ok(v) => v,
            _ => {
                println!("Invalid signature provided.");
                self.print_help("search-kernel".split(' '));
                return;
            },
        };
        let kernel = Signature::new(public_nonce, signature);
        let mut handler = self.node_service.clone();
        self.executor.spawn(async move {
            match handler.get_blocks_with_kernels(vec![kernel.clone()]).await {
                Err(err) => {
                    println!("Failed to retrieve blocks: {:?}", err);
                    warn!(
                        target: LOG_TARGET,
                        "Error communicating with local base node: {:?}", err,
                    );
                    return;
                },
                Ok(mut data) => match data.pop() {
                    Some(v) => println!("{}", v.block),
                    _ => println!(
                        "Pruned node: kernel found, but block not found for kernel signature {}",
                        kernel.get_signature().to_hex()
                    ),
                },
            };
        });
    }
/// Function to process the search kernel command
Function to process the search kernel command
Function to process the search kernel command
fn process_search_kernel<'a, I: Iterator<Item = &'a str>>(&self, mut args: I) {
        // let command_arg = args.take(4).collect::<Vec<&str>>();
        let hex = args.next();
        if hex.is_none() {
            self.print_help("search-kernel".split(' '));
            return;
        }
        let public_nonce = match PublicKey::from_hex(&hex.unwrap().to_string()) {
            Ok(v) => v,
            _ => {
                println!("Invalid public nonce provided.");
                self.print_help("search-kernel".split(' '));
                return;
            },
        };
        let hex = args.next();
        if hex.is_none() {
            self.print_help("search-kernel".split(' '));
            return;
        }
        let signature = match PrivateKey::from_hex(&hex.unwrap().to_string()) {
            Ok(v) => v,
            _ => {
                println!("Invalid signature provided.");
                self.print_help("search-kernel".split(' '));
                return;
            },
        };
        let kernel = Signature::new(public_nonce, signature);
        let mut handler = self.node_service.clone();
        self.executor.spawn(async move {
            match handler.get_blocks_with_kernels(vec![kernel.clone()]).await {
                Err(err) => {
                    println!("Failed to retrieve blocks: {:?}", err);
                    warn!(
                        target: LOG_TARGET,
                        "Error communicating with local base node: {:?}", err,
                    );
                    return;
                },
                Ok(mut data) => match data.pop() {
                    Some(v) => println!("{}", v.block),
                    _ => println!(
                        "Pruned node: kernel found, but block not found for kernel signature {}",
                        kernel.get_signature().to_hex()
                    ),
                },
            };
        });
    }
fn process_search_kernel < ' a , I : Iterator < Item = & ' a str > > ( & self , mut args : I ) { // let command_arg = args.take(4).collect::<Vec<&str>>(); let hex = args . next ( ) ; if hex . is_none ( ) { self . print_help ( " " . split ( ' ' ) ) ; return ; } let public_nonce = match PublicKey :: from_hex ( & hex . unwrap ( ) . to_string ( ) ) { Ok ( v ) => v , _ => { println ! ( " " ) ; self . print_help ( " " . split ( ' ' ) ) ; return ; } , } ; let hex = args . next ( ) ; if hex . is_none ( ) { self . print_help ( " " . split ( ' ' ) ) ; return ; } let signature = match PrivateKey :: from_hex ( & hex . unwrap ( ) . to_string ( ) ) { Ok ( v ) => v , _ => { println ! ( " " ) ; self . print_help ( " " . split ( ' ' ) ) ; return ; } , } ; let kernel = Signature :: new ( public_nonce , signature ) ; let mut handler = self . node_service . clone ( ) ; self . executor . spawn ( async move { match handler . get_blocks_with_kernels ( vec ! [ kernel clone ( ) ] ) . await { Err ( err ) => { println ! ( " " err ) ; warn ! ( target LOG_TARGET " " err ) ; return ; } , Ok ( mut data ) => match data . pop ( ) { Some ( v ) => println ! ( " " v block ) , _ => println ! ( " " kernel get_signature ( ) to_hex ( ) ) , } , } ; } ) ; }
Function to process the search kernel command
Function to process the search kernel command
&self
args
I
&self
args
I