@0x/contracts-asset-proxy: Minor ERC20BridgeProxy test changes.
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
|||||||
Numberish,
|
Numberish,
|
||||||
randomAddress,
|
randomAddress,
|
||||||
} from '@0x/contracts-test-utils';
|
} from '@0x/contracts-test-utils';
|
||||||
|
import { AssetProxyId } from '@0x/types';
|
||||||
import { AbiEncoder, AuthorizableRevertErrors, BigNumber, StringRevertError } from '@0x/utils';
|
import { AbiEncoder, AuthorizableRevertErrors, BigNumber, StringRevertError } from '@0x/utils';
|
||||||
import { DecodedLogs } from 'ethereum-types';
|
import { DecodedLogs } from 'ethereum-types';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
@@ -21,7 +22,7 @@ import {
|
|||||||
} from '../src';
|
} from '../src';
|
||||||
|
|
||||||
blockchainTests.resets('ERC20BridgeProxy unit tests', env => {
|
blockchainTests.resets('ERC20BridgeProxy unit tests', env => {
|
||||||
const PROXY_ID = '0xdc1600f3';
|
const PROXY_ID = AssetProxyId.ERC20Bridge;
|
||||||
const BRIDGE_SUCCESS_RETURN_DATA = hexRightPad(PROXY_ID);
|
const BRIDGE_SUCCESS_RETURN_DATA = hexRightPad(PROXY_ID);
|
||||||
let owner: string;
|
let owner: string;
|
||||||
let badCaller: string;
|
let badCaller: string;
|
||||||
@@ -141,7 +142,7 @@ blockchainTests.resets('ERC20BridgeProxy unit tests', env => {
|
|||||||
return (logs as any) as DecodedLogs;
|
return (logs as any) as DecodedLogs;
|
||||||
}
|
}
|
||||||
|
|
||||||
it('succeeds if the bridge succeeds and balance increases', async () => {
|
it('succeeds if the bridge succeeds and balance increases by `amount`', async () => {
|
||||||
const tx = transferFromAsync();
|
const tx = transferFromAsync();
|
||||||
return expect(tx).to.be.fulfilled('');
|
return expect(tx).to.be.fulfilled('');
|
||||||
});
|
});
|
||||||
@@ -248,7 +249,7 @@ blockchainTests.resets('ERC20BridgeProxy unit tests', env => {
|
|||||||
return expect(tx).to.revertWith(revertError);
|
return expect(tx).to.revertWith(revertError);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('fails if balance of `to` increases by `amount - 1`', async () => {
|
it('fails if balance of `to` increases by less than `amount`', async () => {
|
||||||
const amount = getRandomInteger(1, 100e18);
|
const amount = getRandomInteger(1, 100e18);
|
||||||
const tx = transferFromAsync({
|
const tx = transferFromAsync({
|
||||||
amount,
|
amount,
|
||||||
|
|||||||
Reference in New Issue
Block a user