From fdf39a4aef049acc1c0254ce76a9e4373ef25692 Mon Sep 17 00:00:00 2001 From: Alejandro-Morales Date: Thu, 29 Jun 2023 09:32:09 -0600 Subject: [PATCH 1/4] feat: uodates on new V of name service contract --- src/uagents/config.py | 2 +- src/uagents/network.py | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/uagents/config.py b/src/uagents/config.py index e46923b2..cac0db7f 100644 --- a/src/uagents/config.py +++ b/src/uagents/config.py @@ -18,7 +18,7 @@ class AgentNetwork(Enum): USER_PREFIX = "user" CONTRACT_ALMANAC = "fetch1h5rhtj5m6dqjmufj5m3t4mq6l7cnd8dvaxclwmrk6tfdm0gy3lmszksf0s" CONTRACT_NAME_SERVICE = ( - "fetch1yrf4xpglq02fzj50m9wn44qdq89a5vr0ufa42qa506uhwal4n79s99sp87" + "fetch1mxz8kn3l5ksaftx8a9pj9a6prpzk2uhxnqdkwuqvuh37tw80xu6qges77l" ) REGISTRATION_FEE = 500000000000000000 REGISTRATION_DENOM = "atestfet" diff --git a/src/uagents/network.py b/src/uagents/network.py index b12ea86e..ec8786e3 100644 --- a/src/uagents/network.py +++ b/src/uagents/network.py @@ -121,14 +121,8 @@ def get_registration_tx(self, name: str, wallet_address: str, agent_address: str transaction = Transaction() - ownership_msg = self._get_ownership_msg(name, wallet_address) registration_msg = self._get_registration_msg(name, agent_address) - transaction.add_message( - create_cosmwasm_execute_msg( - wallet_address, CONTRACT_NAME_SERVICE, ownership_msg - ) - ) transaction.add_message( create_cosmwasm_execute_msg( wallet_address, CONTRACT_NAME_SERVICE, registration_msg From 00000a17b480190fc529e903d7439b48cfc6cf47 Mon Sep 17 00:00:00 2001 From: Alejandro-Morales Date: Thu, 29 Jun 2023 09:42:59 -0600 Subject: [PATCH 2/4] fix: tests --- tests/test_agent_registration.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/tests/test_agent_registration.py b/tests/test_agent_registration.py index 70c36f14..dc9ebfa7 100644 --- a/tests/test_agent_registration.py +++ b/tests/test_agent_registration.py @@ -48,23 +48,6 @@ def test_alamanc_failed_registration(self): "Shouldn't be registered on alamanac", ) - def test_name_service_ownership(self): - agent = Agent() - fund_agent_if_low(agent.wallet.address()) - - ownership_msg = agent._service_contract._get_ownership_msg( - agent.name, str(agent.wallet.address()) - ) - - transaction = agent._service_contract.execute(ownership_msg, agent.wallet) - - transaction.wait_to_complete() - - is_owner = agent._service_contract.is_owner( - agent.name, str(agent.wallet.address()) - ) - - self.assertEqual(is_owner, True, "Domain ownership failed") def test_name_service_failed_ownership(self): agent = Agent() @@ -110,14 +93,10 @@ def test_registration(self): ) self.assertEqual(is_owner, False) - ownership_msg = agent._service_contract._get_ownership_msg( - agent.name, str(agent.wallet.address()) - ) registration_msg = agent._service_contract._get_registration_msg( agent.name, agent.address ) - agent._service_contract.execute(ownership_msg, agent.wallet).wait_to_complete() agent._service_contract.execute( registration_msg, agent.wallet ).wait_to_complete() From 68a62ffa0cbe462c6413ca1632e2e26cdadd558c Mon Sep 17 00:00:00 2001 From: Alejandro-Morales Date: Thu, 29 Jun 2023 09:45:19 -0600 Subject: [PATCH 3/4] fix: lint --- tests/test_agent_registration.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_agent_registration.py b/tests/test_agent_registration.py index dc9ebfa7..b450d877 100644 --- a/tests/test_agent_registration.py +++ b/tests/test_agent_registration.py @@ -48,7 +48,6 @@ def test_alamanc_failed_registration(self): "Shouldn't be registered on alamanac", ) - def test_name_service_failed_ownership(self): agent = Agent() From afd50f318b873162cc7d92c675186db24121d6c3 Mon Sep 17 00:00:00 2001 From: Alejandro-Morales Date: Fri, 30 Jun 2023 09:34:30 -0600 Subject: [PATCH 4/4] delete get_ownership_msg --- src/uagents/network.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/uagents/network.py b/src/uagents/network.py index ec8786e3..4268161b 100644 --- a/src/uagents/network.py +++ b/src/uagents/network.py @@ -98,15 +98,6 @@ def is_owner(self, name: str, wallet_address: str): permission = self.query(query_msg)["permissions"] return permission == "admin" - def _get_ownership_msg(self, name: str, wallet_address: str): - return { - "update_ownership": { - "domain": f"{name}.agent", - "owner": {"address": {"address": wallet_address}}, - "permissions": "admin", - } - } - def _get_registration_msg(self, name: str, address: str): return { "register": {