From c4ec8ca6669a147c2abb989be57e44d19652ddf5 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Mon, 11 Oct 2021 19:36:17 +0300 Subject: [PATCH 1/6] Revert "SKALE-4617 Update SM version in test pipeline" This reverts commit b0f5d9074951ad3ed08ce1b3687c34542ddb6ac1. --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b0bc19e8..cae6861f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: ETH_PRIVATE_KEY: ${{ secrets.ETH_PRIVATE_KEY }} ENDPOINT: ${{ secrets.ENDPOINT }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - MANAGER_TAG: "1.8.2-develop.25" + MANAGER_TAG: "1.8.1-develop.6" steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -44,7 +44,7 @@ jobs: python-version: [3.7] env: ETH_PRIVATE_KEY: ${{ secrets.ETH_PRIVATE_KEY }} - MANAGER_TAG: "1.8.2-develop.25" + MANAGER_TAG: "1.8.1-develop.6" ALLOCATOR_TAG: "2.2.0-develop.4" steps: - uses: actions/checkout@v2 From 003654b66ae814f6ae2e9d302688de82da840dc1 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Mon, 11 Oct 2021 19:36:50 +0300 Subject: [PATCH 2/6] Revert "SKALE-4617 Fix pytest skip in allocator tests" This reverts commit 04d265336ddd25e03a065496e208b0a5bc3eb985. --- tests/allocator/allocator_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/allocator/allocator_test.py b/tests/allocator/allocator_test.py index d1308292..c0bb4aef 100644 --- a/tests/allocator/allocator_test.py +++ b/tests/allocator/allocator_test.py @@ -99,7 +99,7 @@ def test_get_all_plans(skale_allocator): assert plan_params_with_id == plans[0] -@pytest.mark.skip('test should be updated') +@pytest.skip('test should be updated') def test_calculate_vested_amount(skale_allocator): wallet = generate_wallet(skale_allocator.web3) connect_test_beneficiary(skale_allocator, D_PLAN_ID, wallet) @@ -121,7 +121,8 @@ def test_get_lockup_period_end_timestamp(skale_allocator): assert res == D_END_LOCKUP_TIMESTAMP -@pytest.mark.skip('test should be updated') +# TODO: improve test +@pytest.skip('test should be updated') def test_get_time_of_next_vest(skale_allocator): wallet = generate_wallet(skale_allocator.web3) connect_test_beneficiary(skale_allocator, D_PLAN_ID, wallet) From 05d3742cf46188dd15e307226e94b59fea11d556 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Mon, 11 Oct 2021 19:36:57 +0300 Subject: [PATCH 3/6] Revert "SKALE-4617 Update allocator tests" This reverts commit 437a5fcde9794ff6e08da684572e80fb97a0d7d2. --- tests/allocator/allocator_test.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/allocator/allocator_test.py b/tests/allocator/allocator_test.py index c0bb4aef..e5e75f14 100644 --- a/tests/allocator/allocator_test.py +++ b/tests/allocator/allocator_test.py @@ -1,5 +1,4 @@ """ Tests for skale/allocator/allocator.py """ -import pytest from skale.wallets.web3_wallet import generate_wallet from skale.utils.account_tools import send_ether @@ -99,7 +98,6 @@ def test_get_all_plans(skale_allocator): assert plan_params_with_id == plans[0] -@pytest.skip('test should be updated') def test_calculate_vested_amount(skale_allocator): wallet = generate_wallet(skale_allocator.web3) connect_test_beneficiary(skale_allocator, D_PLAN_ID, wallet) @@ -122,7 +120,6 @@ def test_get_lockup_period_end_timestamp(skale_allocator): # TODO: improve test -@pytest.skip('test should be updated') def test_get_time_of_next_vest(skale_allocator): wallet = generate_wallet(skale_allocator.web3) connect_test_beneficiary(skale_allocator, D_PLAN_ID, wallet) From 5048085d448b1778ad20ec4a34dbf144b861b3b8 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Mon, 11 Oct 2021 19:37:15 +0300 Subject: [PATCH 4/6] Revert "SKALE-4617 Fix dkg test" This reverts commit 1e2cd4461fd5b62a1387962ba1ff638d9efdfe52. --- skale/contracts/manager/dkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skale/contracts/manager/dkg.py b/skale/contracts/manager/dkg.py index 771dddfb..e1b7ded4 100644 --- a/skale/contracts/manager/dkg.py +++ b/skale/contracts/manager/dkg.py @@ -59,7 +59,7 @@ def pre_response( group_index, fromNodeIndex=from_node_index, verificationVector=verification_vector, - verificationVectorMultiplication=verification_vector_mult, + verificationVectorMult=verification_vector_mult, secretKeyContribution=secret_key_contribution, ) From 0e9631f0a130d15f20008bf7f4bf7bc8eddcd6b2 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Mon, 11 Oct 2021 19:37:24 +0300 Subject: [PATCH 5/6] Revert "SKALE-4617 Update for the latest skale-manager" This reverts commit a362528564f0b0579cfb0d5ca8b4f14327f01247. --- skale/contracts/manager/constants_holder.py | 4 ++-- skale/contracts/manager/manager.py | 4 ++-- skale/contracts/manager/schains_internal.py | 2 +- skale/utils/contracts_provision/main.py | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/skale/contracts/manager/constants_holder.py b/skale/contracts/manager/constants_holder.py index dda23842..3d9a3828 100644 --- a/skale/contracts/manager/constants_holder.py +++ b/skale/contracts/manager/constants_holder.py @@ -81,11 +81,11 @@ def get_rotation_delay(self) -> int: return self.contract.functions.rotationDelay().call() def get_dkg_timeout(self) -> int: - return self.contract.functions.complaintTimeLimit().call() + return self.contract.functions.complaintTimelimit().call() @transaction_method def set_complaint_timelimit(self, complaint_timelimit: int): - return self.contract.functions.setComplaintTimeLimit(complaint_timelimit) + return self.contract.functions.setComplaintTimelimit(complaint_timelimit) @transaction_method def grant_role(self, role: bytes, address: str) -> TxRes: diff --git a/skale/contracts/manager/manager.py b/skale/contracts/manager/manager.py index ada38f7f..700546d2 100644 --- a/skale/contracts/manager/manager.py +++ b/skale/contracts/manager/manager.py @@ -98,8 +98,8 @@ def default_admin_role(self) -> bytes: def admin_role(self) -> bytes: return self.contract.functions.ADMIN_ROLE().call() - def schain_removal_role(self) -> bytes: - return self.contract.functions.SCHAIN_REMOVAL_ROLE().call() + def schain_deleter_role(self) -> bytes: + return self.contract.functions.SCHAIN_DELETER_ROLE().call() def has_role(self, role: bytes, address: str) -> bool: return self.contract.functions.hasRole(role, address).call() diff --git a/skale/contracts/manager/schains_internal.py b/skale/contracts/manager/schains_internal.py index 3b4fbd67..49050c77 100644 --- a/skale/contracts/manager/schains_internal.py +++ b/skale/contracts/manager/schains_internal.py @@ -52,7 +52,7 @@ def get_node_ids_for_schain(self, name): return self.contract.functions.getNodesInGroup(id_).call() def get_schain_ids_for_node(self, node_id): - return self.contract.functions.getSchainHashesForNode(node_id).call() + return self.contract.functions.getSchainHashsForNode(node_id).call() def is_schain_exist(self, name): id_ = self.schains.name_to_id(name) diff --git a/skale/utils/contracts_provision/main.py b/skale/utils/contracts_provision/main.py index 9125ae53..77ecd9a0 100644 --- a/skale/utils/contracts_provision/main.py +++ b/skale/utils/contracts_provision/main.py @@ -51,9 +51,9 @@ def add_all_permissions(skale, address): if not skale.schains.has_role(schain_creator_role, address): skale.schains.grant_role(schain_creator_role, address) - schain_removal_role = skale.manager.schain_removal_role() - if not skale.manager.has_role(schain_removal_role, address): - skale.manager.grant_role(schain_removal_role, address) + schain_deleter_role = skale.manager.schain_deleter_role() + if not skale.manager.has_role(schain_deleter_role, address): + skale.manager.grant_role(schain_deleter_role, address) bounty_reduction_manager_role = skale.bounty_v2.bounty_reduction_manager_role() if not skale.bounty_v2.has_role(bounty_reduction_manager_role, address): From 4ccfe98fe9112717ba05dd5dce8e8f147e2c3c41 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Mon, 11 Oct 2021 19:51:20 +0300 Subject: [PATCH 6/6] SKALE-4617 Skip allocator tests --- tests/allocator/allocator_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/allocator/allocator_test.py b/tests/allocator/allocator_test.py index e5e75f14..d1308292 100644 --- a/tests/allocator/allocator_test.py +++ b/tests/allocator/allocator_test.py @@ -1,4 +1,5 @@ """ Tests for skale/allocator/allocator.py """ +import pytest from skale.wallets.web3_wallet import generate_wallet from skale.utils.account_tools import send_ether @@ -98,6 +99,7 @@ def test_get_all_plans(skale_allocator): assert plan_params_with_id == plans[0] +@pytest.mark.skip('test should be updated') def test_calculate_vested_amount(skale_allocator): wallet = generate_wallet(skale_allocator.web3) connect_test_beneficiary(skale_allocator, D_PLAN_ID, wallet) @@ -119,7 +121,7 @@ def test_get_lockup_period_end_timestamp(skale_allocator): assert res == D_END_LOCKUP_TIMESTAMP -# TODO: improve test +@pytest.mark.skip('test should be updated') def test_get_time_of_next_vest(skale_allocator): wallet = generate_wallet(skale_allocator.web3) connect_test_beneficiary(skale_allocator, D_PLAN_ID, wallet)