-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from hadronlabs-org/feat/integration-tests
Add integration tests #LIDO-71
- Loading branch information
Showing
68 changed files
with
8,305 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.idea/ | ||
target/ | ||
artifacts/ | ||
**/schema/ | ||
**/schema/ | ||
/artifacts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
node_modules | ||
|
||
/.jest | ||
/packages/**/dist/ | ||
|
||
/.yarn/* | ||
/.pnp.* | ||
/src/generated/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 12, | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"rules": { | ||
"prettier/prettier": ["error", {}, { "usePrettierrc": true }], | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-var-requires": "off", | ||
"@typescript-eslint/no-empty-interface": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ "ignoreRestSiblings": true } | ||
], | ||
"no-useless-return": ["error"], | ||
"arrow-body-style": ["error", "as-needed"], | ||
"require-await": ["error"] | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": { | ||
"@typescript-eslint/no-explicit-any": "off" | ||
} | ||
}, | ||
{ | ||
"files": ["*.js"], | ||
"rules": { | ||
"@typescript-eslint/explicit-module-boundary-types": "off" | ||
} | ||
} | ||
], | ||
"settings": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
/docker-compose-*.yml | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"useTabs": false, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# integration-tests | ||
|
||
This repository contains tests for Lido on Cosmos implementation. | ||
|
||
## How to run | ||
|
||
### Prerequisites | ||
|
||
- node v16.19+ | ||
- Docker engine | ||
- yarn | ||
|
||
### Prepare | ||
|
||
1. run `yarn` | ||
2. run `yarn build-images` | ||
|
||
### Run | ||
|
||
Execute `yarn test` to run all tests. | ||
|
||
Note: if tests fail, run: | ||
|
||
```bash | ||
docker-compose -f ./docker-compose-first.yml -p first down --remove-orphans | ||
docker-compose -f ./docker-compose-second.yml -p second down --remove-orphans | ||
docker-compose -f ./docker-compose-satellite.yml -p second down --remove-orphans | ||
``` | ||
|
||
and then try `yarn test` again. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+437 KB
integration_tests/artifacts/contracts/cwd_subdao_pre_propose_single.wasm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
declare -A ADDR_TO_NAME_MAP | ||
|
||
sleep 10 #trying to deal with runtime error: invalid memory address or nil pointer dereference: panic | ||
|
||
while IFS=" " read -r ADDR NAME; do | ||
TRIMMED_ADDR=${ADDR:0:-6} | ||
ADDR_TO_NAME_MAP["$TRIMMED_ADDR"]=$NAME | ||
done < <(gaiad keys list --keyring-backend=test --home=/opt --output json | jq -r '.[] | .address + " " + .name') | ||
|
||
gaiad query staking validators --output json | jq -r '.validators | .[] | .operator_address' | while read -r VAL_ADDRESS; do | ||
KEY_ADDRESS="cosmos${VAL_ADDRESS:13:-6}" | ||
|
||
KEY_NAME=${ADDR_TO_NAME_MAP["$KEY_ADDRESS"]} | ||
|
||
if [ -n "$KEY_NAME" ]; then | ||
gaiad tx staking validator-bond "$VAL_ADDRESS" --from "$KEY_NAME" --chain-id testgaia --home=/opt --keyring-backend=test --broadcast-mode=block -y >> /opt/gaiad.log 2>&1 | ||
else | ||
echo "No key name found for address: $KEY_ADDRESS" | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
declare -A ADDR_TO_NAME_MAP | ||
|
||
sleep 10 #trying to deal with runtime error: invalid memory address or nil pointer dereference: panic | ||
|
||
while IFS=" " read -r ADDR NAME; do | ||
TRIMMED_ADDR=${ADDR:0:-6} | ||
ADDR_TO_NAME_MAP["$TRIMMED_ADDR"]=$NAME | ||
done < <(liquidstakingd keys list --keyring-backend=test --home=/opt --output json | jq -r '.[] | .address + " " + .name') | ||
|
||
liquidstakingd query staking validators --output json | jq -r '.validators | .[] | .operator_address' | while read -r VAL_ADDRESS; do | ||
KEY_ADDRESS="cosmos${VAL_ADDRESS:13:-6}" | ||
|
||
KEY_NAME=${ADDR_TO_NAME_MAP["$KEY_ADDRESS"]} | ||
|
||
if [ -n "$KEY_NAME" ]; then | ||
liquidstakingd tx staking validator-bond "$VAL_ADDRESS" --from "$KEY_NAME" --chain-id testlsm --home=/opt --keyring-backend=test --broadcast-mode=block -y >> /opt/liquidstakingd.log 2>&1 | ||
else | ||
echo "No key name found for address: $KEY_ADDRESS" | ||
fi | ||
done |
Oops, something went wrong.