-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b0a5cc
commit 1b6f3e7
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
pragma solidity 0.8.16; | ||
|
||
import "./interfaces/IRatedV1.sol"; | ||
|
||
contract RatedV1Mock is IRatedV1 { | ||
// Storage for validator violations | ||
mapping(bytes32 => uint256[]) public violations; | ||
// Storage for validator disputes | ||
mapping(bytes32 => bool) public disputes; | ||
|
||
constructor() { | ||
} | ||
|
||
// Implementation of IRatedV1.getViolationsForValidator | ||
function getViolationsForValidator(bytes32 _pubKeyRoot) external view override returns (uint256[] memory violatedEpochs) { | ||
return violations[_pubKeyRoot]; | ||
} | ||
|
||
// Implementation of IRatedV1.isValidatorInDispute | ||
function isValidatorInDispute(bytes32 _pubKeyRoot) external view override returns (bool _isInUnfinishedDispute) { | ||
return disputes[_pubKeyRoot]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { ethers } from 'hardhat' | ||
|
||
async function main() { | ||
const ratedV1Mock = await ethers.deployContract('RatedV1Mock', []) | ||
console.log('RatedV1Mock deployed to: ', ratedV1Mock.address) | ||
} | ||
|
||
main() |