diff --git a/.github/actions/run-tests/action.yaml b/.github/actions/run-tests/action.yaml index 4e6e086..fbf87dc 100644 --- a/.github/actions/run-tests/action.yaml +++ b/.github/actions/run-tests/action.yaml @@ -68,6 +68,8 @@ runs: path: ${{ env.PANTOS_ETHEREUM_CONTRACTS }} sparse-checkout: | docker-compose.yml + docker-compose.ci.yml + docker-compose.local.yml Makefile - uses: actions/checkout@v4 diff --git a/Makefile b/Makefile index f38ff42..a6f3b96 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ PYTHON_FILES := tests MAX_CONCURRENCY ?= 1 +SHELL := $(shell which bash) check-swarm-init: @if [ "$$(docker info --format '{{.Swarm.LocalNodeState}}')" != "active" ]; then \ diff --git a/base.env b/base.env index 5adfc4f..8246c50 100644 --- a/base.env +++ b/base.env @@ -25,26 +25,26 @@ AVALANCHE_TOKEN_PANFTM=${AVALANCHE_PANFTM} AVALANCHE_TOKEN_PANMATIC=${AVALANCHE_PANMATIC} AVALANCHE_TOKEN_PANSOL=${AVALANCHE_PANSOL} ### BNB ### -BNB_ACTIVE=true -BNB_PROVIDER=http://localhost:8511 +BNB_CHAIN_ACTIVE=true +BNB_CHAIN_PROVIDER=http://localhost:8511 ##### fallback_providers ##### -# BNB_FALLBACK_PROVIDER= -# BNB_AVERAGE_BLOCK_TIME= -BNB_CHAIN_ID=31338 -BNB_CONFIRMATIONS=0 -# BNB_HUB= -# BNB_FORWARDER= +# BNB_CHAIN_FALLBACK_PROVIDER= +# BNB_CHAIN_AVERAGE_BLOCK_TIME= +BNB_CHAIN_CHAIN_ID=31338 +BNB_CHAIN_CONFIRMATIONS=0 +# BNB_CHAIN_HUB= +# BNB_CHAIN_FORWARDER= ##### tokens ##### -BNB_TOKEN_BEST=${BNB_BEST} -BNB_TOKEN_PAN=${BNB_PAN_TOKEN} -BNB_TOKEN_PANAVAX=${BNB_PANAVAX} -BNB_TOKEN_PANBNB=${BNB_PANBNB} -BNB_TOKEN_PANCELO=${BNB_PANCELO} -BNB_TOKEN_PANCRO=${BNB_PANCRO} -BNB_TOKEN_PANETH=${BNB_PANETH} -BNB_TOKEN_PANFTM=${BNB_PANFTM} -BNB_TOKEN_PANMATIC=${BNB_PANMATIC} -BNB_TOKEN_PANSOL=${BNB_PANSOL} +BNB_CHAIN_TOKEN_BEST=${BNB_CHAIN_BEST} +BNB_CHAIN_TOKEN_PAN=${BNB_CHAIN_PAN_TOKEN} +BNB_CHAIN_TOKEN_PANAVAX=${BNB_CHAIN_PANAVAX} +BNB_CHAIN_TOKEN_PANBNB=${BNB_CHAIN_PANBNB} +BNB_CHAIN_TOKEN_PANCELO=${BNB_CHAIN_PANCELO} +BNB_CHAIN_TOKEN_PANCRO=${BNB_CHAIN_PANCRO} +BNB_CHAIN_TOKEN_PANETH=${BNB_CHAIN_PANETH} +BNB_CHAIN_TOKEN_PANFTM=${BNB_CHAIN_PANFTM} +BNB_CHAIN_TOKEN_PANMATIC=${BNB_CHAIN_PANMATIC} +BNB_CHAIN_TOKEN_PANSOL=${BNB_CHAIN_PANSOL} ### celo ### CELO_ACTIVE=false # CELO_PROVIDER= diff --git a/tests/helper.py b/tests/helper.py index 3916c65..3b511db 100644 --- a/tests/helper.py +++ b/tests/helper.py @@ -23,9 +23,9 @@ def run_command(command, cwd, env_vars): def configure_nodes(config, stack_id): pantos_ethereum_contracts_dir = os.getenv('PANTOS_ETHEREUM_CONTRACTS') - pantos_ethereum_contracts_version = os.getenv('PANTOS_ETHEREUM_CONTRACTS_VERSION', '1.1.2') + pantos_ethereum_contracts_version = os.getenv('PANTOS_ETHEREUM_CONTRACTS_VERSION', 'development') if not pantos_ethereum_contracts_version or pantos_ethereum_contracts_version == '': - pantos_ethereum_contracts_version = '1.1.2' + pantos_ethereum_contracts_version = 'development' pantos_service_node_dir = os.getenv('PANTOS_SERVICE_NODE') pantos_service_node_version = os.getenv('PANTOS_SERVICE_NODE_VERSION', 'development') if not pantos_service_node_version or pantos_service_node_version == '': @@ -106,7 +106,7 @@ def configure_client(stack_id, instance = 1): current_dir = os.path.dirname(os.path.realpath(__file__)) # TODO: Return one library instance per instance from the stack id - for file in [f'{contracts_dir}/data/*{stack_id}-{instance}/eth/all.env', f'{current_dir}/../base.env']: + for file in [f'{contracts_dir}/data/*{stack_id}-{instance}/*/all.env', f'{current_dir}/../base.env']: resolved_path = glob.glob(file) if not resolved_path: raise FileNotFoundError(f'Environment path {file} not found') diff --git a/tests/test_transfer.py b/tests/test_transfer.py index b0663ed..9e90f77 100644 --- a/tests/test_transfer.py +++ b/tests/test_transfer.py @@ -16,12 +16,15 @@ def setup_module(request, stack_id, worker_id = "gw0"): # Code to set up the environment before any tests in the module print("Setting up module environment") + #os.environ['PANTOS_ENV_FILE'] = '/Users/joe.matthew/Workspace/cd-workflows/tests/testnet/e2e-test-config.env' + #os.environ['ETHEREUM_PRIVATE_KEY'] = '{"address":"f5454fd5b6aac3d243226cec31489c507a8259e0","crypto":{"cipher":"aes-128-ctr","ciphertext":"65a77c0acf155567086e1f231194ac13556e1148aa5b2170f509c679ccc8d68f","cipherparams":{"iv":"aa61677cf5316fcf7f514bc8db8d6528"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"cc9be3fe948e1c46cee2a86082c4db868c3f86fe4b4953f56c2c2624675e9d2e"},"mac":"7f73f4aeda2025086eb608ab360ca5b763d846aec2c331be069e42676ba25241"},"id":"712ce8d5-0ed5-4d32-83a4-0d9b1fa8a290","version":3}' + #os.environ['BNB_CHAIN_PRIVATE_KEY'] = '/Users/joe.matthew/Workspace/e2e-testing/keystore' if os.getenv('PANTOS_ENV_FILE', None) is None: port_offset = int(worker_id.replace("gw", "")) if worker_id != "master" else 0 #os.environ['PORT_OFFSET'] = str(port_offset) configure_nodes({ 'ethereum_contracts': {'args': '', 'port_group': port_offset}, - 'service_node': {'instance_count': 2, 'port_group': port_offset}, + 'service_node': {'instance_count': 1, 'port_group': port_offset}, 'validator_node': {'instance_count': 1, 'port_group': port_offset} }, stack_id) configure_client(stack_id) @@ -73,9 +76,8 @@ def test_token_transfer(receiving_address, private_key): token_transfer_response.task_id) assert token_transfer_status is not None print(f'Token transfer status: {token_transfer_status}') - if (token_transfer_status.source_transfer_status is ServiceNodeTransferStatus.CONFIRMED): - # TODO: Enable this when we migrate from etherum contracts 1.1.2 - #and token_transfer_status.destination_transfer_status is DestinationTransferStatus.CONFIRMED): + if (token_transfer_status.source_transfer_status is ServiceNodeTransferStatus.CONFIRMED + and token_transfer_status.destination_transfer_status is DestinationTransferStatus.CONFIRMED): done = True else: print('Waiting for transfer to be confirmed...')