Skip to content

Commit

Permalink
Chore: fix compiler warnings (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
amusingaxl authored Nov 21, 2024
1 parent 928aa1d commit af7bcbf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions src/DssSpell.t.base.sol
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ contract DssSpellTestBase is Config, DssTest {
DssSpell(spell_).cast();
}

function _checkSystemValues(SystemValues storage values) internal {
function _checkSystemValues(SystemValues storage values) internal view {
// dsr
uint256 expectedDSRRate = rates.rates(values.pot_dsr);
// make sure dsr is less than 100% APR
Expand Down Expand Up @@ -980,7 +980,7 @@ contract DssSpellTestBase is Config, DssTest {
// TODO: have a discussion about how we want to manage the global Line going forward.
}

function _getOSMPrice(address pip) internal returns (uint256) {
function _getOSMPrice(address pip) internal view returns (uint256) {
// vm.load is to pull the price from the LP Oracle storage bypassing the whitelist
uint256 price = uint256(vm.load(
pip,
Expand All @@ -991,12 +991,12 @@ contract DssSpellTestBase is Config, DssTest {
// Give a 10^9 buffer for price appreciation over time
// Note: This currently can't be hit due to the uint112, but we want to backstop
// once the PIP uint256 size is increased
assertTrue(price <= (10 ** 14) * WAD);
assertLe(price, (10 ** 14) * WAD, "TestError/invalid-osm-price");

return price;
}

function _getUNIV2LPPrice(address pip) internal returns (uint256) {
function _getUNIV2LPPrice(address pip) internal view returns (uint256) {
// vm.load is to pull the price from the LP Oracle storage bypassing the whitelist
uint256 price = uint256(vm.load(
pip,
Expand All @@ -1007,7 +1007,7 @@ contract DssSpellTestBase is Config, DssTest {
// Give a 10^9 buffer for price appreciation over time
// Note: This currently can't be hit due to the uint112, but we want to backstop
// once the PIP uint256 size is increased
assertTrue(price <= (10 ** 14) * WAD);
assertLe(price, (10 ** 14) * WAD, "TestError/invalid-univ2lp-price");

return price;
}
Expand Down Expand Up @@ -2171,7 +2171,7 @@ contract DssSpellTestBase is Config, DssTest {
assertEq(join.tic(), 0);
}

function _getSignatures(bytes32 signHash) internal returns (bytes memory signatures, address[] memory signers) {
function _getSignatures(bytes32 signHash) internal pure returns (bytes memory signatures, address[] memory signers) {
// seeds chosen s.t. corresponding addresses are in ascending order
uint8[30] memory seeds = [8,10,6,2,9,15,14,20,7,29,24,13,12,25,16,26,21,22,0,18,17,27,3,28,23,19,4,5,1,11];
uint256 numSigners = seeds.length;
Expand Down Expand Up @@ -2363,7 +2363,7 @@ contract DssSpellTestBase is Config, DssTest {
}
}

function _checkTransferrableVestMkrAllowance() internal {
function _checkTransferrableVestMkrAllowance() internal view {
uint256 vestableAmt;

for(uint256 i = 1; i <= vestMkr.ids(); i++) {
Expand Down Expand Up @@ -2719,7 +2719,7 @@ contract DssSpellTestBase is Config, DssTest {
// This contract may not be deployable.
// Consider enabling the optimizer (with a low "runs" value!),
// turning off revert strings, or using libraries.
function _testContractSize() internal {
function _testContractSize() internal view {
uint256 _sizeSpell;
address _spellAddr = address(spell);
assembly {
Expand Down Expand Up @@ -2834,11 +2834,11 @@ contract DssSpellTestBase is Config, DssTest {
}

uint256 metadataLength = _getBytecodeMetadataLength(expectedAction);
assertTrue(metadataLength <= expectedBytecodeSize, "TestError/metadata-length-gt-expected-bytecode-size");
assertLe(metadataLength, expectedBytecodeSize, "TestError/metadata-length-gt-expected-bytecode-size");
expectedBytecodeSize -= metadataLength;

metadataLength = _getBytecodeMetadataLength(actualAction);
assertTrue(metadataLength <= actualBytecodeSize, "TestError/metadata-length-gt-actual-bytecode-size");
assertLe(metadataLength, actualBytecodeSize, "TestError/metadata-length-gt-actual-bytecode-size");
actualBytecodeSize -= metadataLength;

assertEq(actualBytecodeSize, expectedBytecodeSize, "TestError/bytecode-size-mismatch");
Expand Down
2 changes: 1 addition & 1 deletion src/DssSpell.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ contract DssSpellTest is DssSpellTestBase {
assertEq(Art, 0, "GUSD-A Art is not 0");
}

function testDaoResolutions() public { // add the `skipped` modifier to skip
function testDaoResolutions() public view { // replace `view` with the `skipped` modifier to skip
// For each resolution, add IPFS hash as item to the resolutions array
// Initialize the array with the number of resolutions
string[1] memory resolutions = [
Expand Down

0 comments on commit af7bcbf

Please sign in to comment.