pub fn rpc_call(
        &self,
        method: &str,
        arg: serde_json::Value,
    ) -> Result<serde_json::Value, ()> {
        let jsonrpc = get_path("jsonrpc");

        let output = Command::new(jsonrpc)
            .args(&["-s", &self.rpc_path, "raw", method])
            .arg(serde_json::to_string(&arg).unwrap())
            .output()
            .expect("could not exec jsonrpc");

        if !output.status.success() {
            panic!(
                "RPC to socket {} with method {} failed arguments {:?}",
                self.rpc_path, method, arg
            );
        }

        let output_string = String::from_utf8_lossy(&output.stdout);
        Ok(serde_json::from_str(&output_string).unwrap())
    }
/// call json-rpc method using the binary
call json-rpc method using the binary
call json - rpc method using the binary
pub fn rpc_call(
        &self,
        method: &str,
        arg: serde_json::Value,
    ) -> Result<serde_json::Value, ()> {
        let jsonrpc = get_path("jsonrpc");
        let output = Command::new(jsonrpc)
            .args(&["-s", &self.rpc_path, "raw", method])
            .arg(serde_json::to_string(&arg).unwrap())
            .output()
            .expect("could not exec jsonrpc");
        if !output.status.success() {
            panic!(
                "RPC to socket {} with method {} failed arguments {:?}",
                self.rpc_path, method, arg
            );
        }
        let output_string = String::from_utf8_lossy(&output.stdout);
        Ok(serde_json::from_str(&output_string).unwrap())
    }
pub fn rpc_call ( & self , method : & str , arg : serde_json :: Value , ) -> Result < serde_json :: Value , ( ) > { let jsonrpc = get_path ( " " ) ; let output = Command :: new ( jsonrpc ) . args ( & [ " " , & self . rpc_path , " " , method ] ) . arg ( serde_json :: to_string ( & arg ) . unwrap ( ) ) . output ( ) . expect ( " " ) ; if ! output . status . success ( ) { panic ! ( " " self rpc_path method arg ) ; } let output_string = String :: from_utf8_lossy ( & output . stdout ) ; Ok ( serde_json :: from_str ( & output_string ) . unwrap ( ) ) }
call json-rpc method using the binary
call json - rpc method using the binary
&self
method
&str
arg
serde_json::Value
&self
method
&str
arg
serde_json::Value