From 0aa27c4df4d38e076d2aac13b9283715f012f21a Mon Sep 17 00:00:00 2001 From: James Riehl Date: Fri, 31 Jan 2025 18:26:33 +0000 Subject: [PATCH] test(core): fix agent registration test --- python/src/uagents/network.py | 6 +++--- python/src/uagents/resolver.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/src/uagents/network.py b/python/src/uagents/network.py index bd030440..fc3c5173 100644 --- a/python/src/uagents/network.py +++ b/python/src/uagents/network.py @@ -553,7 +553,7 @@ def is_name_available(self, name: str, domain: str) -> bool: Returns: bool: True if the name is available, False otherwise. """ - query_msg = {"domain_record": {"domain": f"{name}.{domain}"}} + query_msg = {"query_domain_record": {"domain": f"{name}.{domain}"}} return self.query_contract(query_msg)["is_available"] def is_owner(self, name: str, domain: str, wallet_address: str) -> bool: @@ -606,7 +606,7 @@ def get_previous_records(self, name: str, domain: str): A list of dictionaries, where each dictionary contains details of a record associated with the given name. """ - query_msg = {"domain_record": {"domain": f"{name}.{domain}"}} + query_msg = {"query_domain_record": {"domain": f"{name}.{domain}"}} result = self.query_contract(query_msg) if result["record"] is not None: return result["record"]["records"][0]["agent_address"]["records"] @@ -643,7 +643,7 @@ def get_registration_tx( ) if self.is_name_available(name, domain): - price_per_second = self.query_contract({"contract_state": {}})[ + price_per_second = self.query_contract({"query_contract_state": {}})[ "price_per_second" ] amount = int(price_per_second["amount"]) * 86400 diff --git a/python/src/uagents/resolver.py b/python/src/uagents/resolver.py index 6c15858e..d807552f 100644 --- a/python/src/uagents/resolver.py +++ b/python/src/uagents/resolver.py @@ -138,7 +138,7 @@ def get_agent_address(name: str, network: AgentNetwork) -> Optional[str]: Returns: Optional[str]: The associated agent address if found. """ - query_msg = {"domain_record": {"domain": f"{name}"}} + query_msg = {"query_domain_record": {"domain": f"{name}"}} result = get_name_service_contract(network).query(query_msg) if result["record"] is not None: registered_records = result["record"]["records"][0]["agent_address"]["records"]