From ba9219e3172800d0f204b68c5a6896bf63ebc99d Mon Sep 17 00:00:00 2001 From: Vyatcheslav Suharnikov Date: Mon, 30 Sep 2024 12:45:48 +0400 Subject: [PATCH] Fixes --- local-network/deploy/pyproject.toml | 4 ++-- local-network/deploy/tests/transfer-multiple-c2e.py | 6 +++--- local-network/deploy/tests/transfer-multiple-e2c.py | 6 +++--- local-network/deploy/tests/transfer-single-c2e.py | 6 +++--- local-network/deploy/tests/transfer-single-e2c.py | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/local-network/deploy/pyproject.toml b/local-network/deploy/pyproject.toml index ab5c0378..c59c87de 100644 --- a/local-network/deploy/pyproject.toml +++ b/local-network/deploy/pyproject.toml @@ -8,7 +8,7 @@ version = "0.1" description = "Scripts and tests for a locally deployed Unit network" dependencies = [ "solc-select", - "units-network @ git+https://github.com/UnitsNetwork/examples.git@python", + "units-network @ git+https://github.com/UnitsNetwork/examples.git", ] readme = "README.md" requires-python = ">=3.12" @@ -16,7 +16,7 @@ license = { text = "MIT License" } keywords = ["units network", "blockchain", "waves"] [project.urls] -Homepage = "https://github.com/UnitsNetwork/consensus-client" +Homepage = "https://github.com/UnitsNetwork/consensus-client/tree/main/local-network" [tool.setuptools.packages.find] where = ["."] diff --git a/local-network/deploy/tests/transfer-multiple-c2e.py b/local-network/deploy/tests/transfer-multiple-c2e.py index 27452ce0..4f22f1f3 100755 --- a/local-network/deploy/tests/transfer-multiple-c2e.py +++ b/local-network/deploy/tests/transfer-multiple-c2e.py @@ -39,8 +39,8 @@ def main(): ] el_curr_height = network.w3.eth.block_number - token = network.cl_chain_contract.getToken() - log.info(f"[C] Token id: {token.assetId}") + cl_token = network.cl_chain_contract.getToken() + log.info(f"[C] Token id: {cl_token.assetId}") expected_balances: dict[ChecksumAddress, Wei] = {} for i, t in enumerate(transfers): @@ -58,7 +58,7 @@ def main(): log.info(f"[C] #{i} Call ChainContract.transfer for {t}") transfer_result = network.cl_chain_contract.transfer( - t.from_account, t.to_account.address, token, t.waves_atomic_amount + t.from_account, t.to_account.address, cl_token, t.waves_atomic_amount ) waves.force_success( log, transfer_result, "Can not send the chain_contract.transfer transaction" diff --git a/local-network/deploy/tests/transfer-multiple-e2c.py b/local-network/deploy/tests/transfer-multiple-e2c.py index 2b837fcd..0df98ed5 100755 --- a/local-network/deploy/tests/transfer-multiple-e2c.py +++ b/local-network/deploy/tests/transfer-multiple-e2c.py @@ -60,7 +60,7 @@ def main(): nonces[t.from_account.address] = Nonce(nonce + 1) send_native_txn_hashes.append((t, txn_hash)) - cl_token_id = network.cl_chain_contract.getToken() + cl_token = network.cl_chain_contract.getToken() expected_balances: dict[pw.Address, int] = {} withdraw_txn_ids: List[Tuple[E2CTransfer, str]] = [] @@ -69,7 +69,7 @@ def main(): if to_account in expected_balances: expected_balances[to_account] += t.waves_atomic_amount else: - balance_before = to_account.balance(cl_token_id.assetId) + balance_before = to_account.balance(cl_token.assetId) expected_balances[to_account] = balance_before + t.waves_atomic_amount log.info( f"[C] {to_account.address} balance before: {units.waves_atomic_to_raw(balance_before)}" @@ -112,7 +112,7 @@ def main(): log.info(f"[C] #{i} ChainContract.withdraw result: {withdraw_result}") for to_account, expected_balance in expected_balances.items(): - balance_after = to_account.balance(cl_token_id.assetId) + balance_after = to_account.balance(cl_token.assetId) log.info( f"[C] {to_account.address} balance after: {units.waves_atomic_to_raw(balance_after)}" diff --git a/local-network/deploy/tests/transfer-single-c2e.py b/local-network/deploy/tests/transfer-single-c2e.py index e5996dc2..16ab0af6 100755 --- a/local-network/deploy/tests/transfer-single-c2e.py +++ b/local-network/deploy/tests/transfer-single-c2e.py @@ -25,14 +25,14 @@ def main(): f"[E] {transfer.to_account.address} balance before: {units.wei_to_raw(balance_before)} UNIT0" ) - token = network.cl_chain_contract.getToken() - log.info(f"[C] Token id: {token.assetId}") + cl_token = network.cl_chain_contract.getToken() + log.info(f"[C] Token id: {cl_token.assetId}") el_curr_height = network.w3.eth.block_number transfer_result = network.cl_chain_contract.transfer( transfer.from_account, transfer.to_account.address, - token, + cl_token, transfer.waves_atomic_amount, ) waves.force_success( diff --git a/local-network/deploy/tests/transfer-single-e2c.py b/local-network/deploy/tests/transfer-single-e2c.py index 384fccaa..92f6c439 100755 --- a/local-network/deploy/tests/transfer-single-e2c.py +++ b/local-network/deploy/tests/transfer-single-e2c.py @@ -50,8 +50,8 @@ def main(): ) network.cl_chain_contract.waitForFinalized(withdraw_block_meta) - cl_token_id = network.cl_chain_contract.getToken() - balance_before = transfer.to_account.balance(cl_token_id.assetId) + cl_token = network.cl_chain_contract.getToken() + balance_before = transfer.to_account.balance(cl_token.assetId) log.info(f"[C] Balance before: {units.waves_atomic_to_raw(balance_before)}") withdraw_result = network.cl_chain_contract.withdraw( @@ -66,7 +66,7 @@ def main(): ) log.info(f"[C] ChainContract.withdraw result: {withdraw_result}") - balance_after = transfer.to_account.balance(cl_token_id.assetId) + balance_after = transfer.to_account.balance(cl_token.assetId) log.info( f"[C] Balance after: {units.waves_atomic_to_raw(balance_after)}, Δ {units.wei_to_raw(Wei(balance_after - balance_before))} UNIT0" )