Skip to content

Commit 74c0c8d

Browse files
committed
Add test
1 parent 7e830e0 commit 74c0c8d

File tree

4 files changed

+44
-3
lines changed

4 files changed

+44
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
os: ["ubuntu-latest", "windows-2022"]
21-
type: ["brownie", "buidler", "dapp", "embark", "etherlime", "hardhat", "solc", "truffle", "waffle", "foundry"]
21+
type: ["brownie", "buidler", "dapp", "embark", "etherlime", "hardhat", "solc", "truffle", "waffle", "foundry", "standard"]
2222
exclude:
2323
# Currently broken, tries to pull git:// which is blocked by GH
2424
- type: embark

crytic_compile/__main__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from crytic_compile.crytic_compile import compile_all, get_platforms
1414
from crytic_compile.cryticparser import DEFAULTS_FLAG_IN_CONFIG, cryticparser
1515
from crytic_compile.platform import InvalidCompilation
16+
from crytic_compile.platform.all_export import PLATFORMS_EXPORT
1617
from crytic_compile.utils.zip import ZIP_TYPES_ACCEPTED, save_to_zip
1718

1819
if TYPE_CHECKING:
@@ -50,8 +51,8 @@ def parse_args() -> argparse.Namespace:
5051

5152
parser.add_argument(
5253
"--export-format",
53-
help="""Export json with non crytic-compile format
54-
(default None. Accepted: standard, solc, truffle)""",
54+
help=f"""Export json with non crytic-compile format
55+
(default None. Accepted: ({",".join([key for key in PLATFORMS_EXPORT.keys()])}""",
5556
action="store",
5657
dest="export_format",
5758
default=None,

crytic_compile/platform/standard.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from crytic_compile.platform import Type as PlatformType
1313
from crytic_compile.platform.abstract_platform import AbstractPlatform
1414
from crytic_compile.utils.naming import Filename
15+
1516
# Cycle dependency
1617
from crytic_compile.utils.natspec import Natspec
1718

scripts/ci_test_standard.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
DIR=$(mktemp -d)
4+
5+
cp tests/contract.sol "$DIR"
6+
cd "$DIR" || exit 255
7+
8+
crytic-compile contract.sol --export-format archive
9+
10+
if [ $? -ne 0 ]
11+
then
12+
echo "Standard test failed"
13+
exit 255
14+
fi
15+
16+
crytic-compile crytic-export/contract.sol_export_archive.json
17+
18+
if [ $? -ne 0 ]
19+
then
20+
echo "Standard test failed"
21+
exit 255
22+
fi
23+
24+
25+
crytic-compile contract.sol --export-zip test.zip
26+
27+
if [ $? -ne 0 ]
28+
then
29+
echo "Standard test failed"
30+
exit 255
31+
fi
32+
33+
crytic-compile test.zip
34+
35+
if [ $? -ne 0 ]
36+
then
37+
echo "Standard test failed"
38+
exit 255
39+
fi

0 commit comments

Comments
 (0)