2024-01-29 04:46:32 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-07-22 06:18:02 +00:00
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
|
|
|
|
# Wait for the laconid endpoint to come up
|
|
|
|
docker compose exec laconicd sh -c "curl --retry 10 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api"
|
|
|
|
|
2024-04-02 13:25:31 +00:00
|
|
|
# Get the key from laconicd
|
|
|
|
laconicd_key=$(yes | docker compose exec laconicd laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe)
|
2024-01-29 04:46:32 +00:00
|
|
|
|
|
|
|
# Get the fixturenet account address
|
2024-04-02 13:25:31 +00:00
|
|
|
laconicd_account_address=$(docker compose exec laconicd laconicd keys list --keyring-backend test | awk '/- address:/ {print $3}')
|
2024-01-29 04:46:32 +00:00
|
|
|
|
|
|
|
# Set parameters for the test suite
|
|
|
|
cosmos_chain_id=laconic_9000-1
|
2024-04-02 13:25:31 +00:00
|
|
|
laconicd_rpc_endpoint=http://127.0.0.1:26657
|
|
|
|
laconicd_gql_endpoint=http://127.0.0.1:9473/api
|
2024-01-29 04:46:32 +00:00
|
|
|
|
|
|
|
# Create the required config
|
|
|
|
config_file="config.yml"
|
|
|
|
config=$(cat <<EOL
|
|
|
|
services:
|
2024-03-19 04:42:42 +00:00
|
|
|
registry:
|
2024-04-02 13:25:31 +00:00
|
|
|
rpcEndpoint: $laconicd_rpc_endpoint
|
|
|
|
gqlEndpoint: $laconicd_gql_endpoint
|
|
|
|
userKey: $laconicd_key
|
2024-01-29 04:46:32 +00:00
|
|
|
bondId:
|
|
|
|
chainId: $cosmos_chain_id
|
|
|
|
gas: 200000
|
2024-07-30 13:24:46 +00:00
|
|
|
fees: 200000alnt
|
2024-01-29 04:46:32 +00:00
|
|
|
EOL
|
|
|
|
)
|
|
|
|
echo "$config" > "$config_file"
|
|
|
|
|
|
|
|
# Run tests
|
2024-04-02 13:25:31 +00:00
|
|
|
TEST_ACCOUNT=$laconicd_account_address yarn test
|