rubbbiconnnnnn
This commit is contained in:
+2
-6
@@ -11,9 +11,5 @@ contract Names =
|
|||||||
stateful entrypoint register(name: string, addr: Rubicon): unit =
|
stateful entrypoint register(name: string, addr: Rubicon): unit =
|
||||||
put(state{[name] = addr})
|
put(state{[name] = addr})
|
||||||
|
|
||||||
stateful entrypoint lookup(name: string): option(list(rbx_tuple)) =
|
stateful entrypoint lookup(name: string): list(rbx_tuple) =
|
||||||
switch(Map.lookup(name, state))
|
Map.lookup(name, state)
|
||||||
Some(addr) =>
|
|
||||||
Some(addr.lookup())
|
|
||||||
None =>
|
|
||||||
None
|
|
||||||
|
|||||||
+14
-3
@@ -307,7 +307,7 @@ rq_query([Ct = "ct_" ++ _ | Rest]) ->
|
|||||||
rq_query(Rest);
|
rq_query(Rest);
|
||||||
rq_query([ThStr = "th" ++ _ | Rest]) ->
|
rq_query([ThStr = "th" ++ _ | Rest]) ->
|
||||||
io:format("ThStr = ~tp~n", [ThStr]),
|
io:format("ThStr = ~tp~n", [ThStr]),
|
||||||
io:format("ExplorerUrl = ~tp~n", ["null"]),
|
io:format("ExplorerUrl = ~ts~n", [explorer_url(ThStr)]),
|
||||||
{ok, TxInfo} = hz:tx_info(ThStr),
|
{ok, TxInfo} = hz:tx_info(ThStr),
|
||||||
#{"call_info" := #{"return_value" := CbStr}} = TxInfo,
|
#{"call_info" := #{"return_value" := CbStr}} = TxInfo,
|
||||||
rq_decode(CbStr),
|
rq_decode(CbStr),
|
||||||
@@ -315,6 +315,9 @@ rq_query([ThStr = "th" ++ _ | Rest]) ->
|
|||||||
rq_query([]) ->
|
rq_query([]) ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
explorer_url(ThStr = "th" ++ _) ->
|
||||||
|
"https://groot.testnet.gajumaru.io/tx/" ++ ThStr.
|
||||||
|
|
||||||
rq_src(["names.aes"]) ->
|
rq_src(["names.aes"]) ->
|
||||||
{ok, Bytes} = file:read_file(nct_filepath()),
|
{ok, Bytes} = file:read_file(nct_filepath()),
|
||||||
io:format("~s", [Bytes]);
|
io:format("~s", [Bytes]);
|
||||||
@@ -385,7 +388,9 @@ dbg_rct() ->
|
|||||||
|
|
||||||
|
|
||||||
rq_register(Name) ->
|
rq_register(Name) ->
|
||||||
ct_call(nct_aaci(), nct_ctstr(), "register", [Name]).
|
ct_call(nct_aaci(), nct_ctstr(), "register", [Name, ctstr(<<0:(32 * 8)>>)]).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
rq_lookup(Name) ->
|
rq_lookup(Name) ->
|
||||||
@@ -397,7 +402,7 @@ ct_call(AACI, CtStr, FunName, ErlArgs) ->
|
|||||||
{ok, PostResult} = hz:post_tx(SignedTx),
|
{ok, PostResult} = hz:post_tx(SignedTx),
|
||||||
case PostResult of
|
case PostResult of
|
||||||
#{"tx_hash" := ThStr} ->
|
#{"tx_hash" := ThStr} ->
|
||||||
rq_query(ThStr);
|
rq_query([ThStr]);
|
||||||
#{"error" := NodeErr} ->
|
#{"error" := NodeErr} ->
|
||||||
io:format("ERROR: node sent back the following extremely helpful error message~n", []),
|
io:format("ERROR: node sent back the following extremely helpful error message~n", []),
|
||||||
io:format("NodeErr = ~tp~n", [NodeErr]),
|
io:format("NodeErr = ~tp~n", [NodeErr]),
|
||||||
@@ -445,6 +450,12 @@ ct_dir() ->
|
|||||||
my_akstr() ->
|
my_akstr() ->
|
||||||
unicode:characters_to_list(gmser_api_encoder:encode(account_pubkey, my_pubkey32())).
|
unicode:characters_to_list(gmser_api_encoder:encode(account_pubkey, my_pubkey32())).
|
||||||
|
|
||||||
|
akstr(X) ->
|
||||||
|
unicode:characters_to_list(gmser_api_encoder:encode(account_pubkey, X)).
|
||||||
|
|
||||||
|
ctstr(X) ->
|
||||||
|
unicode:characters_to_list(gmser_api_encoder:encode(contract_pubkey, X)).
|
||||||
|
|
||||||
my_pubkey32() ->
|
my_pubkey32() ->
|
||||||
maps:get(public, my_keypair()).
|
maps:get(public, my_keypair()).
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user