handle a new type of tx
This commit is contained in:
parent
73b170595c
commit
4c6de231ac
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue