From 08ec258bacfd5cfa6039e9c85559deb7bc5f092c Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Tue, 3 Mar 2020 15:34:36 +0200 Subject: [PATCH] SKALE-2160 Implement unimplemented functions --- contracts/delegation/DelegationService.sol | 26 ---------------------- contracts/delegation/ValidatorService.sol | 11 +++++++++ 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/contracts/delegation/DelegationService.sol b/contracts/delegation/DelegationService.sol index 0bcc9dd40..1c23abcb0 100644 --- a/contracts/delegation/DelegationService.sol +++ b/contracts/delegation/DelegationService.sol @@ -44,10 +44,6 @@ contract DelegationService is Permissions { delegationController.requestUndelegation(delegationId); } - function setMinimumDelegationAmount(uint /* amount */) external pure { - revert("Not implemented"); - } - /// @notice Returns amount of delegated token of the validator function getDelegatedAmount(uint validatorId) external returns (uint) { DelegationController delegationController = DelegationController(contractManager.getContract("DelegationController")); @@ -84,23 +80,6 @@ contract DelegationService is Permissions { validatorService.unlinkNodeAddress(msg.sender, nodeAddress); } - function unregisterValidator(uint /* validatorId */) external pure { - revert("Not implemented"); - } - - /// @notice return how many of validator funds are locked in SkaleManager - function getBondAmount(uint /* validatorId */) external pure returns (uint) { - revert("Not implemented"); - } - - function setValidatorName(string calldata /* newName */) external pure { - revert("Not implemented"); - } - - function setValidatorDescription(string calldata /* description */) external pure { - revert("Not implemented"); - } - function requestForNewAddress(address newAddress) external { ValidatorService(contractManager.getContract("ValidatorService")).requestForNewAddress(msg.sender, newAddress); } @@ -117,11 +96,6 @@ contract DelegationService is Permissions { validatorService.confirmNewAddress(msg.sender, validatorId); } - /// @notice removes node from system - function deleteNode(uint /* nodeIndex */) external pure { - revert("Not implemented"); - } - function initialize(address _contractsAddress) public initializer { Permissions.initialize(_contractsAddress); } diff --git a/contracts/delegation/ValidatorService.sol b/contracts/delegation/ValidatorService.sol index 382dca55c..3733cce3b 100644 --- a/contracts/delegation/ValidatorService.sol +++ b/contracts/delegation/ValidatorService.sol @@ -198,6 +198,7 @@ contract ValidatorService is Permissions { return getValidatorAddresses(getValidatorId(msg.sender)); } + /// @notice return how many of validator funds are locked in SkaleManager function getAndUpdateBondAmount(uint validatorId) external returns (uint delegatedAmount) @@ -206,6 +207,16 @@ contract ValidatorService is Permissions { return delegationController.getAndUpdateDelegatedAmount(validators[validatorId].validatorAddress); } + function setValidatorName(string calldata newName) external { + uint validatorId = getValidatorId(msg.sender); + validators[validatorId].name = newName; + } + + function setValidatorDescription(string calldata newDescription) external { + uint validatorId = getValidatorId(msg.sender); + validators[validatorId].description = newDescription; + } + function initialize(address _contractManager) public initializer { Permissions.initialize(_contractManager); }