Merge pull request 'Allow spending to contract addresses' (#23) from contract-spend into master
Reviewed-on: #23
This commit was merged in pull request #23.
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
{included_applications,[]},
|
{included_applications,[]},
|
||||||
{applications,[stdlib,kernel]},
|
{applications,[stdlib,kernel]},
|
||||||
{description,"Gajumaru interoperation library"},
|
{description,"Gajumaru interoperation library"},
|
||||||
{vsn,"0.9.0"},
|
{vsn,"0.9.1"},
|
||||||
{modules,[hakuzaru,hz,hz_aaci,hz_fetcher,hz_format,hz_grids,
|
{modules,[hakuzaru,hz,hz_aaci,hz_fetcher,hz_format,hz_grids,
|
||||||
hz_key_master,hz_man,hz_sophia,hz_sup]},
|
hz_key_master,hz_man,hz_sophia,hz_sup]},
|
||||||
{mod,{hakuzaru,[]}}]}.
|
{mod,{hakuzaru,[]}}]}.
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(hakuzaru).
|
-module(hakuzaru).
|
||||||
-vsn("0.9.0").
|
-vsn("0.9.1").
|
||||||
-author("Craig Everett <ceverett@tsuriai.jp>").
|
-author("Craig Everett <ceverett@tsuriai.jp>").
|
||||||
-copyright("Craig Everett <ceverett@tsuriai.jp>").
|
-copyright("Craig Everett <ceverett@tsuriai.jp>").
|
||||||
-license("GPL-3.0-or-later").
|
-license("GPL-3.0-or-later").
|
||||||
|
|||||||
+6
-7
@@ -23,7 +23,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(hz).
|
-module(hz).
|
||||||
-vsn("0.9.0").
|
-vsn("0.9.1").
|
||||||
-author("Craig Everett <ceverett@tsuriai.jp>").
|
-author("Craig Everett <ceverett@tsuriai.jp>").
|
||||||
-copyright("Craig Everett <ceverett@tsuriai.jp>").
|
-copyright("Craig Everett <ceverett@tsuriai.jp>").
|
||||||
-license("GPL-3.0-or-later").
|
-license("GPL-3.0-or-later").
|
||||||
@@ -1708,7 +1708,7 @@ spend(SenderID,
|
|||||||
Nonce,
|
Nonce,
|
||||||
Payload,
|
Payload,
|
||||||
NetworkID) ->
|
NetworkID) ->
|
||||||
case decode_account_id(unicode:characters_to_binary(SenderID)) of
|
case gmser_api_encoder:safe_decode(account_pubkey, unicode:characters_to_binary(SenderID)) of
|
||||||
{ok, DSenderID} ->
|
{ok, DSenderID} ->
|
||||||
spend2(gmser_id:create(account, DSenderID),
|
spend2(gmser_id:create(account, DSenderID),
|
||||||
SecKey,
|
SecKey,
|
||||||
@@ -1752,11 +1752,10 @@ spend2(DSenderID,
|
|||||||
|
|
||||||
|
|
||||||
decode_account_id(B) ->
|
decode_account_id(B) ->
|
||||||
try
|
case gmser_api_encoder:safe_decode(account_pubkey, B) of
|
||||||
{account_pubkey, PK} = gmser_api_encoder:decode(B),
|
{ok, PK} -> {ok, PK};
|
||||||
{ok, PK}
|
{error, invalid_prefix} -> gmser_api_encoder:safe_decode(contract_pubkey, B);
|
||||||
catch
|
Error -> Error
|
||||||
E:R -> {E, R}
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(hz_aaci).
|
-module(hz_aaci).
|
||||||
-vsn("0.9.0").
|
-vsn("0.9.1").
|
||||||
-author("Jarvis Carroll <spiveehere@gmail.com>").
|
-author("Jarvis Carroll <spiveehere@gmail.com>").
|
||||||
-copyright("Craig Everett <ceverett@tsuriai.jp>").
|
-copyright("Craig Everett <ceverett@tsuriai.jp>").
|
||||||
-license("GPL-3.0-or-later").
|
-license("GPL-3.0-or-later").
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
-module(hz_fetcher).
|
-module(hz_fetcher).
|
||||||
-vsn("0.9.0").
|
-vsn("0.9.1").
|
||||||
-author("Craig Everett <ceverett@tsuriai.jp>").
|
-author("Craig Everett <ceverett@tsuriai.jp>").
|
||||||
-copyright("Craig Everett <ceverett@tsuriai.jp>").
|
-copyright("Craig Everett <ceverett@tsuriai.jp>").
|
||||||
-license("MIT").
|
-license("MIT").
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(hz_format).
|
-module(hz_format).
|
||||||
-vsn("0.9.0").
|
-vsn("0.9.1").
|
||||||
-author("Craig Everett <ceverett@tsuriai.jp>").
|
-author("Craig Everett <ceverett@tsuriai.jp>").
|
||||||
-copyright("Craig Everett <ceverett@tsuriai.jp>").
|
-copyright("Craig Everett <ceverett@tsuriai.jp>").
|
||||||
-license("GPL-3.0-or-later").
|
-license("GPL-3.0-or-later").
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(hz_grids).
|
-module(hz_grids).
|
||||||
-vsn("0.9.0").
|
-vsn("0.9.1").
|
||||||
-export([url/2, url/3, url/4, parse/1, req/2, req/3, req/4]).
|
-export([url/2, url/3, url/4, parse/1, req/2, req/3, req/4]).
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(hz_key_master).
|
-module(hz_key_master).
|
||||||
-vsn("0.9.0").
|
-vsn("0.9.1").
|
||||||
|
|
||||||
-export([make_key/1, encode/1, decode/1]).
|
-export([make_key/1, encode/1, decode/1]).
|
||||||
-export([lcg/1]).
|
-export([lcg/1]).
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(hz_man).
|
-module(hz_man).
|
||||||
-vsn("0.9.0").
|
-vsn("0.9.1").
|
||||||
-behavior(gen_server).
|
-behavior(gen_server).
|
||||||
-author("Craig Everett <ceverett@tsuriai.jp>").
|
-author("Craig Everett <ceverett@tsuriai.jp>").
|
||||||
-copyright("Craig Everett <ceverett@tsuriai.jp>").
|
-copyright("Craig Everett <ceverett@tsuriai.jp>").
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
-module(hz_sophia).
|
-module(hz_sophia).
|
||||||
-vsn("0.9.0").
|
-vsn("0.9.1").
|
||||||
-author("Jarvis Carroll <spiveehere@gmail.com>").
|
-author("Jarvis Carroll <spiveehere@gmail.com>").
|
||||||
-copyright("Jarvis Carroll <spiveehere@gmail.com>").
|
-copyright("Jarvis Carroll <spiveehere@gmail.com>").
|
||||||
-license("GPL-3.0-or-later").
|
-license("GPL-3.0-or-later").
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(hz_sup).
|
-module(hz_sup).
|
||||||
-vsn("0.9.0").
|
-vsn("0.9.1").
|
||||||
-behaviour(supervisor).
|
-behaviour(supervisor).
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
{name,"Hakuzaru"}.
|
{name,"Hakuzaru"}.
|
||||||
{type,app}.
|
{type,app}.
|
||||||
{modules,[]}.
|
{modules,[]}.
|
||||||
|
{author,"Craig Everett"}.
|
||||||
{prefix,"hz"}.
|
{prefix,"hz"}.
|
||||||
{desc,"Gajumaru interoperation library"}.
|
{desc,"Gajumaru interoperation library"}.
|
||||||
{author,"Craig Everett"}.
|
{package_id,{"otpr","hakuzaru",{0,9,1}}}.
|
||||||
{package_id,{"otpr","hakuzaru",{0,9,0}}}.
|
|
||||||
{deps,[{"otpr","sophia",{9,0,0}},
|
{deps,[{"otpr","sophia",{9,0,0}},
|
||||||
{"otpr","gmserialization",{0,1,3}},
|
{"otpr","gmserialization",{0,1,3}},
|
||||||
{"otpr","gmbytecode",{3,4,1}},
|
{"otpr","gmbytecode",{3,4,1}},
|
||||||
|
|||||||
Reference in New Issue
Block a user