Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(core): fix agent registration test #624

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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