Merge #127: fix gui: jsonrpc client
1cb633157365bf2931feb35b3a964118e484abbc fix gui: jsonrpc client (edouard)
Pull request description:
ACKs for top commit:
edouardparis:
Self-ACK 1cb633157365bf2931feb35b3a964118e484abbc
Tree-SHA512: e7b4cd20b728928d94e3290a9f7c44aa23f5a61b3b0145c4bb4f2a25f9efecaebc383f78b85c064bd894847a3e13899a61b96459878972553f239fb8e3517a44
This commit is contained in:
commit
60defd672c
@ -25,13 +25,14 @@ use uds_windows::UnixStream;
|
||||
use std::os::unix::net::UnixStream;
|
||||
|
||||
use std::fmt::Debug;
|
||||
use std::io::Write;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::time::Duration;
|
||||
use std::{error, fmt, io};
|
||||
|
||||
use serde::de::DeserializeOwned;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::{to_writer, Deserializer};
|
||||
use serde_json::Deserializer;
|
||||
|
||||
use log::debug;
|
||||
|
||||
@ -89,7 +90,7 @@ impl JsonRPCClient {
|
||||
|
||||
debug!("Sending to lianad: {:#?}", request);
|
||||
|
||||
to_writer(&mut stream, &request)?;
|
||||
stream.write_all(&[serde_json::to_string(&request).unwrap().as_bytes(), b"\n"].concat())?;
|
||||
|
||||
let response: Response<D> = Deserializer::from_reader(&mut stream)
|
||||
.into_iter()
|
||||
|
||||
@ -77,7 +77,7 @@ impl<C: Client + Debug> Daemon for Lianad<C> {
|
||||
}
|
||||
|
||||
fn list_spend_txs(&self) -> Result<ListSpendResult, DaemonError> {
|
||||
self.call("listspend", Option::<Request>::None)
|
||||
self.call("listspendtxs", Option::<Request>::None)
|
||||
}
|
||||
|
||||
fn create_spend_tx(
|
||||
@ -132,7 +132,7 @@ impl<C: Client + Debug> Daemon for Lianad<C> {
|
||||
}
|
||||
|
||||
fn list_txs(&self, txids: &[Txid]) -> Result<ListTransactionsResult, DaemonError> {
|
||||
self.call("list_transactions", Some(vec![txids]))
|
||||
self.call("listtransactions", Some(vec![txids]))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user