Fix error modal calls. Can open a contract with a TX hash.
This commit is contained in:
parent
d9c9f2a794
commit
af69159eb5
@ -3,8 +3,8 @@
|
|||||||
{registered,[]},
|
{registered,[]},
|
||||||
{included_applications,[]},
|
{included_applications,[]},
|
||||||
{applications,[stdlib,kernel,sasl,ssl]},
|
{applications,[stdlib,kernel,sasl,ssl]},
|
||||||
{vsn,"0.3.0"},
|
{vsn,"0.3.1"},
|
||||||
{modules,[clutch,gmc_con,gmc_grids,gmc_gui,gmc_jt,
|
{modules,[clutch,gmc_con,gmc_grids,gmc_gui,gmc_jt,
|
||||||
gmc_key_master,gmc_sup,gmc_v,gmc_v_netman,
|
gmc_key_master,gmc_sup,gmc_v,gmc_v_devman,
|
||||||
gmc_v_wallman]},
|
gmc_v_netman,gmc_v_wallman]},
|
||||||
{mod,{clutch,[]}}]}.
|
{mod,{clutch,[]}}]}.
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(clutch).
|
-module(clutch).
|
||||||
-vsn("0.3.0").
|
-vsn("0.3.1").
|
||||||
-behavior(application).
|
-behavior(application).
|
||||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||||
-copyright("QPQ AG <info@qpq.swiss>").
|
-copyright("QPQ AG <info@qpq.swiss>").
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(gmc_con).
|
-module(gmc_con).
|
||||||
-vsn("0.3.0").
|
-vsn("0.3.1").
|
||||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||||
-copyright("QPQ AG <info@qpq.swiss>").
|
-copyright("QPQ AG <info@qpq.swiss>").
|
||||||
-license("GPL-3.0-or-later").
|
-license("GPL-3.0-or-later").
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(gmc_grids).
|
-module(gmc_grids).
|
||||||
-vsn("0.3.0").
|
-vsn("0.3.1").
|
||||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||||
-copyright("QPQ AG <info@qpq.swiss>").
|
-copyright("QPQ AG <info@qpq.swiss>").
|
||||||
-license("GPL-3.0-or-later").
|
-license("GPL-3.0-or-later").
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(gmc_gui).
|
-module(gmc_gui).
|
||||||
-vsn("0.3.0").
|
-vsn("0.3.1").
|
||||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||||
-copyright("QPQ AG <info@qpq.swiss>").
|
-copyright("QPQ AG <info@qpq.swiss>").
|
||||||
-license("GPL-3.0-or-later").
|
-license("GPL-3.0-or-later").
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
%%% translation library is retained).
|
%%% translation library is retained).
|
||||||
|
|
||||||
-module(gmc_jt).
|
-module(gmc_jt).
|
||||||
-vsn("0.3.0").
|
-vsn("0.3.1").
|
||||||
-export([read_translations/1, j/2, oneshot_j/2]).
|
-export([read_translations/1, j/2, oneshot_j/2]).
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(gmc_key_master).
|
-module(gmc_key_master).
|
||||||
-vsn("0.3.0").
|
-vsn("0.3.1").
|
||||||
|
|
||||||
|
|
||||||
-export([make_key/2, encode/1, decode/1]).
|
-export([make_key/2, encode/1, decode/1]).
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(gmc_sup).
|
-module(gmc_sup).
|
||||||
-vsn("0.3.0").
|
-vsn("0.3.1").
|
||||||
-behaviour(supervisor).
|
-behaviour(supervisor).
|
||||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||||
-copyright("QPQ AG <info@qpq.swiss>").
|
-copyright("QPQ AG <info@qpq.swiss>").
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
-module(gmc_v).
|
-module(gmc_v).
|
||||||
-vsn("0.3.0").
|
-vsn("0.3.1").
|
||||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||||
-copyright("QPQ AG <info@qpq.swiss>").
|
-copyright("QPQ AG <info@qpq.swiss>").
|
||||||
-license("GPL-3.0-or-later").
|
-license("GPL-3.0-or-later").
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
-module(gmc_v_devman).
|
-module(gmc_v_devman).
|
||||||
-vsn("0.3.0").
|
-vsn("0.3.1").
|
||||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||||
-copyright("QPQ AG <info@qpq.swiss>").
|
-copyright("QPQ AG <info@qpq.swiss>").
|
||||||
-license("GPL-3.0-or-later").
|
-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);
|
add_code_page(State, {file, File}, Code);
|
||||||
Error ->
|
Error ->
|
||||||
Message = io_lib:format(J("Opening ~p failed with: ~p"), [File, Error]),
|
Message = io_lib:format(J("Opening ~p failed with: ~p"), [File, Error]),
|
||||||
ok = handle_troubling(Message, State),
|
ok = handle_troubling(State, Message),
|
||||||
State
|
State
|
||||||
end;
|
end;
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
Message = io_lib:format(J("Opening ~p failed with: ~p"), [File, Reason]),
|
Message = io_lib:format(J("Opening ~p failed with: ~p"), [File, Reason]),
|
||||||
ok = handle_troubling(Message, State),
|
ok = handle_troubling(State, Message),
|
||||||
State
|
State
|
||||||
end;
|
end;
|
||||||
add_code_page2(State, {hash, Address}) ->
|
add_code_page2(State, {hash, Address}) ->
|
||||||
@ -734,16 +734,28 @@ open_hash(State = #s{frame = Frame, j = J}) ->
|
|||||||
end,
|
end,
|
||||||
ok = wxDialog:destroy(Dialog),
|
ok = wxDialog:destroy(Dialog),
|
||||||
case Choice of
|
case Choice of
|
||||||
{ok, Address} -> open_hash2(State, Address);
|
{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
|
cancel -> State
|
||||||
end.
|
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) ->
|
open_hash2(State, Address) ->
|
||||||
case hz:contract_source(Address) of
|
case hz:contract_source(Address) of
|
||||||
{ok, Source} ->
|
{ok, Source} ->
|
||||||
open_hash3(State, Address, Source);
|
open_hash3(State, Address, Source);
|
||||||
Error ->
|
Error ->
|
||||||
ok = handle_troubling(Error, State),
|
ok = handle_troubling(State, Error),
|
||||||
State
|
State
|
||||||
end.
|
end.
|
||||||
|
|
||||||
@ -950,16 +962,28 @@ load(State = #s{frame = Frame, j = J}) ->
|
|||||||
end,
|
end,
|
||||||
ok = wxDialog:destroy(Dialog),
|
ok = wxDialog:destroy(Dialog),
|
||||||
case Choice of
|
case Choice of
|
||||||
{ok, Address} -> load2(State, Address);
|
{ok, Address = "ct_" ++ _} -> load2(State, Address);
|
||||||
|
{ok, Address = "th_" ++ _} -> load_from_tx(State, Address);
|
||||||
|
{ok, Turd} -> handle_troubling(State, {bad_address, Turd});
|
||||||
cancel -> State
|
cancel -> State
|
||||||
end.
|
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) ->
|
load2(State, Address) ->
|
||||||
case hz:contract_source(Address) of
|
case hz:contract_source(Address) of
|
||||||
{ok, Source} ->
|
{ok, Source} ->
|
||||||
load3(State, Address, Source);
|
load3(State, Address, Source);
|
||||||
Error ->
|
Error ->
|
||||||
ok = handle_troubling(Error, State),
|
ok = handle_troubling(State, Error),
|
||||||
State
|
State
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
-module(gmc_v_netman).
|
-module(gmc_v_netman).
|
||||||
-vsn("0.3.0").
|
-vsn("0.3.1").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("QPQ AG <info@qpq.swiss>").
|
-copyright("QPQ AG <info@qpq.swiss>").
|
||||||
-license("GPL-3.0-or-later").
|
-license("GPL-3.0-or-later").
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
-module(gmc_v_wallman).
|
-module(gmc_v_wallman).
|
||||||
-vsn("0.3.0").
|
-vsn("0.3.1").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("QPQ AG <info@qpq.swiss>").
|
-copyright("QPQ AG <info@qpq.swiss>").
|
||||||
-license("GPL-3.0-or-later").
|
-license("GPL-3.0-or-later").
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
{type,gui}.
|
{type,gui}.
|
||||||
{modules,[]}.
|
{modules,[]}.
|
||||||
{prefix,"gmc"}.
|
{prefix,"gmc"}.
|
||||||
{author,"Craig Everett"}.
|
|
||||||
{desc,"A desktop client for the Gajumaru network of blockchain networks"}.
|
{desc,"A desktop client for the Gajumaru network of blockchain networks"}.
|
||||||
{package_id,{"otpr","clutch",{0,3,0}}}.
|
{author,"Craig Everett"}.
|
||||||
{deps,[{"otpr","sophia",{9,0,0}},
|
{package_id,{"otpr","clutch",{0,3,1}}}.
|
||||||
|
{deps,[{"otpr","gmserialization",{0,1,3}},
|
||||||
|
{"otpr","sophia",{9,0,0}},
|
||||||
{"otpr","hakuzaru",{0,3,0}},
|
{"otpr","hakuzaru",{0,3,0}},
|
||||||
{"otpr","gmbytecode",{3,4,1}},
|
{"otpr","gmbytecode",{3,4,1}},
|
||||||
{"otpr","lom",{1,0,0}},
|
{"otpr","lom",{1,0,0}},
|
||||||
{"otpr","gmserialization",{0,1,2}},
|
|
||||||
{"otpr","zj",{1,1,0}},
|
{"otpr","zj",{1,1,0}},
|
||||||
{"otpr","erl_base58",{0,1,0}},
|
{"otpr","erl_base58",{0,1,0}},
|
||||||
{"otpr","eblake2",{1,0,0}},
|
{"otpr","eblake2",{1,0,0}},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user