Fixing few tx types
This commit is contained in:
parent
f8b35c6396
commit
3e33fc9999
|
@ -24,6 +24,29 @@ defmodule ZcashExplorerWeb.TransactionView do
|
||||||
""
|
""
|
||||||
end
|
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 and
|
||||||
|
tx.version == 5 do
|
||||||
|
"Transferred from/to shielded pool"
|
||||||
|
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 shielded pool"
|
||||||
|
end
|
||||||
|
|
||||||
def get_shielded_pool_label(tx)
|
def get_shielded_pool_label(tx)
|
||||||
when tx.vjoinsplit != nil and
|
when tx.vjoinsplit != nil and
|
||||||
length(tx.vjoinsplit) == 0 and
|
length(tx.vjoinsplit) == 0 and
|
||||||
|
@ -108,10 +131,23 @@ defmodule ZcashExplorerWeb.TransactionView do
|
||||||
length(tx.vjoinsplit) == 0 and
|
length(tx.vjoinsplit) == 0 and
|
||||||
length(tx.vin) == 0 and
|
length(tx.vin) == 0 and
|
||||||
length(tx.vout) == 0 and
|
length(tx.vout) == 0 and
|
||||||
|
length(tx.vShieldedOutput) > 0 and
|
||||||
|
length(tx.vShieldedSpend) == 0 and
|
||||||
|
tx.valueBalance < 0.0 and
|
||||||
|
tx.version == 5 do
|
||||||
|
0
|
||||||
|
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.vShieldedOutput) == 0 and
|
||||||
length(tx.vShieldedSpend) == 0 and
|
length(tx.vShieldedSpend) == 0 and
|
||||||
tx.valueBalance == 0.0 do
|
tx.valueBalance == 0.0 do
|
||||||
0.0
|
Map.get(tx, :vjoinsplit) |> Enum.reduce(0, fn x, acc -> Map.get(x, :vpub_old) + acc end)
|
||||||
end
|
end
|
||||||
|
|
||||||
# 0 feed tx ( not legacy )
|
# 0 feed tx ( not legacy )
|
||||||
|
@ -255,6 +291,18 @@ defmodule ZcashExplorerWeb.TransactionView do
|
||||||
fee |> format_zec()
|
fee |> format_zec()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def unknown_tx_fees(tx)
|
||||||
|
when tx.vjoinsplit != nil and
|
||||||
|
tx.version == 5 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)
|
def unknown_tx_fees(tx)
|
||||||
when tx.vjoinsplit != nil and
|
when tx.vjoinsplit != nil and
|
||||||
length(tx.vjoinsplit) == 0 and
|
length(tx.vjoinsplit) == 0 and
|
||||||
|
|
Loading…
Reference in New Issue