Skip to content

Commit e79a25e

Browse files
authored
Merge pull request #12560 from ethereum/pool-together-ext-test
External test for PoolTogether v4
2 parents c3c5937 + 93f7d5f commit e79a25e

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed

.circleci/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,13 @@ defaults:
552552
# NOTE: Tests crash on nodejs 17: "Error: error:0308010C:digital envelope routines::unsupported"
553553
nodejs_version: '16'
554554
resource_class: medium
555+
- job_native_test_ext_pool_together: &job_native_test_ext_pool_together
556+
<<: *workflow_ubuntu2004_static
557+
name: t_native_test_ext_pool_together
558+
project: pool-together
559+
binary_type: native
560+
# NOTE: Tests crash on nodejs 17: "Error: error:0308010C:digital envelope routines::unsupported"
561+
nodejs_version: '16'
555562
- job_ems_test_ext_colony: &job_ems_test_ext_colony
556563
<<: *workflow_emscripten
557564
name: t_ems_test_ext_colony
@@ -1433,6 +1440,7 @@ workflows:
14331440
- t_ems_ext: *job_native_test_ext_euler
14341441
- t_ems_ext: *job_native_test_ext_yield_liquidator
14351442
- t_ems_ext: *job_native_test_ext_bleeps
1443+
- t_ems_ext: *job_native_test_ext_pool_together
14361444

14371445
# Windows build and tests
14381446
- b_win: *workflow_trigger_on_tags

test/externalTests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ printTask "Running external tests..."
4646
"$REPO_ROOT/externalTests/euler.sh" "$@"
4747
"$REPO_ROOT/externalTests/yield-liquidator.sh" "$@"
4848
"$REPO_ROOT/externalTests/bleeps.sh" "$@"
49+
"$REPO_ROOT/externalTests/pool-together.sh" "$@"

test/externalTests/pool-together.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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 { yarn compile; }
33+
function test_fn { yarn test; }
34+
35+
function pool_together_test
36+
{
37+
local repo="https://github.com/pooltogether/v4-core"
38+
local ref_type=branch
39+
local ref=master
40+
local config_file="hardhat.config.ts"
41+
local config_var="config"
42+
43+
local compile_only_presets=()
44+
local settings_presets=(
45+
"${compile_only_presets[@]}"
46+
#ir-no-optimize # Compilation fails with "YulException: Variable var_amount_205 is 9 slot(s) too deep inside the stack."
47+
#ir-optimize-evm-only # Compilation fails with "YulException: Variable var_amount_205 is 9 slot(s) too deep inside the stack."
48+
#ir-optimize-evm+yul # FIXME: ICE due to https://github.com/ethereum/solidity/issues/12558
49+
legacy-no-optimize
50+
legacy-optimize-evm-only
51+
legacy-optimize-evm+yul
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+
yarn install
65+
66+
# These come with already compiled artifacts. We want them recompiled with latest compiler.
67+
rm -r node_modules/@pooltogether/yield-source-interface/artifacts/
68+
rm -r node_modules/@pooltogether/uniform-random-number/artifacts/
69+
rm -r node_modules/@pooltogether/owner-manager-contracts/artifacts/
70+
71+
replace_version_pragmas
72+
73+
for preset in $SELECTED_PRESETS; do
74+
hardhat_run_test "$config_file" "$preset" "${compile_only_presets[*]}" compile_fn test_fn "$config_var"
75+
done
76+
}
77+
78+
external_test Pool-Together-V4 pool_together_test

0 commit comments

Comments
 (0)