Skip to content

Commit ad4059c

Browse files
committed
Naming change: pendingStake and pendingFees for delegators
1 parent c523ea5 commit ad4059c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

contracts/bonding/BondingManager.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,10 +575,10 @@ contract BondingManager is ManagerProxyTarget, IBondingManager {
575575
}
576576

577577
/*
578-
* @dev Returns bonded stake for a delegator. Includes reward pool shares since lastClaimTokenPoolsSharesRound
578+
* @dev Returns pending bonded stake for a delegator. Includes reward pool shares since lastClaimTokenPoolsSharesRound
579579
* @param _delegator Address of delegator
580580
*/
581-
function delegatorStake(address _delegator) public view returns (uint256) {
581+
function pendingStake(address _delegator) public view returns (uint256) {
582582
Delegator storage del = delegators[_delegator];
583583

584584
// Add rewards from the rounds during which the delegator was bonded to a transcoder
@@ -603,10 +603,10 @@ contract BondingManager is ManagerProxyTarget, IBondingManager {
603603
}
604604

605605
/*
606-
* @dev Returns fees for a delegator. Includes fee pool shares since lastClaimTokenPoolsSharesRound
606+
* @dev Returns pending fees for a delegator. Includes fee pool shares since lastClaimTokenPoolsSharesRound
607607
* @param _delegator Address of delegator
608608
*/
609-
function delegatorFees(address _delegator) public view returns (uint256) {
609+
function pendingFees(address _delegator) public view returns (uint256) {
610610
Delegator storage del = delegators[_delegator];
611611

612612
// Add fees from the rounds during which the delegator was bonded to a transcoder

test/unit/BondingManager.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ contract("BondingManager", accounts => {
465465
})
466466
})
467467

468-
describe("delegatorStake", async () => {
468+
describe("pendingStake", async () => {
469469
const tAddr = accounts[1]
470470
const dAddr = accounts[2]
471471

@@ -514,12 +514,12 @@ contract("BondingManager", accounts => {
514514
const delegatorsRewardShare = Math.floor((mintedTokens * (PERC_DIVISOR - blockRewardCut)) / PERC_DIVISOR)
515515
const delegatorRewardShare = Math.floor((2000 * delegatorsRewardShare) / transcoderTotalStake)
516516
const expDelegatorStake = add(2000, delegatorRewardShare).toString()
517-
const delegatorStake = await bondingManager.delegatorStake(dAddr)
518-
assert.equal(delegatorStake.toString(), expDelegatorStake, "delegator stake incorrect")
517+
const pendingStake = await bondingManager.pendingStake(dAddr)
518+
assert.equal(pendingStake.toString(), expDelegatorStake, "delegator stake incorrect")
519519
})
520520
})
521521

522-
describe("delegatorFees", () => {
522+
describe("pendingFees", () => {
523523
const tAddr = accounts[1]
524524
const dAddr = accounts[2]
525525

@@ -562,11 +562,11 @@ contract("BondingManager", accounts => {
562562
await fixture.jobsManager.distributeFees()
563563
})
564564

565-
it("should compute delegator's colellected fees with latest fee shares", async () => {
565+
it("should compute delegator's collected fees with latest fee shares", async () => {
566566
const delegatorsFeeShare = Math.floor((fees * feeShare) / PERC_DIVISOR)
567567
const delegatorFeeShare = Math.floor((2000 * delegatorsFeeShare) / transcoderTotalStake)
568568
const expFees = delegatorFeeShare
569-
const dFees = await bondingManager.delegatorFees(dAddr)
569+
const dFees = await bondingManager.pendingFees(dAddr)
570570
assert.equal(dFees, expFees, "delegator fees incorrect")
571571
})
572572
})

0 commit comments

Comments
 (0)