Skip to content

Commit

Permalink
test(core): fix agent registration test
Browse files Browse the repository at this point in the history
  • Loading branch information
jrriehl committed Jan 31, 2025
1 parent 759ca70 commit 0aa27c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions python/src/uagents/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/src/uagents/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 0aa27c4

Please sign in to comment.