Skip to content

Commit

Permalink
update slither-flat test cases, run solc out its output
Browse files Browse the repository at this point in the history
  • Loading branch information
0xalpharush committed May 6, 2023
1 parent 718e511 commit 6e781e1
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 6 deletions.
10 changes: 8 additions & 2 deletions examples/flat/a.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
contract A{
pragma solidity 0.8.19;

}
error RevertIt();

contract Example {
function reverts() external pure {
revert RevertIt();
}
}
13 changes: 12 additions & 1 deletion examples/flat/b.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import "./a.sol";

contract B is A{
pragma solidity 0.8.19;

enum B {
a,
b
}

contract T {
Example e = new Example();
function b() public returns(uint) {
B b = B.a;
return 4;
}
}
10 changes: 9 additions & 1 deletion scripts/ci_test_flat.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
#!/usr/bin/env bash
shopt -s extglob

### Test slither-prop
### Test slither-flat
solc-select use 0.8.19 --always-install

cd examples/flat || exit 1

if ! slither-flat b.sol; then
echo "slither-flat failed"
exit 1
fi

SUFFIX = '@(sol)'
if ! solc "crytic-export/flattening/"*$SUFFIX; then
echo "solc failed on flattened files"
exit 1
fi

exit 0
2 changes: 1 addition & 1 deletion slither/tools/flattening/export/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

Export = namedtuple("Export", ["filename", "content"])

logger = logging.getLogger("Slither")
logger = logging.getLogger("Slither-flat")


def save_to_zip(files: List[Export], zip_filename: str, zip_type: str = "lzma"):
Expand Down
2 changes: 1 addition & 1 deletion slither/tools/flattening/flattening.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
save_to_disk,
)

logger = logging.getLogger("Slither-flattening")
logger = logging.getLogger("Slither-flat")
logger.setLevel(logging.INFO)

# index: where to start
Expand Down

0 comments on commit 6e781e1

Please sign in to comment.