From 977cc4871873c504c0401ff09a0d13484c05dd16 Mon Sep 17 00:00:00 2001 From: Peter Harpending Date: Wed, 2 Dec 2026 16:04:06 -0800 Subject: [PATCH] rubbbiconnnnnn --- x05-rq/ct/names.aes | 8 ++------ x05-rq/src/rq.erl | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/x05-rq/ct/names.aes b/x05-rq/ct/names.aes index d3e5c9d..629e58b 100644 --- a/x05-rq/ct/names.aes +++ b/x05-rq/ct/names.aes @@ -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) diff --git a/x05-rq/src/rq.erl b/x05-rq/src/rq.erl index 573572f..bd8ff25 100644 --- a/x05-rq/src/rq.erl +++ b/x05-rq/src/rq.erl @@ -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()).