The testing-suite is configured for use with Ganache on a forked bsc - mainnet.
To run the tests:
-
Install Brownie & Ganache-CLI, if you haven't already.
-
Sign up for BSCSCAN and generate an API key. This is required for fetching source codes of the mainnet contracts we will be interacting with. Store the API key in the
BSCSCAN_TOKEN
environment variable.
export BSCSCAN_TOKEN=YourApiToken
- Install project dependencies.
pip install -r requirements.txt
- Run the tests.
brownie test test/test_stableoracle_deployed.py -s --network bsc-main-fork
To deploy the contract and initialize the registry:
- Create an account and store it in brownie (you'll have to provide your private key or create a new one)
brownie accounts new <id>
Follow the instructions.
- Change the source file, replace
YOUR ACCOUNT
with the id of the account you generated (the ID, not public or private key!!)
me = accounts.load('YOUR_ACCOUNT')
- Run the script
brownie run deploy --network bsc-main