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

fix: name registration test #223

Closed
wants to merge 5 commits into from
Closed
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
14 changes: 10 additions & 4 deletions python/tests/test_agent_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ def test_name_service_failed_ownership(self):
self.assertEqual(is_owner, False, "Agent shouldn't own any domain")

async def test_name_service_registration(self):
agent = Agent(endpoint=["http://localhost:8000/submit"])
agent = Agent(
endpoint=["http://localhost:8000/submit"],
name="testingagent",
seed="testingagent",
)

domain = "agent"

Expand All @@ -61,12 +65,14 @@ async def test_name_service_registration(self):
name_service_contract = get_name_service_contract(test=True)

is_name_available = name_service_contract.is_name_available(agent.name, domain)
self.assertEqual(is_name_available, True, "Agent name should be available")

is_owner = name_service_contract.is_owner(
agent.name, domain, str(agent.wallet.address())
)
self.assertEqual(is_owner, False)
self.assertEqual(
is_name_available or is_owner,
True,
"Agent name should be available or agent should be owner",
)

await name_service_contract.register(
agent._ledger, agent.wallet, agent.address, agent.name, domain=domain
Expand Down
Loading