Skip to content

Commit

Permalink
RatedV1Mock
Browse files Browse the repository at this point in the history
  • Loading branch information
dulguun-staderlabs committed May 2, 2024
1 parent 5b0a5cc commit 1b6f3e7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
24 changes: 24 additions & 0 deletions contracts/RatedV1Mock.sol
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];
}
}
8 changes: 8 additions & 0 deletions scripts/deploy/ratedV1Mock.ts
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()

0 comments on commit 1b6f3e7

Please sign in to comment.