Skip to content

Commit

Permalink
DoubleSigningSlasher Foundry test (#10839)
Browse files Browse the repository at this point in the history
* fixed gold token actors

* ++ doubleSigningSlasher test

* ∆ conflicting function name

* set epochSize manually
  • Loading branch information
soloseng authored Feb 1, 2024
1 parent 749956e commit 7eec983
Show file tree
Hide file tree
Showing 4 changed files with 392 additions and 205 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
pragma solidity ^0.5.13;

import "../DoubleSigningSlasher.sol";

contract MockUsingPrecompiles {
mapping(bytes32 => bytes32) verifiedSealBitmap;
mapping(uint256 => bytes32) parentSealBitmap;
Expand All @@ -27,6 +25,7 @@ contract MockUsingPrecompiles {

function calcEpoch(uint256 blockNumber) internal pure returns (uint256) {
uint256 epochSize = 100;

// Follows GetEpochNumber from celo-blockchain/blob/master/consensus/istanbul/utils.go
uint256 epochNumber = blockNumber / epochSize;
if (blockNumber % epochSize == 0) {
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/test-sol/common/GoldToken.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contract GoldTokenTest is Test {
function setUp() public {
goldToken = new GoldToken(true);
receiver = actor("receiver");
receiver = actor("sender");
sender = actor("sender");
vm.deal(receiver, ONE_GOLDTOKEN);
vm.deal(sender, ONE_GOLDTOKEN);
}
Expand Down
Loading

0 comments on commit 7eec983

Please sign in to comment.