diff --git a/.github/workflows/algorand-integration.yml b/.github/workflows/algorand-integration.yml index 078b59ac..b72eb90b 100644 --- a/.github/workflows/algorand-integration.yml +++ b/.github/workflows/algorand-integration.yml @@ -117,6 +117,6 @@ jobs: working-directory: ./devnet/docker/icon-algorand run: | export PATH=$PATH:~/go/bin - ./dbsh-integration-test.sh + ./messaging-bridge-test.sh ./a2i-integration-test.sh ./i2a-integration-test.sh diff --git a/devnet/docker/icon-algorand/README.md b/devnet/docker/icon-algorand/README.md index 5c17569e..e4bb274d 100644 --- a/devnet/docker/icon-algorand/README.md +++ b/devnet/docker/icon-algorand/README.md @@ -29,12 +29,12 @@ which will then be copied to the relayer [config file](/devnet/docker/icon-algor ### Local execution It's also possible to replicate the same steps locally, which can be much more helpful for debugging: 1. Install Algorand and Pyteal, using the same cmds provided on the workflow file. -2. Run [local_setup.sh](devnet/docker/icon-algorand/local_setup.sh) to setup local chain nodes and build the smart contracts. +2. Run [local_setup.sh](devnet/docker/icon-algorand/local_setup.sh) to setup local chain nodes and build the smart contracts. 3. Run [setup_system.sh](devnet/docker/icon-algorand/setup_system.sh) to deploy the contracts and setup the relayer config file. 4. Go to ``./cmd/iconbridge`` and run ``go run . -config=../../devnet/docker/icon-algorand/algo-config.json`` to start the relayer. 5. To execute any of the integration tests, go to ``/devnet/docker/icon-algorand`` and run the -respective script. +respective script, more info on the coming tests section. ### Testnet execution @@ -44,4 +44,13 @@ testnet address and token values. 1. Go to ``./devnet/docker/icon-algorand`` and run [testnet_start_relay.sh](/devnet/docker/icon-algorand/testnet_start_relay.sh) - Beware that this script will create wallet accounts that need to be funded. on the respective testnet faucets. The algorand one can be accessed [here](https://bank.testnet.algorand.network/). 2. To execute any of the integration tests, go to ``/devnet/docker/icon-algorand`` and run the -respective script. +respective script, more info on the coming tests section. + +### Tests +On the ``/devnet/docker/icon-algorand`` directory, there are scripts that perform the following tests: +- [messaging-bridge-test.sh](devnet/docker/icon-algorand/messaging-bridge-test.sh) - Send a message accross the bridge and verify it reaches the destination. +- [i2a-integration-test.sh](devnet/docker/icon-algorand/i2a-integration-test.sh) - Initialize a local token transfer from icon to algorand and verify balances. +- [a2i-integration-test.sh](devnet/docker/icon-algorand/a2i-integration-test.sh) - Initialize a local token transfer from algorand to iconand verify balances. +- [i2a-tokenTransfer.sh](devnet/docker/icon-algorand/i2a-tokenTransfer.sh) - Initialize a testnet token transfer from icon to algorand and print hashes to be verified on explorers. +- [a2i-tokenTransfer.sh](devnet/docker/icon-algorand/a2i-tokenTransfer.sh) - Initialize a testnet token transfer from algorand to icon and print hashes to be verified on explorers. + diff --git a/devnet/docker/icon-algorand/a2i-integration-test.sh b/devnet/docker/icon-algorand/a2i-integration-test.sh index 35078e7a..30340338 100755 --- a/devnet/docker/icon-algorand/a2i-integration-test.sh +++ b/devnet/docker/icon-algorand/a2i-integration-test.sh @@ -1,4 +1,5 @@ #!/bin/bash +export PATH=$PATH:~/go/bin echo "Start a2i integration test" @@ -8,7 +9,7 @@ SENDER_BALANCE_BEFORE_TEST=$(PRIVATE_KEY=$(cat cache/algo_minter_private_key) AL # Create receiver account on ICON goloop ks gen --out receiver.keystore.json ICON_RECEIVER_ADDRESS=$(cat receiver.keystore.json | jq -r '.address') - + # Transfer Asset to ICON PRIVATE_KEY=$(cat cache/algo_minter_private_key) ALGOD_ADDRESS=$(cat cache/algod_address) ALGOD_TOKEN=$(cat cache/algo_token) algorand-deposit-token ../../../pyteal/teal/escrow $(cat cache/bmc_app_id) $(cat cache/escrow_app_id) $ICON_RECEIVER_ADDRESS $(cat cache/algo_test_asset_id) $AMOUNT diff --git a/devnet/docker/icon-algorand/a2i-tokenTransfer.sh b/devnet/docker/icon-algorand/a2i-tokenTransfer.sh index cb13e39b..e7226b6c 100755 --- a/devnet/docker/icon-algorand/a2i-tokenTransfer.sh +++ b/devnet/docker/icon-algorand/a2i-tokenTransfer.sh @@ -1,4 +1,5 @@ #!/bin/bash +export PATH=$PATH:~/go/bin echo "Starting a2i integration test" diff --git a/devnet/docker/icon-algorand/i2a-integration-test.sh b/devnet/docker/icon-algorand/i2a-integration-test.sh index ee4c69e2..f508cd42 100755 --- a/devnet/docker/icon-algorand/i2a-integration-test.sh +++ b/devnet/docker/icon-algorand/i2a-integration-test.sh @@ -1,4 +1,5 @@ #!/bin/bash +export PATH=$PATH:~/go/bin echo "Start i2a integration test" diff --git a/devnet/docker/icon-algorand/i2a-tokenTransfer.sh b/devnet/docker/icon-algorand/i2a-tokenTransfer.sh index 00c8daf6..28c59776 100755 --- a/devnet/docker/icon-algorand/i2a-tokenTransfer.sh +++ b/devnet/docker/icon-algorand/i2a-tokenTransfer.sh @@ -1,4 +1,5 @@ #!/bin/bash +export PATH=$PATH:~/go/bin echo "Starting i2a integration test" diff --git a/devnet/docker/icon-algorand/local_setup.sh b/devnet/docker/icon-algorand/local_setup.sh old mode 100755 new mode 100644 diff --git a/devnet/docker/icon-algorand/dbsh-integration-test.sh b/devnet/docker/icon-algorand/messaging-bridge-test.sh similarity index 97% rename from devnet/docker/icon-algorand/dbsh-integration-test.sh rename to devnet/docker/icon-algorand/messaging-bridge-test.sh index fd94c4f3..4229b55e 100755 --- a/devnet/docker/icon-algorand/dbsh-integration-test.sh +++ b/devnet/docker/icon-algorand/messaging-bridge-test.sh @@ -1,3 +1,6 @@ +#!/bin/bash +export PATH=$PATH:~/go/bin + echo "Start dbsh integration test" echo "Sending msg from algo to icon"