forked from BendDAO/bend-lending-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-test-env.sh
38 lines (31 loc) · 1.15 KB
/
setup-test-env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# @dev
# This bash script setups the needed artifacts to use
# the @benddao/bend-deploy package as source of deployment
# scripts for testing or coverage purposes.
#
# A separate artifacts directory was created
# due at running tests all external artifacts
# located at /artifacts are deleted, causing
# the deploy library to not find the external
# artifacts.
echo "[BASH] Setting up testnet enviroment"
if [ ! "$COVERAGE" = true ]; then
# remove hardhat and artifacts cache
npm run ci:clean
# compile @benddao/bend-protocol contracts
npm run compile
else
echo "[BASH] Skipping compilation to keep coverage artifacts"
fi
# Copy artifacts into separate directory to allow
# the hardhat-deploy library load all artifacts without duplicates
mkdir -p temp-artifacts
cp -r artifacts/* temp-artifacts
# Import external @benddao/deploy artifacts
mkdir -p temp-artifacts/bend-deploy
cp -r node_modules/@benddao/bend-deploy/artifacts/contracts/* temp-artifacts/deploy
# Export MARKET_NAME variable to use Bend market as testnet deployment setup
export MARKET_NAME="Test"
export ENABLE_REWARDS="false"
echo "[BASH] Testnet enviroment ready"