Aligned ECDSAKeepStub with keep interface
We updated ECDSAKeepStub to more closely reflect IBondedECDSAKeep
interface.
removed `distributeETHToMembers` function which was removed from the
interface
updated order of functions in stub to be same as in the interface
pragma solidity ^0.5.10;
-import {IBondedECDSAKeep} from "@keep-network/keep-ecdsa/contracts/api/IBondedECDSAKeep.sol";
+import {
+ IBondedECDSAKeep
+} from "@keep-network/keep-ecdsa/contracts/api/IBondedECDSAKeep.sol";
/// @notice Implementation of ECDSAKeep interface used in tests only
/// @dev This is a stub used in tests, so we don't have to call actual ECDSAKeep
@@ -10,39 +12,43 @@ contract ECDSAKeepStub is IBondedECDSAKeep {
uint256 bondAmount = 10000;
// Notification that the keep was requested to sign a digest.
- event SignatureRequested(
- bytes32 digest
- );
+ event SignatureRequested(bytes32 digest);
// Define fallback function so the contract can accept ether.
function() external payable {}
+ // Functions implemented for IBondedECDSAKeep interface.
+
function getPublicKey() external view returns (bytes memory) {
return publicKey;
}
+ function checkBondAmount() external view returns (uint256) {
+ return bondAmount;
+ }
+
function sign(bytes32 _digest) external {
emit SignatureRequested(_digest);
}
- function returnPartialSignerBonds() external payable {
+ function distributeETHReward() external payable {
// solium-disable-previous-line no-empty-blocks
}
- function distributeETHToMembers() external payable {
+ function distributeERC20Reward(address _asset, uint256 _value) external {
// solium-disable-previous-line no-empty-blocks
}
- function distributeERC20Reward(address _asset, uint256 _value) external {
- // solium-disable-previous-line no-empty-blocks
+ function seizeSignerBonds() external {
+ if (address(this).balance > 0) {
+ msg.sender.transfer(address(this).balance);
+ }
}
- function distributeETHReward() external payable{
+ function returnPartialSignerBonds() external payable {
// solium-disable-previous-line no-empty-blocks
}
- // Functions implemented for IBondedECDSAKeep interface.
-
function submitSignatureFraud(
uint8,
bytes32,
@@ -50,17 +56,9 @@ contract ECDSAKeepStub is IBondedECDSAKeep {
bytes32,
bytes calldata
) external returns (bool) {
- return success;
- }
+ require(success, "Signature is not fraudulent");
- function checkBondAmount() external view returns (uint256){
- return bondAmount;
- }
-
- function seizeSignerBonds() external {
- if (address(this).balance > 0) {
- msg.sender.transfer(address(this).balance);
- }
+ return success;
}
function closeKeep() external {
