Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vsuharnikov committed Sep 30, 2024
1 parent ee96e95 commit ba9219e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions local-network/deploy/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ 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"
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 = ["."]
6 changes: 3 additions & 3 deletions local-network/deploy/tests/transfer-multiple-c2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions local-network/deploy/tests/transfer-multiple-e2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]] = []
Expand All @@ -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)}"
Expand Down Expand Up @@ -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)}"
Expand Down
6 changes: 3 additions & 3 deletions local-network/deploy/tests/transfer-single-c2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions local-network/deploy/tests/transfer-single-e2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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"
)
Expand Down

0 comments on commit ba9219e

Please sign in to comment.