From 77fe09184b75009dde3d04291f63247e741d8c9a Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Mon, 6 May 2019 07:27:30 +0800 Subject: [PATCH] JsonTx udated --- tests/JsonTx.cpp | 10 +++++++++- tests/JsonTx.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/JsonTx.cpp b/tests/JsonTx.cpp index 63ea72d..6fc8ef6 100644 --- a/tests/JsonTx.cpp +++ b/tests/JsonTx.cpp @@ -106,7 +106,7 @@ JsonTx::get_output_key( out_pk, jring_member["unlock_time"], jring_member["height"], - commitment }); + commitment}); } } } @@ -181,6 +181,14 @@ JsonTx::init() // recipients dont have inputs so we do not populate // them here. + if (jrecpient.count("subaddress_index")) + { + auto saddr_idx = parse_subaddress_index( + jrecpient["subaddress_index"]); + + if (saddr_idx) + recipients.back().subaddr_idx = *saddr_idx; + } } } diff --git a/tests/JsonTx.h b/tests/JsonTx.h index 231dee9..f6a2c7a 100644 --- a/tests/JsonTx.h +++ b/tests/JsonTx.h @@ -47,6 +47,7 @@ public: uint64_t change {0}; vector outputs; vector inputs; + boost::optional subaddr_idx; inline string address_str() const