Skip to content

Commit 0820e0c

Browse files
pedro-linoVahe9611
andauthored
Addressing test issues. (#861)
Co-authored-by: vahe9611 <vah.vahe97@gmail.com> Co-authored-by: Vahe Hakobyan <49304207+Vahe9611@users.noreply.github.com>
1 parent 43e7ce3 commit 0820e0c

8 files changed

+21
-5
lines changed

.github/workflows/algorand-integration.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,6 @@ jobs:
117117
working-directory: ./devnet/docker/icon-algorand
118118
run: |
119119
export PATH=$PATH:~/go/bin
120-
./dbsh-integration-test.sh
120+
./messaging-bridge-test.sh
121121
./a2i-integration-test.sh
122122
./i2a-integration-test.sh

devnet/docker/icon-algorand/README.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ which will then be copied to the relayer [config file](/devnet/docker/icon-algor
2929
### Local execution
3030
It's also possible to replicate the same steps locally, which can be much more helpful for debugging:
3131
1. Install Algorand and Pyteal, using the same cmds provided on the workflow file.
32-
2. Run [local_setup.sh](devnet/docker/icon-algorand/local_setup.sh) to setup local chain nodes and build the smart contracts.
32+
2. Run [local_setup.sh](devnet/docker/icon-algorand/local_setup.sh) to setup local chain nodes and build the smart contracts.
3333
3. Run [setup_system.sh](devnet/docker/icon-algorand/setup_system.sh) to deploy the contracts and setup the relayer config file.
3434
4. Go to ``./cmd/iconbridge`` and run ``go run . -config=../../devnet/docker/icon-algorand/algo-config.json``
3535
to start the relayer.
3636
5. To execute any of the integration tests, go to ``/devnet/docker/icon-algorand`` and run the
37-
respective script.
37+
respective script, more info on the coming tests section.
3838

3939

4040
### Testnet execution
@@ -44,4 +44,13 @@ testnet address and token values.
4444
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.
4545
on the respective testnet faucets. The algorand one can be accessed [here](https://bank.testnet.algorand.network/).
4646
2. To execute any of the integration tests, go to ``/devnet/docker/icon-algorand`` and run the
47-
respective script.
47+
respective script, more info on the coming tests section.
48+
49+
### Tests
50+
On the ``/devnet/docker/icon-algorand`` directory, there are scripts that perform the following tests:
51+
- [messaging-bridge-test.sh](devnet/docker/icon-algorand/messaging-bridge-test.sh) - Send a message accross the bridge and verify it reaches the destination.
52+
- [i2a-integration-test.sh](devnet/docker/icon-algorand/i2a-integration-test.sh) - Initialize a local token transfer from icon to algorand and verify balances.
53+
- [a2i-integration-test.sh](devnet/docker/icon-algorand/a2i-integration-test.sh) - Initialize a local token transfer from algorand to iconand verify balances.
54+
- [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.
55+
- [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.
56+

devnet/docker/icon-algorand/a2i-integration-test.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
export PATH=$PATH:~/go/bin
23

34
echo "Start a2i integration test"
45

@@ -8,7 +9,7 @@ SENDER_BALANCE_BEFORE_TEST=$(PRIVATE_KEY=$(cat cache/algo_minter_private_key) AL
89
# Create receiver account on ICON
910
goloop ks gen --out receiver.keystore.json
1011
ICON_RECEIVER_ADDRESS=$(cat receiver.keystore.json | jq -r '.address')
11-
12+
1213
# Transfer Asset to ICON
1314
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
1415

devnet/docker/icon-algorand/a2i-tokenTransfer.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
export PATH=$PATH:~/go/bin
23

34
echo "Starting a2i integration test"
45

devnet/docker/icon-algorand/i2a-integration-test.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
export PATH=$PATH:~/go/bin
23

34
echo "Start i2a integration test"
45

devnet/docker/icon-algorand/i2a-tokenTransfer.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
export PATH=$PATH:~/go/bin
23

34
echo "Starting i2a integration test"
45

devnet/docker/icon-algorand/local_setup.sh

100755100644
File mode changed.

devnet/docker/icon-algorand/dbsh-integration-test.sh devnet/docker/icon-algorand/messaging-bridge-test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#!/bin/bash
2+
export PATH=$PATH:~/go/bin
3+
14
echo "Start dbsh integration test"
25

36
echo "Sending msg from algo to icon"

0 commit comments

Comments
 (0)