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