From b99dc5bfd65546f58b56b7c9364676ee46d27f23 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Fri, 18 Oct 2019 17:25:59 -0700 Subject: [PATCH] Datetime in the UI --- lib/Cargo.lock | 6 +++--- lib/Cargo.toml | 2 +- src/controller.cpp | 12 +++++++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/Cargo.lock b/lib/Cargo.lock index 81710f6..8b7d65d 100644 --- a/lib/Cargo.lock +++ b/lib/Cargo.lock @@ -1011,7 +1011,7 @@ version = "0.1.0" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "zecwalletlitelib 0.1.0 (git+https://github.com/adityapk00/zecwallet-light-cli?rev=4518965a41f7e4b253a4943a760af76fefc878df)", + "zecwalletlitelib 0.1.0 (git+https://github.com/adityapk00/zecwallet-light-cli?rev=e3a0fd2dea59c0cf6434148bf77fef84830cce02)", ] [[package]] @@ -2182,7 +2182,7 @@ dependencies = [ [[package]] name = "zecwalletlitelib" version = "0.1.0" -source = "git+https://github.com/adityapk00/zecwallet-light-cli?rev=4518965a41f7e4b253a4943a760af76fefc878df#4518965a41f7e4b253a4943a760af76fefc878df" +source = "git+https://github.com/adityapk00/zecwallet-light-cli?rev=e3a0fd2dea59c0cf6434148bf77fef84830cce02#e3a0fd2dea59c0cf6434148bf77fef84830cce02" dependencies = [ "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "bellman 0.1.0 (git+https://github.com/adityapk00/librustzcash.git?rev=188537ea025fcb7fbdfc11266f307a084a5451e4)", @@ -2467,4 +2467,4 @@ dependencies = [ "checksum zcash_client_backend 0.0.0 (git+https://github.com/adityapk00/librustzcash.git?rev=188537ea025fcb7fbdfc11266f307a084a5451e4)" = "" "checksum zcash_primitives 0.0.0 (git+https://github.com/adityapk00/librustzcash.git?rev=188537ea025fcb7fbdfc11266f307a084a5451e4)" = "" "checksum zcash_proofs 0.0.0 (git+https://github.com/adityapk00/librustzcash.git?rev=188537ea025fcb7fbdfc11266f307a084a5451e4)" = "" -"checksum zecwalletlitelib 0.1.0 (git+https://github.com/adityapk00/zecwallet-light-cli?rev=4518965a41f7e4b253a4943a760af76fefc878df)" = "" +"checksum zecwalletlitelib 0.1.0 (git+https://github.com/adityapk00/zecwallet-light-cli?rev=e3a0fd2dea59c0cf6434148bf77fef84830cce02)" = "" diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 3f51fdd..e65a82b 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -11,4 +11,4 @@ crate-type = ["staticlib"] [dependencies] libc = "0.2.58" lazy_static = "1.4.0" -zecwalletlitelib = { git = "https://github.com/adityapk00/zecwallet-light-cli", rev = "4518965a41f7e4b253a4943a760af76fefc878df" } \ No newline at end of file +zecwalletlitelib = { git = "https://github.com/adityapk00/zecwallet-light-cli", rev = "e3a0fd2dea59c0cf6434148bf77fef84830cce02" } \ No newline at end of file diff --git a/src/controller.cpp b/src/controller.cpp index b175bb3..0a78f56 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -331,7 +331,7 @@ void Controller::refreshTransactions() { for (auto o: it["outgoing_metadata"].get()) { QString address = QString::fromStdString(o["address"]); - qint64 amount = o["value"].get(); + qint64 amount = -1 * o["value"].get(); // Sent items are -ve QString memo; if (!o["memo"].is_null()) { @@ -350,7 +350,7 @@ void Controller::refreshTransactions() { txdata.push_back(TransactionItem{ "Sent", - it["block_height"].get(), + it["datetime"].get(), address, QString::fromStdString(it["txid"]), model->getLatestBlock() - it["block_height"].get(), @@ -361,9 +361,15 @@ void Controller::refreshTransactions() { address = (it["address"].is_null() ? "" : QString::fromStdString(it["address"])); model->markAddressUsed(address); + items.push_back(TransactionItemDetail{ + address, + it["amount"].get(), + "" + }); + TransactionItem tx{ "Receive", - it["block_height"].get(), + it["datetime"].get(), address, QString::fromStdString(it["txid"]), model->getLatestBlock() - it["block_height"].get(),