Skip to content

Commit 9454fee

Browse files
anikaraghumds1
andauthored
chore: codegen Vm.sol to mark envOr functions as view (#491)
* Codegen after adding view to envOr functions in foundry * style: fmt --------- Co-authored-by: Matt Solomon <[email protected]>
1 parent 87a2a0a commit 9454fee

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

src/StdChains.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ abstract contract StdChains {
148148

149149
// lookup rpcUrl, in descending order of priority:
150150
// current -> config (foundry.toml) -> environment variable -> default
151-
function getChainWithUpdatedRpcUrl(string memory chainAlias, Chain memory chain) private returns (Chain memory) {
151+
function getChainWithUpdatedRpcUrl(string memory chainAlias, Chain memory chain)
152+
private
153+
view
154+
returns (Chain memory)
155+
{
152156
if (bytes(chain.rpcUrl).length == 0) {
153157
try vm.rpcUrl(chainAlias) returns (string memory configRpcUrl) {
154158
chain.rpcUrl = configRpcUrl;

src/Vm.sol

Lines changed: 15 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/StdUtils.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ contract StdUtilsMock is StdUtils {
1212
return getTokenBalances(token, addresses);
1313
}
1414

15-
function exposed_bound(int256 num, int256 min, int256 max) external view returns (int256) {
15+
function exposed_bound(int256 num, int256 min, int256 max) external pure returns (int256) {
1616
return bound(num, min, max);
1717
}
1818

19-
function exposed_bound(uint256 num, uint256 min, uint256 max) external view returns (uint256) {
19+
function exposed_bound(uint256 num, uint256 min, uint256 max) external pure returns (uint256) {
2020
return bound(num, min, max);
2121
}
2222

0 commit comments

Comments
 (0)