Fix Unified Address Search
This commit is contained in:
parent
0074ab4021
commit
97ae13170f
|
@ -6,9 +6,9 @@ defmodule ZcashExplorerWeb.SearchController do
|
||||||
# query zcashd to find out if the user has entered a valid resource
|
# query zcashd to find out if the user has entered a valid resource
|
||||||
# Valid resources:
|
# Valid resources:
|
||||||
# Block - height, hash
|
# Block - height, hash
|
||||||
# Transaction - hash
|
# Transaction - hash
|
||||||
# Address - Transparent , Shielded
|
# Address - Transparent , Shielded
|
||||||
# If zcashd responds that a resource is valid, we redirect the user
|
# If zcashd responds that a resource is valid, we redirect the user
|
||||||
# to the appropriate resource view or redirect them to an error view.
|
# to the appropriate resource view or redirect them to an error view.
|
||||||
tasks = [
|
tasks = [
|
||||||
Task.async(fn -> Zcashex.getblock(qs, 0) end),
|
Task.async(fn -> Zcashex.getblock(qs, 0) end),
|
||||||
|
@ -104,11 +104,19 @@ defmodule ZcashExplorerWeb.SearchController do
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def is_valid_zaddr?({:ok, %{"isvalid" => true, "address_type" => "unified"}}) do
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
def is_valid_unified_address?({:ok, %{"isvalid" => true, "type" => "unified"}}) do
|
def is_valid_unified_address?({:ok, %{"isvalid" => true, "type" => "unified"}}) do
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_valid_unified_address?(resp) do
|
def is_valid_unified_address?({:ok, %{"isvalid" => true, "address_type" => "unified"}}) do
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
def is_valid_unified_address?(_resp) do
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue