diff --git a/ebin/clutch.app b/ebin/clutch.app index 1e496c0..cd50d62 100644 --- a/ebin/clutch.app +++ b/ebin/clutch.app @@ -3,7 +3,7 @@ {registered,[]}, {included_applications,[]}, {applications,[stdlib,kernel]}, - {vsn,"0.1.3"}, + {vsn,"0.1.4"}, {modules,[clutch,gmc_con,gmc_grids,gmc_gui,gmc_jt, gmc_key_master,gmc_sup,gmc_v,gmc_v_netman, gmc_v_wallman]}, diff --git a/src/clutch.erl b/src/clutch.erl index f553c53..777272e 100644 --- a/src/clutch.erl +++ b/src/clutch.erl @@ -3,7 +3,7 @@ %%% @end -module(clutch). --vsn("0.1.3"). +-vsn("0.1.4"). -behavior(application). -author("Craig Everett "). -copyright("QPQ AG "). diff --git a/src/gmc_con.erl b/src/gmc_con.erl index ab5b942..79e82f9 100644 --- a/src/gmc_con.erl +++ b/src/gmc_con.erl @@ -5,7 +5,7 @@ %%% @end -module(gmc_con). --vsn("0.1.3"). +-vsn("0.1.4"). -author("Craig Everett "). -copyright("QPQ AG "). -license("GPL-3.0-or-later"). @@ -63,12 +63,12 @@ show_ui(Name) -> gen_server:cast(?MODULE, {show_ui, Name}). --spec open_wallet(Path, Password) -> ok - when Path :: file:filename(), - Password :: string(). +-spec open_wallet(Path, Phrase) -> ok + when Path :: file:filename(), + Phrase :: string(). -open_wallet(Path, Password) -> - gen_server:cast(?MODULE, {open_wallet, Path, Password}). +open_wallet(Path, Phrase) -> + gen_server:cast(?MODULE, {open_wallet, Path, Phrase}). -spec close_wallet() -> ok. @@ -787,17 +787,20 @@ do_make_key(Name, Seed, base58, Transform, State) -> end. -do_make_key2(Name, Bin, Transform, State = #s{wallet = W}) -> - #wallet{poas = POAs, keys = Keys} = W, +do_make_key2(Name, Bin, Transform, + State = #s{wallet = Current, wallets = Wallets, pass = Pass}) -> + #wallet{name = WalletName, poas = POAs, keys = Keys} = Current, T = transform(Transform), Seed = T(Bin), Key = #key{name = KeyName, id = ID} = gmc_key_master:make_key(Name, Seed), POA = #poa{name = KeyName, id = ID}, NewKeys = [Key | Keys], NewPOAs = [POA | POAs], - NewWallet = W#wallet{poas = NewPOAs, keys = NewKeys}, + Updated = Current#wallet{poas = NewPOAs, keys = NewKeys}, + RW = lists:keyfind(WalletName, #wr.name, Wallets), + ok = save_wallet(RW, Pass, Updated), ok = gmc_gui:show(NewPOAs), - State#s{wallet = NewWallet}. + State#s{wallet = Updated}. base64_decode(String) -> @@ -836,17 +839,19 @@ do_recover_key(Mnemonic, State) -> State end. -do_recover_key2(Seed, State = #s{wallet = W}) -> - #wallet{keys = Keys, poas = POAs} = W, - Recovered = #key{id = ID, name = Name} = gmc_key_master:make_key("", Seed), +do_recover_key2(Seed, State = #s{wallet = Current, wallets = Wallets, pass = Pass}) -> + #wallet{name = WalletName, keys = Keys, poas = POAs} = Current, + Recovered = #key{id = ID, name = AccName} = gmc_key_master:make_key("", Seed), case lists:keymember(ID, #key.id, Keys) of false -> NewKeys = [Recovered | Keys], - POA = #poa{name = Name, id = ID}, + POA = #poa{name = AccName, id = ID}, NewPOAs = [POA | POAs], ok = gmc_gui:show(NewPOAs), - NewWallet = W#wallet{poas = NewPOAs, keys = NewKeys}, - State#s{wallet = NewWallet}; + Updated = Current#wallet{poas = NewPOAs, keys = NewKeys}, + RW = lists:keyfind(WalletName, #wr.name, Wallets), + ok = save_wallet(RW, Pass, Updated), + State#s{wallet = Updated}; true -> State end. @@ -893,7 +898,7 @@ do_open_wallet(Path, Phrase, State) -> {ok, ChainID} -> gmc_gui:chain(ChainID, Node); Error -> gmc_gui:trouble(Error) end, - State#s{wallet = Recovered}; + State#s{pass = Pass, wallet = Recovered}; Error -> ok = gmc_gui:trouble(Error), New = default_wallet(), diff --git a/src/gmc_grids.erl b/src/gmc_grids.erl index 96aaabe..ba6e1bf 100644 --- a/src/gmc_grids.erl +++ b/src/gmc_grids.erl @@ -37,7 +37,7 @@ %%% @end -module(gmc_grids). --vsn("0.1.3"). +-vsn("0.1.4"). -author("Craig Everett "). -copyright("QPQ AG "). -license("GPL-3.0-or-later"). diff --git a/src/gmc_gui.erl b/src/gmc_gui.erl index 4b3d717..3544f03 100644 --- a/src/gmc_gui.erl +++ b/src/gmc_gui.erl @@ -7,7 +7,7 @@ %%% @end -module(gmc_gui). --vsn("0.1.3"). +-vsn("0.1.4"). -author("Craig Everett "). -copyright("QPQ AG "). -license("GPL-3.0-or-later"). diff --git a/src/gmc_jt.erl b/src/gmc_jt.erl index 20819f8..510f277 100644 --- a/src/gmc_jt.erl +++ b/src/gmc_jt.erl @@ -15,7 +15,7 @@ %%% translation library is retained). -module(gmc_jt). --vsn("0.1.3"). +-vsn("0.1.4"). -export([read_translations/1, j/2, oneshot_j/2]). diff --git a/src/gmc_key_master.erl b/src/gmc_key_master.erl index c41c3d1..1f92aef 100644 --- a/src/gmc_key_master.erl +++ b/src/gmc_key_master.erl @@ -8,7 +8,7 @@ %%% @end -module(gmc_key_master). --vsn("0.1.3"). +-vsn("0.1.4"). -export([make_key/2, encode/1, decode/1]). diff --git a/src/gmc_sup.erl b/src/gmc_sup.erl index 7132232..0bece53 100644 --- a/src/gmc_sup.erl +++ b/src/gmc_sup.erl @@ -12,7 +12,7 @@ %%% @end -module(gmc_sup). --vsn("0.1.3"). +-vsn("0.1.4"). -behaviour(supervisor). -author("Craig Everett "). -copyright("QPQ AG "). diff --git a/src/gmc_v.erl b/src/gmc_v.erl index 71e207c..31c0457 100644 --- a/src/gmc_v.erl +++ b/src/gmc_v.erl @@ -1,5 +1,5 @@ -module(gmc_v). --vsn("0.1.3"). +-vsn("0.1.4"). -author("Craig Everett "). -copyright("QPQ AG "). -license("GPL-3.0-or-later"). diff --git a/src/gmc_v_netman.erl b/src/gmc_v_netman.erl index 559a22b..d94c1bf 100644 --- a/src/gmc_v_netman.erl +++ b/src/gmc_v_netman.erl @@ -1,5 +1,5 @@ -module(gmc_v_netman). --vsn("0.1.3"). +-vsn("0.1.4"). -author("Craig Everett "). -copyright("QPQ AG "). -license("GPL-3.0-or-later"). diff --git a/src/gmc_v_wallman.erl b/src/gmc_v_wallman.erl index f86aa15..214ac8e 100644 --- a/src/gmc_v_wallman.erl +++ b/src/gmc_v_wallman.erl @@ -1,5 +1,5 @@ -module(gmc_v_wallman). --vsn("0.1.3"). +-vsn("0.1.4"). -author("Craig Everett "). -copyright("QPQ AG "). -license("GPL-3.0-or-later"). @@ -221,9 +221,10 @@ do_open3(Path, State = #s{frame = Frame, j = J}) -> Affirm = wxButton:new(Dialog, ?wxID_OK), _ = wxBoxSizer:add(ButtSz, Affirm, zxw:flags(wide)), _ = wxBoxSizer:add(Sizer, PassSz, zxw:flags(base)), - _ = wxBoxSizer:add(Sizer, ButtSz, zxw:flags(base)), + _ = wxBoxSizer:add(Sizer, ButtSz, zxw:flags(wide)), ok = wxDialog:setSizer(Dialog, Sizer), ok = wxBoxSizer:layout(Sizer), + ok = wxDialog:setSize(Dialog, {500, 130}), ok = wxFrame:center(Dialog), ok = wxStyledTextCtrl:setFocus(PassTx), case wxDialog:showModal(Dialog) of @@ -232,9 +233,9 @@ do_open3(Path, State = #s{frame = Frame, j = J}) -> "" -> ok = wxDialog:destroy(Dialog), State; - Password -> + Phrase -> ok = wxDialog:destroy(Dialog), - ok = gmc_con:open_wallet(Path, Password), + ok = gmc_con:open_wallet(Path, Phrase), ok = do_close(State), State end; diff --git a/zomp.meta b/zomp.meta index 575d8a9..d22e4e5 100644 --- a/zomp.meta +++ b/zomp.meta @@ -4,7 +4,7 @@ {prefix,"gmc"}. {desc,"A desktop client for the Gajumaru network of blockchain networks"}. {author,"Craig Everett"}. -{package_id,{"otpr","clutch",{0,1,3}}}. +{package_id,{"otpr","clutch",{0,1,4}}}. {deps,[{"otpr","hakuzaru",{0,2,0}}, {"otpr","aesophia",{8,0,1}}, {"otpr","aeserialization",{0,1,2}},