add createStakingPool and decreaseStakingPoolOperatorShare

This commit is contained in:
Michael Zhu
2019-11-04 17:38:28 -08:00
parent 8e2e9e9331
commit 3c7a0bcd85
8 changed files with 112 additions and 5 deletions

View File

@@ -0,0 +1,22 @@
import { expect } from '@0x/contracts-test-utils';
import { DeploymentManager } from '../utils/deployment_manager';
import { FunctionAssertion, FunctionResult } from '../utils/function_assertions';
export function validDecreaseStakingPoolOperatorShareAssertion(
deployment: DeploymentManager,
context?: any,
): FunctionAssertion<{}> {
const { stakingWrapper } = deployment.staking;
return new FunctionAssertion(stakingWrapper.decreaseStakingPoolOperatorShare, {
after: async (_beforeInfo, _result: FunctionResult, poolId: string, expectedOperatorShare: number) => {
const { operatorShare } = await stakingWrapper.getStakingPool.callAsync(poolId);
expect(operatorShare).to.bignumber.equal(expectedOperatorShare);
console.log(`decreaseStakingPoolOperatorShare(${poolId}, ${expectedOperatorShare})`);
if (context !== undefined) {
context.operatorShares[poolId] = operatorShare;
}
},
});
}