This is the test suite for the Mero contracts.
To run the full test suite, run:
brownie test
Components of the Mero protocol may be tested in either development or mainnet-fork mode. By default, the tests will run in development mode.
To run the tests in mainnet-fork mode, run:
brownie test --network mainnet-fork
By default (i.e. brownie test) the full test suite will be run. Note that there is a set of common tests, which are applied to all liquidity pools by default. If a specific pool is to be tested via the --pool command line argument (see below), then only the specified pool will be tested against the common tests.
Depending on the underlying token of a liquidity pool, the pool will be tested against either the erc20 or eth tests.
The tests that are located outside of the common, erc20 and eth directories are using a DAI liquidity pool by default (this should not affect the tests), unless specified otherwise through the --pool flag.
Liquidity pools belong to one of two types depending on the underlying asset: erc20 liquidity pools or eth liquidity pools. To target only one of the two types in the tests, the --type flag can be set:
brownie test --type <POOL_TYPE`>
For example, to only target liquidity pools that hold an ERC20 token, run:
brownie test --type erc20
The Mero protocol has the following liquidity pools:
- DAI
- USDC
- ETH
To target a specific pool, run:
brownie test --pool <NAME>
For instance, to run all tests for the DAI pool, run:
brownie test --pool dai
Each pool has a testconf.json configuration file (e.g. for DAI) in it's own directory located within the tests/configs directory. The config stores data such as:
underlyingasset addressdecimalsof underlying assetnameof poolsymbolof pool LP tokenstrategyof the pool
This may be extended as the test suite is further developed.