Skip to content

Commit

Permalink
Do not use same interface names as Forge to avoid collusions (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferranbt authored Aug 6, 2024
1 parent 5199304 commit 26d649b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/forge/Connector.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.8;

import "forge-std/Test.sol";

interface VmSafe {
interface connectorVmSafeRef {
struct FfiResult {
int32 exitCode;
bytes stdout;
Expand All @@ -16,7 +16,7 @@ interface VmSafe {
}

contract Connector is Test {
VmSafe internal constant vmSafe = VmSafe(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);
connectorVmSafeRef internal constant vmSafe = connectorVmSafeRef(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);

function forgeIt(bytes memory addr, bytes memory data) internal returns (bytes memory) {
string memory root = vmSafe.projectRoot();
Expand All @@ -34,7 +34,7 @@ contract Connector is Test {
inputs[5] = addrHex;
inputs[6] = dataHex;

VmSafe.FfiResult memory result = vmSafe.tryFfi(inputs);
connectorVmSafeRef.FfiResult memory result = vmSafe.tryFfi(inputs);
if (result.exitCode == 0) {
return result.stdout;
}
Expand Down
4 changes: 2 additions & 2 deletions test/Fixtures.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.13;

interface vmSafe {
interface fixturesVmSafeRef {
function readFile(string calldata path) external view returns (string memory data);
}

library Fixtures {
vmSafe constant vm = vmSafe(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);
fixturesVmSafeRef constant vm = fixturesVmSafeRef(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);

function readFixture(string memory path) internal view returns (string memory) {
string memory fullPath = string.concat("./test/fixtures/", path);
Expand Down

0 comments on commit 26d649b

Please sign in to comment.