Skip to content

Commit

Permalink
fix migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvol committed Sep 19, 2024
1 parent c5e2b51 commit 1cef701
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 8 additions & 4 deletions packages/protocol/test-sol/precompiles/EpochSizePrecompile.sol
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
// TODO move this to test folder
pragma solidity >=0.8.7 <0.8.20;

address constant EPOCH_SIZEPRE_COMPILE_ADDRESS = address(0xff - 7);

contract EpochSizePrecompile {
address constant ADDRESS = EPOCH_SIZEPRE_COMPILE_ADDRESS;

uint256 public EPOCH_SIZE = 100;
uint256 public constant EPOCH_SIZE = 100;
uint256 public epochSizeSet;

receive() external payable {}

fallback(bytes calldata) external payable returns (bytes memory) {
// this is required because when the migrations deploy the precompiles
// they don't get constructed
if (epochSizeSet != 0) {
return abi.encodePacked(epochSizeSet);
}
return abi.encodePacked(EPOCH_SIZE);
}

function setEpochSize(uint256 epochSize) public {
EPOCH_SIZE = epochSize;
epochSizeSet = epochSize;
}

function getAddress() public pure returns (address) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
pragma solidity >=0.8.7 <0.8.20;

import "celo-foundry-8/Test.sol";

import "@celo-contracts-8/common/EpochManagerEnabler.sol";

import "@celo-contracts/stability/test/MockSortedOracles.sol";

import "@celo-contracts/common/interfaces/IRegistry.sol";

import { EPOCH_SIZEPRE_COMPILE_ADDRESS, EpochSizePrecompile } from "@test-sol/precompiles/EpochSizePrecompile.sol";
Expand Down

0 comments on commit 1cef701

Please sign in to comment.