diff --git a/lib/zcash_explorer_web/controllers/transaction_controller.ex b/lib/zcash_explorer_web/controllers/transaction_controller.ex index 0ed3394..186ec6e 100644 --- a/lib/zcash_explorer_web/controllers/transaction_controller.ex +++ b/lib/zcash_explorer_web/controllers/transaction_controller.ex @@ -4,7 +4,6 @@ defmodule ZcashExplorerWeb.TransactionController do def get_transaction(conn, %{"txid" => txid}) do {:ok, tx} = Zcashex.getrawtransaction(txid, 1) tx_data = Zcashex.Transaction.from_map(tx) - IO.inspect(tx_data) render(conn, "tx.html", tx: tx_data, page_title: "Zcash Transaction #{txid}") end end diff --git a/lib/zcash_explorer_web/views/transaction_view.ex b/lib/zcash_explorer_web/views/transaction_view.ex index 701128f..40dfb3d 100644 --- a/lib/zcash_explorer_web/views/transaction_view.ex +++ b/lib/zcash_explorer_web/views/transaction_view.ex @@ -24,6 +24,17 @@ defmodule ZcashExplorerWeb.TransactionView do "" end + def get_shielded_pool_label(tx) + when tx.vjoinsplit != nil and + length(tx.vjoinsplit) == 0 and + length(tx.vin) == 0 and + length(tx.vout) == 0 and + length(tx.vShieldedOutput) == 0 and + length(tx.vShieldedSpend) == 0 and + tx.valueBalance == 0.0 do + "Transferred from/to shielded pool" + end + def get_shielded_pool_label(tx) when tx.vjoinsplit != nil and length(tx.vjoinsplit) == 0 and @@ -91,6 +102,18 @@ defmodule ZcashExplorerWeb.TransactionView do "Transferred from shielded pool" end + # + def get_shielded_pool_value(tx) + when tx.vjoinsplit != nil and + length(tx.vjoinsplit) == 0 and + length(tx.vin) == 0 and + length(tx.vout) == 0 and + length(tx.vShieldedOutput) == 0 and + length(tx.vShieldedSpend) == 0 and + tx.valueBalance == 0.0 do + 0.0 + end + # 0 feed tx ( not legacy ) def get_shielded_pool_value(tx) when tx.vjoinsplit != nil and @@ -232,6 +255,17 @@ defmodule ZcashExplorerWeb.TransactionView do fee |> format_zec() end + def unknown_tx_fees(tx) + when tx.vjoinsplit != nil and + length(tx.vjoinsplit) == 0 and + length(tx.vin) == 0 and + length(tx.vout) == 0 and + length(tx.vShieldedOutput) == 0 and + length(tx.vShieldedSpend) == 0 and + tx.valueBalance == 0.0 do + "¯\\_(ツ)_/¯" + end + def unknown_tx_fees(tx) when tx.vjoinsplit != nil and length(tx.vjoinsplit) == 0 and