Skip to content

Commit

Permalink
Merge pull request #113 from skalenetwork/feature/SKALE-2160-not-impl…
Browse files Browse the repository at this point in the history
…emented

SKALE-2160 Implement unimplemented functions
  • Loading branch information
DimaStebaev authored Mar 5, 2020
2 parents a3ddef5 + 08ec258 commit e285cb2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 26 deletions.
26 changes: 0 additions & 26 deletions contracts/delegation/DelegationService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down
11 changes: 11 additions & 0 deletions contracts/delegation/ValidatorService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}
Expand Down

0 comments on commit e285cb2

Please sign in to comment.