Fix error modal calls. Can open a contract with a TX hash.
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(clutch).
|
||||
-vsn("0.3.0").
|
||||
-vsn("0.3.1").
|
||||
-behavior(application).
|
||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(gmc_con).
|
||||
-vsn("0.3.0").
|
||||
-vsn("0.3.1").
|
||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
-license("GPL-3.0-or-later").
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(gmc_grids).
|
||||
-vsn("0.3.0").
|
||||
-vsn("0.3.1").
|
||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
-license("GPL-3.0-or-later").
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(gmc_gui).
|
||||
-vsn("0.3.0").
|
||||
-vsn("0.3.1").
|
||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
-license("GPL-3.0-or-later").
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
%%% translation library is retained).
|
||||
|
||||
-module(gmc_jt).
|
||||
-vsn("0.3.0").
|
||||
-vsn("0.3.1").
|
||||
-export([read_translations/1, j/2, oneshot_j/2]).
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(gmc_key_master).
|
||||
-vsn("0.3.0").
|
||||
-vsn("0.3.1").
|
||||
|
||||
|
||||
-export([make_key/2, encode/1, decode/1]).
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(gmc_sup).
|
||||
-vsn("0.3.0").
|
||||
-vsn("0.3.1").
|
||||
-behaviour(supervisor).
|
||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
-module(gmc_v).
|
||||
-vsn("0.3.0").
|
||||
-vsn("0.3.1").
|
||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
-license("GPL-3.0-or-later").
|
||||
|
||||
+33
-9
@@ -1,5 +1,5 @@
|
||||
-module(gmc_v_devman).
|
||||
-vsn("0.3.0").
|
||||
-vsn("0.3.1").
|
||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
-license("GPL-3.0-or-later").
|
||||
@@ -428,12 +428,12 @@ add_code_page2(State = #s{j = J}, {file, File}) ->
|
||||
add_code_page(State, {file, File}, Code);
|
||||
Error ->
|
||||
Message = io_lib:format(J("Opening ~p failed with: ~p"), [File, Error]),
|
||||
ok = handle_troubling(Message, State),
|
||||
ok = handle_troubling(State, Message),
|
||||
State
|
||||
end;
|
||||
{error, Reason} ->
|
||||
Message = io_lib:format(J("Opening ~p failed with: ~p"), [File, Reason]),
|
||||
ok = handle_troubling(Message, State),
|
||||
ok = handle_troubling(State, Message),
|
||||
State
|
||||
end;
|
||||
add_code_page2(State, {hash, Address}) ->
|
||||
@@ -734,8 +734,20 @@ open_hash(State = #s{frame = Frame, j = J}) ->
|
||||
end,
|
||||
ok = wxDialog:destroy(Dialog),
|
||||
case Choice of
|
||||
{ok, Address} -> open_hash2(State, Address);
|
||||
cancel -> State
|
||||
{ok, Address = "ct_" ++ _} -> open_hash2(State, Address);
|
||||
{ok, Address = "th_" ++ _} -> get_contract_from_tx(State, Address);
|
||||
{ok, Turd} -> handle_troubling(State, {bad_address, Turd});
|
||||
cancel -> State
|
||||
end.
|
||||
|
||||
get_contract_from_tx(State, Address) ->
|
||||
case hz:tx_info(Address) of
|
||||
{ok, #{"call_info" := #{"contract_id" := Contract}}} ->
|
||||
open_hash2(State, Contract);
|
||||
{ok, Other} ->
|
||||
handle_troubling(State, {bad_address, Other});
|
||||
Error ->
|
||||
handle_troubling(State, Error)
|
||||
end.
|
||||
|
||||
open_hash2(State, Address) ->
|
||||
@@ -743,7 +755,7 @@ open_hash2(State, Address) ->
|
||||
{ok, Source} ->
|
||||
open_hash3(State, Address, Source);
|
||||
Error ->
|
||||
ok = handle_troubling(Error, State),
|
||||
ok = handle_troubling(State, Error),
|
||||
State
|
||||
end.
|
||||
|
||||
@@ -950,8 +962,20 @@ load(State = #s{frame = Frame, j = J}) ->
|
||||
end,
|
||||
ok = wxDialog:destroy(Dialog),
|
||||
case Choice of
|
||||
{ok, Address} -> load2(State, Address);
|
||||
cancel -> State
|
||||
{ok, Address = "ct_" ++ _} -> load2(State, Address);
|
||||
{ok, Address = "th_" ++ _} -> load_from_tx(State, Address);
|
||||
{ok, Turd} -> handle_troubling(State, {bad_address, Turd});
|
||||
cancel -> State
|
||||
end.
|
||||
|
||||
load_from_tx(State, Address) ->
|
||||
case hz:tx_info(Address) of
|
||||
{ok, #{"call_info" := #{"contract_id" := Contract}}} ->
|
||||
load2(State, Contract);
|
||||
{ok, Other} ->
|
||||
handle_troubling(State, {bad_address, Other});
|
||||
Error ->
|
||||
handle_troubling(State, Error)
|
||||
end.
|
||||
|
||||
load2(State, Address) ->
|
||||
@@ -959,7 +983,7 @@ load2(State, Address) ->
|
||||
{ok, Source} ->
|
||||
load3(State, Address, Source);
|
||||
Error ->
|
||||
ok = handle_troubling(Error, State),
|
||||
ok = handle_troubling(State, Error),
|
||||
State
|
||||
end.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-module(gmc_v_netman).
|
||||
-vsn("0.3.0").
|
||||
-vsn("0.3.1").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
-license("GPL-3.0-or-later").
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-module(gmc_v_wallman).
|
||||
-vsn("0.3.0").
|
||||
-vsn("0.3.1").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
-license("GPL-3.0-or-later").
|
||||
|
||||
Reference in New Issue
Block a user