From 5e4113bf8f2eea6e3fc25645318e78d7e9817c8b Mon Sep 17 00:00:00 2001 From: William Katz Date: Thu, 3 Jun 2021 18:16:56 -0700 Subject: [PATCH] reversed endpoint to match new internal structure --- include/bank.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/bank.hpp b/include/bank.hpp index 8b66c55..cce3ecf 100644 --- a/include/bank.hpp +++ b/include/bank.hpp @@ -179,7 +179,16 @@ public: } else { - res = u.log.Serialize(); + Json::Value temp; + for (uint32_t i = u.log.data.size(); i > 0; --i) + { + std::cout << i << '\n'; + temp[i - 1]["to"] = u.log.data[i - 1].to; + temp[i - 1]["from"] = u.log.data[i - 1].from; + temp[i - 1]["amount"] = (Json::UInt)u.log.data[i - 1].amount; + temp[i - 1]["time"] = (Json::UInt64)u.log.data[i - 1].time; + } + res = std::move(temp); } })) {