Cherry-pick changes from feat/dev-utils/dydx-bridge-validation

This commit is contained in:
Lawrence Forman
2020-01-31 11:40:31 -05:00
parent 79362b0dba
commit 3e8f9a6b53
104 changed files with 1699 additions and 1434 deletions

View File

@@ -206,7 +206,7 @@ blockchainTests.resets('MixinStakingPool unit tests', env => {
{
poolId: nextPoolId,
operator,
operatorShare,
operatorShare: new BigNumber(operatorShare),
},
],
TestMixinStakingPoolEvents.StakingPoolCreated,
@@ -306,8 +306,8 @@ blockchainTests.resets('MixinStakingPool unit tests', env => {
[
{
poolId,
oldOperatorShare: operatorShare,
newOperatorShare: operatorShare - 1,
oldOperatorShare: new BigNumber(operatorShare),
newOperatorShare: new BigNumber(operatorShare - 1),
},
],
TestMixinStakingPoolEvents.OperatorShareDecreased,

View File

@@ -1,13 +1,6 @@
import { ERC20Wrapper } from '@0x/contracts-asset-proxy';
import { DevUtilsContract } from '@0x/contracts-dev-utils';
import {
blockchainTests,
constants,
expect,
expectTransactionFailedAsync,
filterLogsToArguments,
provider,
} from '@0x/contracts-test-utils';
import { blockchainTests, constants, expect, filterLogsToArguments } from '@0x/contracts-test-utils';
import { assetDataUtils } from '@0x/order-utils';
import { RevertReason } from '@0x/types';
import { AuthorizableRevertErrors, BigNumber, SafeMathRevertErrors, StakingRevertErrors } from '@0x/utils';
import { TransactionReceiptWithDecodedLogs } from 'ethereum-types';
@@ -33,8 +26,6 @@ blockchainTests.resets('ZrxVault unit tests', env => {
let zrxAssetData: string;
let zrxProxyAddress: string;
const devUtils = new DevUtilsContract(constants.NULL_ADDRESS, provider);
before(async () => {
// create accounts
accounts = await env.getAccountAddressesAsync();
@@ -47,7 +38,7 @@ blockchainTests.resets('ZrxVault unit tests', env => {
zrxProxyAddress = erc20ProxyContract.address;
// deploy zrx token
const [zrxTokenContract] = await erc20Wrapper.deployDummyTokensAsync(1, constants.DUMMY_TOKEN_DECIMALS);
zrxAssetData = await devUtils.encodeERC20AssetData(zrxTokenContract.address).callAsync();
zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxTokenContract.address);
await erc20Wrapper.setBalancesAndAllowancesAsync();
@@ -233,7 +224,7 @@ blockchainTests.resets('ZrxVault unit tests', env => {
const tx = zrxVault.depositFrom(staker, initialTokenBalance.plus(1)).sendTransactionAsync({
from: stakingProxy,
});
expectTransactionFailedAsync(tx, RevertReason.TransferFailed);
return expect(tx).to.revertWith(RevertReason.TransferFailed);
});
});
describe('Withdrawal', () => {