Updated changelog and ran linter
This commit is contained in:
parent
877abeda63
commit
5a225795e1
@ -49,6 +49,10 @@
|
|||||||
{
|
{
|
||||||
"note": "Refactored Staking Reward Vault. Moved pool management logic into staking contract.",
|
"note": "Refactored Staking Reward Vault. Moved pool management logic into staking contract.",
|
||||||
"pr": 2156
|
"pr": 2156
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Removed MixinStakingPoolRewardVault.sol",
|
||||||
|
"pr": 2156
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -146,14 +146,4 @@ interface IStakingEvents {
|
|||||||
uint32 oldOperatorShare,
|
uint32 oldOperatorShare,
|
||||||
uint32 newOperatorShare
|
uint32 newOperatorShare
|
||||||
);
|
);
|
||||||
|
|
||||||
/// @dev Emitted when an operator reward is transferred to the Eth vault.
|
|
||||||
/// @param amount The amount in ETH withdrawn.
|
|
||||||
/// @param operator of the pool.
|
|
||||||
/// @param poolId The pool the reward was deposited for.
|
|
||||||
event OperatorRewardTransferredToEthVault(
|
|
||||||
bytes32 poolId,
|
|
||||||
address operator,
|
|
||||||
uint256 amount
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ interface IStructs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// @dev Holds the metadata for a staking pool.
|
/// @dev Holds the metadata for a staking pool.
|
||||||
/// @param initialzed True iff the balance struct is initialized.
|
/// @param initialized True iff the balance struct is initialized.
|
||||||
/// @param operator of the pool.
|
/// @param operator of the pool.
|
||||||
/// @param operatorShare Fraction of the total balance owned by the operator, in ppm.
|
/// @param operatorShare Fraction of the total balance owned by the operator, in ppm.
|
||||||
/// @param numberOfMakers Number of makers in the pool.
|
/// @param numberOfMakers Number of makers in the pool.
|
||||||
|
@ -113,6 +113,8 @@ contract MixinStakingPool is
|
|||||||
return nextPoolId;
|
return nextPoolId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @dev Returns a staking pool
|
||||||
|
/// @param poolId Unique id of pool.
|
||||||
function getStakingPool(bytes32 poolId)
|
function getStakingPool(bytes32 poolId)
|
||||||
public
|
public
|
||||||
view
|
view
|
||||||
@ -132,6 +134,8 @@ contract MixinStakingPool is
|
|||||||
return bytes32(uint256(poolId).safeAdd(POOL_ID_INCREMENT_AMOUNT));
|
return bytes32(uint256(poolId).safeAdd(POOL_ID_INCREMENT_AMOUNT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @dev Reverts iff a staking pool does not exist.
|
||||||
|
/// @param poolId Unique id of pool.
|
||||||
function _assertStakingPoolExists(bytes32 poolId)
|
function _assertStakingPoolExists(bytes32 poolId)
|
||||||
internal
|
internal
|
||||||
view
|
view
|
||||||
@ -148,6 +152,10 @@ contract MixinStakingPool is
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @dev Reverts iff the new operator share is invalid.
|
||||||
|
/// @param poolId Unique id of pool.
|
||||||
|
/// @param currentOperatorShare Current operator share.
|
||||||
|
/// @param newOperatorShare New operator share.
|
||||||
function _assertNewOperatorShare(
|
function _assertNewOperatorShare(
|
||||||
bytes32 poolId,
|
bytes32 poolId,
|
||||||
uint32 currentOperatorShare,
|
uint32 currentOperatorShare,
|
||||||
|
@ -32,6 +32,8 @@ contract MixinStakingPoolRewards is
|
|||||||
|
|
||||||
/// @dev Syncs rewards for a delegator. This includes transferring rewards from
|
/// @dev Syncs rewards for a delegator. This includes transferring rewards from
|
||||||
/// the Reward Vault to the Eth Vault, and adding/removing dependencies on cumulative rewards.
|
/// the Reward Vault to the Eth Vault, and adding/removing dependencies on cumulative rewards.
|
||||||
|
/// This is used by a delegator when they want to sync their rewards without delegating/undelegating.
|
||||||
|
/// It's effectively the same as delegating zero stake.
|
||||||
/// @param poolId Unique id of pool.
|
/// @param poolId Unique id of pool.
|
||||||
function syncDelegatorRewards(bytes32 poolId)
|
function syncDelegatorRewards(bytes32 poolId)
|
||||||
external
|
external
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { expect } from '@0x/contracts-test-utils';
|
import { expect } from '@0x/contracts-test-utils';
|
||||||
import { BigNumber, RevertError } from '@0x/utils';
|
import { RevertError } from '@0x/utils';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { constants as stakingConstants } from '../utils/constants';
|
import { constants as stakingConstants } from '../utils/constants';
|
||||||
@ -35,9 +35,7 @@ export class PoolOperatorActor extends BaseActor {
|
|||||||
);
|
);
|
||||||
expect(poolIdOfMaker, 'pool id of maker').to.be.equal(poolId);
|
expect(poolIdOfMaker, 'pool id of maker').to.be.equal(poolId);
|
||||||
// check the number of makers in the pool
|
// check the number of makers in the pool
|
||||||
const pool = await this._stakingApiWrapper.stakingContract.getStakingPool.callAsync(
|
const pool = await this._stakingApiWrapper.stakingContract.getStakingPool.callAsync(poolId);
|
||||||
poolId,
|
|
||||||
);
|
|
||||||
expect(pool.numberOfMakers, 'number of makers in pool').to.be.bignumber.equal(1);
|
expect(pool.numberOfMakers, 'number of makers in pool').to.be.bignumber.equal(1);
|
||||||
}
|
}
|
||||||
return poolId;
|
return poolId;
|
||||||
|
@ -113,12 +113,6 @@ blockchainTests.resets('Testing Rewards', env => {
|
|||||||
? _expectedEndBalances.poolRewardVaultBalance
|
? _expectedEndBalances.poolRewardVaultBalance
|
||||||
: ZERO,
|
: ZERO,
|
||||||
};
|
};
|
||||||
/*
|
|
||||||
const pool = await stakingApiWrapper.stakingContract.getStakingPool.callAsync(poolId);
|
|
||||||
const operatorBalance = pool[2];
|
|
||||||
const membersBalance = pool[3];
|
|
||||||
const poolBalances = { poolBalance: operatorBalance.plus(membersBalance), operatorBalance, membersBalance };
|
|
||||||
*/
|
|
||||||
const finalEndBalancesAsArray = await Promise.all([
|
const finalEndBalancesAsArray = await Promise.all([
|
||||||
// staker 1
|
// staker 1
|
||||||
stakingApiWrapper.stakingContract.computeRewardBalanceOfDelegator.callAsync(
|
stakingApiWrapper.stakingContract.computeRewardBalanceOfDelegator.callAsync(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user