Skip to content

Commit bdb472e

Browse files
committed
Use relative imports for interfaces
When importing Flexible Voting into another repository, the forge coverage tool was failing with the error: "Could not read source code for analysis" linked to the imports of interface files from the FlexibleVotingClient contract. While the non-relative imports work fine in the context of this repo, and even in the context of running tests normally when used as an import, they cause an issue for the coverage tool. It's unclear if this is a bug with foundry or something with our configuration. Regardless, the easiest fix is simply to use relative imports, which we do here. Read more about the issue here: foundry-rs/foundry#2915
1 parent ac713a1 commit bdb472e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/FlexVotingClient.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ pragma solidity >=0.8.10;
33

44
import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol";
55
import {Checkpoints} from "@openzeppelin/contracts/utils/Checkpoints.sol";
6-
import {IFractionalGovernor} from "src/interfaces/IFractionalGovernor.sol";
7-
import {IVotingToken} from "src/interfaces/IVotingToken.sol";
6+
import {IFractionalGovernor} from "./interfaces/IFractionalGovernor.sol";
7+
import {IVotingToken} from "./interfaces/IVotingToken.sol";
88

99
/// @notice This is an abstract contract designed to make it easy to build clients
1010
/// for governance systems that inherit from GovernorCountingFractional, a.k.a.

src/FractionalPool.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ pragma solidity ^0.8.10;
33

44
import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol";
55
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
6-
import {IFractionalGovernor} from "src/interfaces/IFractionalGovernor.sol";
7-
import {IVotingToken} from "src/interfaces/IVotingToken.sol";
6+
import {IFractionalGovernor} from "./interfaces/IFractionalGovernor.sol";
7+
import {IVotingToken} from "./interfaces/IVotingToken.sol";
88

99
/// @notice A proof-of-concept implementation demonstrating how Flexible Voting can be used to
1010
/// allow holders of governance tokens to use them in DeFi but still participate in governance. The

0 commit comments

Comments
 (0)