From df3b9892a8efe36e06a8fd0b76979d3c1507d5fb Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Tue, 7 May 2019 15:53:33 +0100 Subject: [PATCH 1/2] Use Address type --- client/src/client.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/client.rs b/client/src/client.rs index 57f41ba9..1521da6b 100644 --- a/client/src/client.rs +++ b/client/src/client.rs @@ -543,15 +543,15 @@ pub trait RpcApi: Sized { &self, label: Option<&str>, address_type: Option, - ) -> Result { + ) -> Result
{ self.call("getnewaddress", &[opt_into_json(label)?, opt_into_json(address_type)?]) } /// Mine `block_num` blocks and pay coinbase to `address` /// /// Returns hashes of the generated blocks - fn generate_to_address(&self, block_num: u64, address: &str) -> Result> { - self.call("generatetoaddress", &[block_num.into(), address.into()]) + fn generate_to_address(&self, block_num: u64, address: &Address) -> Result> { + self.call("generatetoaddress", &[block_num.into(), address.to_string().into()]) } /// Mine up to block_num blocks immediately (before the RPC call returns) From 49a2ca25f2f99cc0974cae1c8bbaa513f5660726 Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Wed, 8 May 2019 16:35:29 +0100 Subject: [PATCH 2/2] Fix Amount type --- json/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/json/src/lib.rs b/json/src/lib.rs index c21bd947..10d1c118 100644 --- a/json/src/lib.rs +++ b/json/src/lib.rs @@ -352,7 +352,8 @@ pub struct ListReceivedByAddressResult { #[serde(rename = "involvesWatchonly")] pub involved_watch_only: bool, pub address: Address, - pub amount: u64, + #[serde(deserialize_with = "deserialize_amount")] + pub amount: Amount, pub confirmations: u32, pub label: String, pub txids: Vec,