Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport master to develop: integration tests #142

Closed
wants to merge 71 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
09721a6
chore: add separation of tests and basic integration test
tamtamchik Jun 12, 2024
71654f8
test(integration): update logging
tamtamchik Jun 13, 2024
92d32d9
test(integration): adjustments for mainnet fork
tamtamchik Jun 13, 2024
497b9b0
chore: update logs
tamtamchik Jul 3, 2024
42b5908
ci: disable integration tests in ci
tamtamchik Jul 3, 2024
58bddfe
chore: move some functions to bigint
tamtamchik Jul 3, 2024
0741fff
test: stash progress
tamtamchik Jul 5, 2024
aea6ab6
chore: update format settings
tamtamchik Jul 5, 2024
be7ffd6
Merge branch 'develop' into feat/integration
tamtamchik Jul 5, 2024
96f68cb
test: fix typo in unit tests
tamtamchik Jul 8, 2024
281beca
ci: fix coverage report
tamtamchik Jul 8, 2024
2d45696
ci: enable integration test
tamtamchik Jul 8, 2024
fdcf138
ci: use native cache
tamtamchik Jul 8, 2024
d888704
ci: unify titles
tamtamchik Jul 8, 2024
810d0c6
chore: simplify code
tamtamchik Jul 8, 2024
3b5aed3
chore: update yarn
tamtamchik Jul 9, 2024
ac7b8d0
Merge branch 'master' into feat/integration
tamtamchik Jul 9, 2024
768d3ad
chore: fix tests
tamtamchik Jul 9, 2024
4b4fe78
chore: fix ts and naming, use secrets for RPC
tamtamchik Jul 9, 2024
7719feb
fix: ETH_RPC_URL env
tamtamchik Jul 9, 2024
2a8f8c1
chore: enable local run with traces
tamtamchik Jul 9, 2024
b945716
test: add sdvt keys management
tamtamchik Jul 10, 2024
bbf167e
fix: import
tamtamchik Jul 10, 2024
e0cb6e4
fix: required sdvt setup
tamtamchik Jul 10, 2024
3733732
test: add submitting eth part
tamtamchik Jul 10, 2024
57a965a
test: update integration test codebase
tamtamchik Jul 11, 2024
36fe0c6
chore: apply some new eslint rules
tamtamchik Jul 11, 2024
3b4e69d
chore: fix all ci errors
tamtamchik Jul 11, 2024
198da7b
test: add new steps to happy path
tamtamchik Jul 12, 2024
6cf096d
chore: update dependencies
tamtamchik Jul 12, 2024
a5afe75
chore: linters
tamtamchik Jul 12, 2024
7d1fda7
chore: rename
tamtamchik Jul 15, 2024
e9fd831
chore: fix coverage
tamtamchik Jul 15, 2024
8fa9d60
chore: cleanup typed import and some overrides
tamtamchik Jul 16, 2024
56a648a
fix: linters
tamtamchik Jul 16, 2024
351145f
chore: update condition to make the test pass
tamtamchik Jul 16, 2024
2cdc304
chore: update docs
tamtamchik Jul 17, 2024
a93e811
chore: update docs and tracer
tamtamchik Jul 17, 2024
df89511
test: finished happy path
tamtamchik Jul 17, 2024
70f9cfd
docs: update docs
tamtamchik Jul 18, 2024
1896129
chore: restore transfers assertion for rebase
tamtamchik Jul 18, 2024
9f5e756
test: 100% covered
tamtamchik Jul 18, 2024
ecd4064
Merge branch 'repovation' into feat/integration
tamtamchik Jul 19, 2024
663337c
fix: restore formatting
tamtamchik Jul 19, 2024
69e2fc7
Merge branch 'repovation' into feat/integration
tamtamchik Jul 22, 2024
855daa4
feat: update local discovery
tamtamchik Jul 22, 2024
1f5f399
lint: fix errors
tamtamchik Jul 23, 2024
7a9e1cb
Merge branch 'repovation' into feat/integration
tamtamchik Jul 23, 2024
4aca67e
test: burn shares
tamtamchik Jul 23, 2024
5c922d1
chore: refactoring and provisioning for scratch deploy
tamtamchik Jul 25, 2024
b0ef606
fix: linters
tamtamchik Jul 25, 2024
083c2cc
chore: finish provisioning
tamtamchik Jul 25, 2024
8d95a5f
chore: update tests on scratch deploy
tamtamchik Jul 26, 2024
382defb
chore: review updates and fixes
tamtamchik Jul 26, 2024
5a2f047
chore: update equality check
tamtamchik Jul 26, 2024
73f8706
chore: review fixes
tamtamchik Jul 26, 2024
139d1cd
Merge branch 'master' into feat/integration
tamtamchik Jul 26, 2024
3d455db
fix: types naming
tamtamchik Jul 26, 2024
3ca85d0
chore: diversity
tamtamchik Jul 26, 2024
4fc0e5b
Merge pull request #137 from lidofinance/chore/equality
tamtamchik Jul 29, 2024
9e49e1f
Merge pull request #139 from lidofinance/master
tamtamchik Jul 29, 2024
475bf79
Merge branch 'repovation' into feat/integration
tamtamchik Jul 29, 2024
6f1ce5d
chore: update dependencies
tamtamchik Jul 30, 2024
d5bea29
chore: make tests work on scratch deploy
tamtamchik Jul 30, 2024
834766c
chore: log level
tamtamchik Jul 30, 2024
b108b98
chore: some minor tweaks applied
tamtamchik Jul 30, 2024
e673c52
fix: oracle committee members
tamtamchik Aug 1, 2024
0899c39
Merge pull request #105 from lidofinance/feat/integration
tamtamchik Aug 2, 2024
96819ba
Merge pull request #138 from lidofinance/repovation
mymphe Aug 5, 2024
344df09
fix: integration node docker version
tamtamchik Aug 7, 2024
2fbcd89
Merge pull request #143 from lidofinance/fix/integration-node
tamtamchik Aug 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4

[*.{js,yml,json,cjs,ts}]
indent_size = 2

[*.sol]
indent_size = 4
46 changes: 46 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
LOCAL_RPC_URL=http://localhost:8555
LOCAL_LOCATOR_ADDRESS=
LOCAL_AGENT_ADDRESS=
LOCAL_VOTING_ADDRESS=
LOCAL_EASY_TRACK_EXECUTOR_ADDRESS=
LOCAL_ACCOUNTING_ORACLE_ADDRESS=
LOCAL_ACL_ADDRESS=
LOCAL_BURNER_ADDRESS=
LOCAL_DEPOSIT_SECURITY_MODULE_ADDRESS=
LOCAL_EL_REWARDS_VAULT_ADDRESS=
LOCAL_HASH_CONSENSUS_ADDRESS=
LOCAL_KERNEL_ADDRESS=
LOCAL_LEGACY_ORACLE_ADDRESS=
LOCAL_LIDO_ADDRESS=
LOCAL_NOR_ADDRESS=
LOCAL_ORACLE_DAEMON_CONFIG_ADDRESS=
LOCAL_ORACLE_REPORT_SANITY_CHECKER_ADDRESS=
LOCAL_SDVT_ADDRESS=
LOCAL_STAKING_ROUTER_ADDRESS=
LOCAL_VALIDATORS_EXIT_BUS_ORACLE_ADDRESS=
LOCAL_WITHDRAWAL_QUEUE_ADDRESS=
LOCAL_WITHDRAWAL_VAULT_ADDRESS=

# https://docs.lido.fi/deployed-contracts
MAINNET_RPC_URL=http://localhost:8545
MAINNET_LOCATOR_ADDRESS=0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb
MAINNET_AGENT_ADDRESS=0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c
MAINNET_VOTING_ADDRESS=0x2e59A20f205bB85a89C53f1936454680651E618e
MAINNET_EASY_TRACK_EXECUTOR_ADDRESS=0xFE5986E06210aC1eCC1aDCafc0cc7f8D63B3F977
MAINNET_ACCOUNTING_ORACLE_ADDRESS=
MAINNET_ACL_ADDRESS=
MAINNET_BURNER_ADDRESS=
MAINNET_DEPOSIT_SECURITY_MODULE_ADDRESS=
MAINNET_EL_REWARDS_VAULT_ADDRESS=
MAINNET_HASH_CONSENSUS_ADDRESS=
MAINNET_KERNEL_ADDRESS=
MAINNET_LEGACY_ORACLE_ADDRESS=
MAINNET_LIDO_ADDRESS=
MAINNET_NOR_ADDRESS=
MAINNET_ORACLE_DAEMON_CONFIG_ADDRESS=
MAINNET_ORACLE_REPORT_SANITY_CHECKER_ADDRESS=
MAINNET_SDVT_ADDRESS=
MAINNET_STAKING_ROUTER_ADDRESS=
MAINNET_VALIDATORS_EXIT_BUS_ORACLE_ADDRESS=
MAINNET_WITHDRAWAL_QUEUE_ADDRESS=
MAINNET_WITHDRAWAL_VAULT_ADDRESS=
26 changes: 13 additions & 13 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"parser": "@typescript-eslint/parser",
"extends": ["plugin:@typescript-eslint/recommended", "prettier"],
"parserOptions": { "ecmaVersion": 2022, "sourceType": "module", "project": ["./tsconfig.json"] },
"parserOptions": {
"ecmaVersion": 2022, "sourceType": "module", "project": ["./tsconfig.json"]
},
"plugins": ["no-only-tests", "simple-import-sort"],
"rules": {
"@typescript-eslint/no-explicit-any": ["warn"],
"@typescript-eslint/no-unused-vars": ["warn"],
"@typescript-eslint/no-floating-promises": ["warn"],
"@typescript-eslint/no-shadow": ["error"],
// prevents committing `describe.only` and `it.only` tests
"no-only-tests/no-only-tests": "warn",
"no-shadow": "off",
"simple-import-sort/imports": [
"error",
{
"error", {
"groups": [
["^node:"],
["^\\u0000"],
Expand All @@ -22,17 +25,14 @@
["^test"],
["^../"],
["^./"],
["^"],
],
},
],
["^"]
]
}
]
},
"overrides": [
{
"files": ["./scripts/{**/,}*.js", "./test/{**/,}*.js"],
"env": {
"mocha": true,
},
},
],
"files": ["./scripts/{**/,}*.js", "./test/{**/,}*.js"], "env": {"mocha": true}
}
]
}
21 changes: 6 additions & 15 deletions .github/workflows/analyse.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Code Analysis
name: Analysis

on:
push:
branches: [ master, develop, repovation ]
branches: [master, develop, repovation]
pull_request:
branches: [ master, develop, repovation ]
branches: [master, develop, repovation]

jobs:
slither:
name: Solidity code analysis
name: Slither
runs-on: ubuntu-latest

permissions:
Expand All @@ -17,18 +17,9 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- run: corepack enable

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: "yarn"

- name: Install dependencies
run: yarn install
- name: Common setup
uses: ./.github/workflows/setup

# REVIEW: here and below steps taken from official guide
# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#caching-packages
Expand Down
25 changes: 10 additions & 15 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,26 @@ name: Coverage

on:
push:
branches: [ master, develop, repovation ]
branches: [master, develop, repovation]
pull_request:
branches: [ master, develop, repovation ]
branches: [master, develop, repovation]

jobs:
coverage:
name: Solidity coverage
name: Hardhat
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- run: corepack enable

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: "yarn"
- name: Common setup
uses: ./.github/workflows/setup

- name: Install dependencies
run: yarn install
# Remove the integration tests from the test suite, as they require a mainnet fork to run properly
- name: Remove integration tests
run: rm -rf test/integration

- name: Run Solidity coverage
- name: Collect coverage
run: yarn test:coverage

- name: Produce the coverage report
Expand All @@ -37,5 +32,5 @@ jobs:
diff: true
diff-branch: master
diff-storage: _core_coverage_reports
coverage-summary-title: "Code Coverage Summary"
coverage-summary-title: "Hardhat Unit Tests Coverage Summary"
togglable-report: true
50 changes: 21 additions & 29 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,46 @@
name: Linters

on: [ push ]
on: [push]

jobs:
lint:
name: Solidity and TypeScript linters
solhint:
name: Solhint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- run: corepack enable
- name: Common setup
uses: ./.github/workflows/setup

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: "yarn"
- name: Run solhint
run: yarn lint:sol

- name: Install dependencies
run: yarn install
eslint:
name: ESLint
runs-on: ubuntu-latest

- name: Run Solidity linters
run: yarn lint:sol
steps:
- uses: actions/checkout@v4

- name: Common setup
uses: ./.github/workflows/setup

- name: Run TS linters
- name: Run eslint
run: yarn lint:ts

types:
name: TypeScript types check
typescript:
name: TypeScript
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- run: corepack enable

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: "yarn"

- name: Install dependencies
run: yarn install
- name: Common setup
uses: ./.github/workflows/setup

- name: Generate typechain types
run: yarn hardhat compile

- name: Run TypeScript types check
- name: Run typescript types check
run: yarn typecheck
19 changes: 19 additions & 0 deletions .github/workflows/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Common setup

on: workflow_call

runs:
using: "composite"
steps:
- name: Enable corepack
shell: bash
run: corepack enable

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn

- name: Install dependencies
shell: bash
run: yarn install
31 changes: 31 additions & 0 deletions .github/workflows/tests-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Integration Tests

on: [push]

jobs:
test_hardhat_integration:
name: Hardhat
runs-on: ubuntu-latest
timeout-minutes: 120

services:
hardhat-node:
image: feofanov/hardhat-node:2.22.4
ports:
- 8545:8545
env:
ETH_RPC_URL: "${{ secrets.ETH_RPC_URL }}"

steps:
- uses: actions/checkout@v4

- name: Common setup
uses: ./.github/workflows/setup

- name: Set env
run: cp .env.example .env

- name: Run integration tests
run: yarn test:integration:fork
env:
LOG_LEVEL: debug
37 changes: 37 additions & 0 deletions .github/workflows/tests-unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Unit Tests

on: [push]

jobs:
test_hardhat_unit:
name: Hardhat
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Common setup
uses: ./.github/workflows/setup

- name: Run unit tests
run: yarn test

test_foundry_fuzzing:
name: Foundry (fuzzing & invariant)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Common setup
uses: ./.github/workflows/setup

- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1
# Use a specific version of Foundry in case nightly is broken
# https://github.com/foundry-rs/foundry/releases
# with:
# version: nightly-54d8510c0f2b0f791f4c5ef99866c6af99b7606a

- name: Run fuzzing and invariant tests
run: forge test -vvv
Loading
Loading