Skip to content

Commit 9b52208

Browse files
authored
Merge pull request #12530 from ethereum/yield-liquidator-ext-test
External test for Yield Protocol Liquidator v2
2 parents 5499c58 + 4de1367 commit 9b52208

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed

.circleci/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,13 @@ workflows:
13881388
binary_type: native
13891389
# NOTE: Tests crash on nodejs 17: "Error: error:0308010C:digital envelope routines::unsupported"
13901390
nodejs_version: '16'
1391+
- t_ems_ext:
1392+
<<: *workflow_ubuntu2004_static
1393+
name: t_native_test_ext_yield_liquidator
1394+
project: yield-liquidator
1395+
binary_type: native
1396+
# NOTE: Tests crash on nodejs 17: "Error: error:0308010C:digital envelope routines::unsupported"
1397+
nodejs_version: '16'
13911398

13921399
# Windows build and tests
13931400
- b_win: *workflow_trigger_on_tags

test/externalTests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ printTask "Running external tests..."
4444
"$REPO_ROOT/externalTests/ens.sh" "$@"
4545
"$REPO_ROOT/externalTests/trident.sh" "$@"
4646
"$REPO_ROOT/externalTests/euler.sh" "$@"
47+
"$REPO_ROOT/externalTests/yield-liquidator.sh" "$@"
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/usr/bin/env bash
2+
3+
# ------------------------------------------------------------------------------
4+
# This file is part of solidity.
5+
#
6+
# solidity is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, either version 3 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# solidity is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with solidity. If not, see <http://www.gnu.org/licenses/>
18+
#
19+
# (c) 2022 solidity contributors.
20+
#------------------------------------------------------------------------------
21+
22+
set -e
23+
24+
source scripts/common.sh
25+
source test/externalTests/common.sh
26+
27+
verify_input "$@"
28+
BINARY_TYPE="$1"
29+
BINARY_PATH="$2"
30+
SELECTED_PRESETS="$3"
31+
32+
function compile_fn { npm run build; }
33+
function test_fn { npm run test; }
34+
35+
function yield_liquidator_test
36+
{
37+
local repo="https://github.com/yieldprotocol/yield-liquidator-v2"
38+
local ref_type=branch
39+
local ref="master"
40+
local config_file="hardhat.config.ts"
41+
local config_var="module.exports"
42+
43+
local compile_only_presets=()
44+
local settings_presets=(
45+
"${compile_only_presets[@]}"
46+
#ir-no-optimize # Compilation fails with "YulException: Variable var_roles_168_mpos is 2 slot(s) too deep inside the stack."
47+
#ir-optimize-evm-only # Compilation fails with "YulException: Variable var__33 is 6 slot(s) too deep inside the stack."
48+
ir-optimize-evm+yul
49+
legacy-optimize-evm-only
50+
legacy-optimize-evm+yul
51+
legacy-no-optimize
52+
)
53+
54+
[[ $SELECTED_PRESETS != "" ]] || SELECTED_PRESETS=$(circleci_select_steps_multiarg "${settings_presets[@]}")
55+
print_presets_or_exit "$SELECTED_PRESETS"
56+
57+
setup_solc "$DIR" "$BINARY_TYPE" "$BINARY_PATH"
58+
download_project "$repo" "$ref_type" "$ref" "$DIR"
59+
60+
neutralize_package_lock
61+
neutralize_package_json_hooks
62+
force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH"
63+
force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")" "$config_var"
64+
force_hardhat_unlimited_contract_size "$config_file" "$config_var"
65+
npm install
66+
67+
replace_version_pragmas
68+
69+
for preset in $SELECTED_PRESETS; do
70+
hardhat_run_test "$config_file" "$preset" "${compile_only_presets[*]}" compile_fn test_fn "$config_var"
71+
done
72+
}
73+
74+
external_test Yield-Liquidator-V2 yield_liquidator_test

0 commit comments

Comments
 (0)