Skip to content

Commit ffa2ee0

Browse files
authored
fix(StdInvariant): correct targetArtifactSelector type (#524)
The return type of `targetArtifactSelector` is `(string, bytes4[])[]`. See: <https://github.com/foundry-rs/foundry/blob/db8ea58ba607075ce0f39bb975a38da6b4889ea1/crates/evm/evm/src/executors/invariant/mod.rs#L377-L379>
1 parent 5475f85 commit ffa2ee0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/StdInvariant.sol

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ abstract contract StdInvariant {
99
bytes4[] selectors;
1010
}
1111

12+
struct FuzzArtifactSelector {
13+
string artifact;
14+
bytes4[] selectors;
15+
}
16+
1217
struct FuzzInterface {
1318
address addr;
1419
string[] artifacts;
@@ -22,7 +27,8 @@ abstract contract StdInvariant {
2227
string[] private _excludedArtifacts;
2328
string[] private _targetedArtifacts;
2429

25-
FuzzSelector[] private _targetedArtifactSelectors;
30+
FuzzArtifactSelector[] private _targetedArtifactSelectors;
31+
2632
FuzzSelector[] private _targetedSelectors;
2733

2834
FuzzInterface[] private _targetedInterfaces;
@@ -46,7 +52,7 @@ abstract contract StdInvariant {
4652
_targetedArtifacts.push(newTargetedArtifact_);
4753
}
4854

49-
function targetArtifactSelector(FuzzSelector memory newTargetedArtifactSelector_) internal {
55+
function targetArtifactSelector(FuzzArtifactSelector memory newTargetedArtifactSelector_) internal {
5056
_targetedArtifactSelectors.push(newTargetedArtifactSelector_);
5157
}
5258

@@ -85,7 +91,7 @@ abstract contract StdInvariant {
8591
targetedArtifacts_ = _targetedArtifacts;
8692
}
8793

88-
function targetArtifactSelectors() public view returns (FuzzSelector[] memory targetedArtifactSelectors_) {
94+
function targetArtifactSelectors() public view returns (FuzzArtifactSelector[] memory targetedArtifactSelectors_) {
8995
targetedArtifactSelectors_ = _targetedArtifactSelectors;
9096
}
9197

0 commit comments

Comments
 (0)