Fix tests

This commit is contained in:
Amir Bandeali 2019-09-23 15:55:28 -07:00
parent 62663ed6d2
commit 5ce988957f
3 changed files with 11 additions and 7 deletions

View File

@ -126,9 +126,10 @@ contract MixinExchangeFees is
activePoolsThisEpoch[poolId] = pool;
}
/// @dev Returns the total balance of this contract, including WETH.
/// @dev Returns the total balance of this contract, including WETH,
/// minus any WETH that has been reserved for rewards.
/// @return totalBalance Total balance.
function getTotalBalance()
function getAvailableBalance()
external
view
returns (uint256 totalBalance)

View File

@ -42,9 +42,14 @@ contract TestStakingNoWETH is
return true;
}
function _wrapEthAndGetWethBalance()
function _wrapEth()
internal
returns (uint256 balance)
{}
function _getAvailableWethBalance()
internal
view
returns (uint256)
{
return address(this).balance;
}

View File

@ -241,9 +241,7 @@ export class FinalizerActor extends BaseActor {
this._stakingApiWrapper.stakingContract.getActiveStakingPoolThisEpoch.callAsync(poolId),
),
);
const totalRewards = await this._stakingApiWrapper.utils.getEthAndWethBalanceOfAsync(
this._stakingApiWrapper.stakingContract.address,
);
const totalRewards = await this._stakingApiWrapper.stakingContract.getAvailableBalance.callAsync();
const totalFeesCollected = BigNumber.sum(...activePools.map(p => p.feesCollected));
const totalWeightedStake = BigNumber.sum(...activePools.map(p => p.weightedStake));
if (totalRewards.eq(0) || totalFeesCollected.eq(0) || totalWeightedStake.eq(0)) {