From 9d5daffe6e7e1c3bcd43397bf1a2558baae2ec57 Mon Sep 17 00:00:00 2001 From: Viktoriia Zotova Date: Mon, 9 Sep 2024 15:30:19 -0400 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: David Núñez --- contracts/staking/TokenStaking.sol | 16 ++++++++++++++++ docs/rfc-1-staking-contract.adoc | 7 ++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/contracts/staking/TokenStaking.sol b/contracts/staking/TokenStaking.sol index 3121202..8ab1962 100644 --- a/contracts/staking/TokenStaking.sol +++ b/contracts/staking/TokenStaking.sol @@ -822,6 +822,22 @@ contract TokenStaking is Initializable, IStaking, Checkpoints { .authorized; } + /// @notice Returns staked amount of T for the specified staking provider. + /// @dev Method is deprecated. Use `stakeAmount` instead + function stakes(address stakingProvider) + external + view + returns ( + uint96 tStake, + uint96 keepInTStake, + uint96 nuInTStake + ) + { + tStake = stakingProviders[stakingProvider].tStake; + keepInTStake = 0; + nuInTStake = 0; + } + /// @notice Returns staked amount of T for the specified staking provider. function stakeAmount(address stakingProvider) external diff --git a/docs/rfc-1-staking-contract.adoc b/docs/rfc-1-staking-contract.adoc index fda9adc..644ef31 100644 --- a/docs/rfc-1-staking-contract.adoc +++ b/docs/rfc-1-staking-contract.adoc @@ -342,6 +342,11 @@ each affected application. Returns the authorized stake amount of the staking provider for the application. +==== `stakes(address stakingProvider) external view returns (uint96 tStake, uint96 keepInTStake, uint96 nuInTStake)` + +Returns staked amount of T for the specified staking provider. +Method is deprecated. Use `stakeAmount` instead. + ==== `stakeAmount(address stakingProvider) external view returns (uint96)` Returns staked amount of T for the specified staking provider. @@ -372,7 +377,7 @@ Returns length of slashing queue ==== `getMaxAuthorization(address stakingProvider) external view returns (uint96)` -Returns the maximum application authorization +Returns the maximum application authorization. ==== `getAvailableToAuthorize(address stakingProvider, address application) external view returns (uint96)`