laconic-registry-cli/test/run-tests.sh

35 lines
1012 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2024-03-18 13:37:26 +00:00
# Get the key from laconic2d
laconic2d_key=$(yes | docker compose exec laconic2d laconic2d keys export mykey --unarmored-hex --unsafe)
# Get the fixturenet account address
2024-03-18 13:37:26 +00:00
laconic2d_account_address=$(docker compose exec laconic2d laconic2d keys list | awk '/- address:/ {print $3}')
# Set parameters for the test suite
cosmos_chain_id=laconic_9000-1
2024-03-18 13:37:26 +00:00
laconic2d_rpc_endpoint=http://127.0.0.1:26657
laconic2d_gql_endpoint=http://127.0.0.1:9473/api
# Create the required config
config_file="config.yml"
config=$(cat <<EOL
services:
cns:
2024-03-18 13:37:26 +00:00
restEndpoint: $laconic2d_rpc_endpoint
gqlEndpoint: $laconic2d_gql_endpoint
userKey: $laconic2d_key
bondId:
chainId: $cosmos_chain_id
gas: 200000
2024-03-12 12:06:04 +00:00
fees: 200000photon
EOL
)
echo "$config" > "$config_file"
# Wait for the laconid endpoint to come up
2024-03-18 13:37:26 +00:00
docker compose exec laconic2d sh -c "curl --retry 10 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api"
# Run tests
2024-03-18 13:37:26 +00:00
TEST_ACCOUNT=$laconic2d_account_address yarn test