Merge pull request #102 from aeternity/PT-166927306-names-as-strings
Use a name string rather than a name hash in transfer and revoke
This commit is contained in:
commit
f67d7354a2
@ -2,7 +2,8 @@
|
||||
|
||||
{erl_opts, [debug_info]}.
|
||||
|
||||
{deps, [ {aebytecode, {git, "https://github.com/aeternity/aebytecode.git", {ref,"c63ac88"}}}
|
||||
{deps, [ {aebytecode, {git, "https://github.com/aeternity/aebytecode.git",
|
||||
{ref,"76ae61b"}}}
|
||||
, {getopt, "1.0.1"}
|
||||
, {eblake2, "1.0.0"}
|
||||
, {jsx, {git, "https://github.com/talentdeficit/jsx.git",
|
||||
|
@ -1,7 +1,7 @@
|
||||
{"1.1.0",
|
||||
[{<<"aebytecode">>,
|
||||
{git,"https://github.com/aeternity/aebytecode.git",
|
||||
{ref,"c63ac888dd71c305cbc6d4f70953a176bf1f78f7"}},
|
||||
{ref,"76ae61b66c7609ffbd42b1722f42457d708d737e"}},
|
||||
0},
|
||||
{<<"aeserialization">>,
|
||||
{git,"https://github.com/aeternity/aeserialization.git",
|
||||
|
@ -441,8 +441,8 @@ global_env() ->
|
||||
[{"resolve", Fun([String, String], option_t(Ann, A))},
|
||||
{"preclaim", SignFun([Address, Hash], Unit)},
|
||||
{"claim", SignFun([Address, String, Int], Unit)},
|
||||
{"transfer", SignFun([Address, Address, Hash], Unit)},
|
||||
{"revoke", SignFun([Address, Hash], Unit)}]) },
|
||||
{"transfer", SignFun([Address, Address, String], Unit)},
|
||||
{"revoke", SignFun([Address, String], Unit)}]) },
|
||||
|
||||
MapScope = #scope
|
||||
{ funs = MkDefs(
|
||||
|
@ -266,15 +266,15 @@ ast_body(?qid_app(["AENS", "claim"], Args, _, _), Icode) ->
|
||||
[word, string, word, sign_t()], {tuple, []});
|
||||
|
||||
ast_body(?qid_app(["AENS", "transfer"], Args, _, _), Icode) ->
|
||||
{Sign, [FromAddr, ToAddr, NameHash]} = get_signature_arg(Args),
|
||||
{Sign, [FromAddr, ToAddr, Name]} = get_signature_arg(Args),
|
||||
prim_call(?PRIM_CALL_AENS_TRANSFER, #integer{value = 0},
|
||||
[ast_body(FromAddr, Icode), ast_body(ToAddr, Icode), ast_body(NameHash, Icode), ast_body(Sign, Icode)],
|
||||
[ast_body(FromAddr, Icode), ast_body(ToAddr, Icode), ast_body(Name, Icode), ast_body(Sign, Icode)],
|
||||
[word, word, word, sign_t()], {tuple, []});
|
||||
|
||||
ast_body(?qid_app(["AENS", "revoke"], Args, _, _), Icode) ->
|
||||
{Sign, [Addr, NameHash]} = get_signature_arg(Args),
|
||||
{Sign, [Addr, Name]} = get_signature_arg(Args),
|
||||
prim_call(?PRIM_CALL_AENS_REVOKE, #integer{value = 0},
|
||||
[ast_body(Addr, Icode), ast_body(NameHash, Icode), ast_body(Sign, Icode)],
|
||||
[ast_body(Addr, Icode), ast_body(Name, Icode), ast_body(Sign, Icode)],
|
||||
[word, word, sign_t()], {tuple, []});
|
||||
|
||||
ast_body({qid, _, ["AENS", "resolve"]}, _Icode) -> gen_error({underapplied_primitive, 'AENS.resolve'});
|
||||
|
@ -35,21 +35,21 @@ contract AENSTest =
|
||||
|
||||
stateful entrypoint transfer(owner : address,
|
||||
new_owner : address,
|
||||
name_hash : hash) : () =
|
||||
AENS.transfer(owner, new_owner, name_hash)
|
||||
name : string) : () =
|
||||
AENS.transfer(owner, new_owner, name)
|
||||
|
||||
stateful entrypoint signedTransfer(owner : address,
|
||||
new_owner : address,
|
||||
name_hash : hash,
|
||||
name : string,
|
||||
sign : signature) : () =
|
||||
AENS.transfer(owner, new_owner, name_hash, signature = sign)
|
||||
AENS.transfer(owner, new_owner, name, signature = sign)
|
||||
|
||||
stateful entrypoint revoke(owner : address,
|
||||
name_hash : hash) : () =
|
||||
AENS.revoke(owner, name_hash)
|
||||
name : string) : () =
|
||||
AENS.revoke(owner, name)
|
||||
|
||||
stateful entrypoint signedRevoke(owner : address,
|
||||
name_hash : hash,
|
||||
name : string,
|
||||
sign : signature) : () =
|
||||
AENS.revoke(owner, name_hash, signature = sign)
|
||||
AENS.revoke(owner, name, signature = sign)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user