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: fuel_bin_service.rs
    path of file: ./repos/fuels-rs/packages/fuels-test-helpers/src
    
    the code of the file until where you have to start completion: use std::{
    net::{IpAddr, SocketAddr},
    path::PathBuf,
    time::Duration,
};

use fuel_core_client::client::FuelClient;
use fuel_core_services::State;
use fuels_core::{
    error,
    types::errors::{Error, Result as FuelResult},
};
use portpicker::{is_free, pick_unused_port};
use tempfile::NamedTempFile;
use tokio::{process::Command, spawn, task::JoinHandle, time::sleep};

use crate::node_types::{Config, DbType, Trigger};

#[derive(Debug)]
struct ExtendedConfig {
    config: Config,
    config_file: NamedTempFile,
}

impl ExtendedConfig {
    pub fn config_to_args_vec(&mut self) -> FuelResult<Vec<String>> {
        self.write_temp_chain_config_file()?;

        let port = self.config.addr.port().to_string();
        let mut args = vec![
            "run".to_string(), // `fuel-core` is now run with `fuel-core run`
            "--ip".to_string(),
            "127.0.0.1".to_string(),
            "--port".to_string(),
            port,
            "--chain".to_string(),
            self.config_file
                .path()
                .to_str()
                .expect("Failed to find config file")
                .to_string(),
        ];

        args.push("--db-type".to_string());
        match &self.config.database_type {
            DbType::InMemory => args.push("in-memory".to_string()),
            DbType::RocksDb(path_to_db) => {
                args.push("rocks-db".to_string());
                let path = path_to_db.as_ref().cloned().unwrap_or_else(|| {
                    PathBuf::from(std::env::var("HOME").expect("HOME env var missing"
    
    pub fn config_to_args_vec(&mut self) -> FuelResult<Vec<String>> {
        self.write_temp_chain_config_file()?;

        let port = self.config.addr.port().to_string();
        let mut args = vec![
            "run".to_string(), // `fuel-core` is now run with `fuel-core run`
            "--ip".to_string(),
            "127.0.0.1".to_string(),
            "--port".to_string(),
            port,
            "--chain".to_string(),
            self.config_file
                .path()
                .to_str()
                .expect("Failed to find config file")
                .to_string(),
        ];

        args.push("--db-type".to_string());
        match &self.config.database_type {
            DbType::InMemory => args.push("in-memory".to_string()),
            DbType::RocksDb(path_to_db) => {
                args.push("rocks-db".to_string());
                let path = path_to_db.as_ref().cloned().unwrap_or_else(|| {
                    PathBuf::from(std::env::var("HOME").expect("HOME env var missing"))
                        .join(".fuel/db")
                });
                args.push("--db-path".to_string());
                args.push(path.to_string_lossy().to_string());
            }
        }

        if let Some(cache_size) = self.config.max_database_cache_size {
            args.push("--max-database-cache-size".to_string());
            args.push(cache_size.to_string());
        }

        match self.config.block_production {
            Trigger::Instant => {
                args.push("--poa-instant=true".to_string());
            }
            Trigger::Never => {
                args.push("--poa-instant=false".to_string());
            }
            Trigger::Interval { block_time } => {
                args.push(format!(
                    "--poa-interval-period={}ms",
                    block_time.as_millis()
                ));
            }
        };

        args.extend(
            [
                (self.config.vm_backtrace, "--vm-backtrace"),
                (self.config.utxo_validation, "--utxo-validation"),
                (self.config.debug, "--debug"),
            ]
            .into_iter()
            .filter(|(flag, _)| *flag)
            .map(|(_, arg)| arg.to_string()),
        );

        Ok(args)
    }