diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-10-03 07:10:15 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-10-03 07:10:15 +0800 |
commit | ad56c9ea785a1146ce9b8715446d6cbbc1f6246b (patch) | |
tree | b7417e14b1122a2a23110818d0a0666d6081fe49 /packages/contract-wrappers/test | |
parent | dde918e9a0c616ab24bd061212f6024aceee508d (diff) | |
parent | f1ecb8c5cb28a0a7ca6f7ad2ff11194091df62a4 (diff) | |
download | dexon-sol-tools-ad56c9ea785a1146ce9b8715446d6cbbc1f6246b.tar dexon-sol-tools-ad56c9ea785a1146ce9b8715446d6cbbc1f6246b.tar.gz dexon-sol-tools-ad56c9ea785a1146ce9b8715446d6cbbc1f6246b.tar.bz2 dexon-sol-tools-ad56c9ea785a1146ce9b8715446d6cbbc1f6246b.tar.lz dexon-sol-tools-ad56c9ea785a1146ce9b8715446d6cbbc1f6246b.tar.xz dexon-sol-tools-ad56c9ea785a1146ce9b8715446d6cbbc1f6246b.tar.zst dexon-sol-tools-ad56c9ea785a1146ce9b8715446d6cbbc1f6246b.zip |
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/instant/init
Diffstat (limited to 'packages/contract-wrappers/test')
6 files changed, 22 insertions, 34 deletions
diff --git a/packages/contract-wrappers/test/calldata_optimization_utils_test.ts b/packages/contract-wrappers/test/calldata_optimization_utils_test.ts index a3abb8503..94e55bffa 100644 --- a/packages/contract-wrappers/test/calldata_optimization_utils_test.ts +++ b/packages/contract-wrappers/test/calldata_optimization_utils_test.ts @@ -3,7 +3,6 @@ import * as chai from 'chai'; import * as _ from 'lodash'; import 'mocha'; -import { assert } from '../src/utils/assert'; import { calldataOptimizationUtils } from '../src/utils/calldata_optimization_utils'; import { constants } from '../src/utils/constants'; diff --git a/packages/contract-wrappers/test/erc721_wrapper_test.ts b/packages/contract-wrappers/test/erc721_wrapper_test.ts index ab6ff0984..10bac6086 100644 --- a/packages/contract-wrappers/test/erc721_wrapper_test.ts +++ b/packages/contract-wrappers/test/erc721_wrapper_test.ts @@ -229,11 +229,17 @@ describe('ERC721Wrapper', () => { it('should set the proxy approval', async () => { const tokenId = await tokenUtils.mintDummyERC721Async(tokenAddress, ownerAddress); - const approvalBeforeSet = await contractWrappers.erc721Token.isProxyApprovedAsync(tokenAddress, tokenId); - expect(approvalBeforeSet).to.be.false(); + const isProxyApprovedBeforeSet = await contractWrappers.erc721Token.isProxyApprovedAsync( + tokenAddress, + tokenId, + ); + expect(isProxyApprovedBeforeSet).to.be.false(); await contractWrappers.erc721Token.setProxyApprovalAsync(tokenAddress, tokenId); - const approvalAfterSet = await contractWrappers.erc721Token.isProxyApprovedAsync(tokenAddress, tokenId); - expect(approvalAfterSet).to.be.true(); + const isProxyApprovedAfterSet = await contractWrappers.erc721Token.isProxyApprovedAsync( + tokenAddress, + tokenId, + ); + expect(isProxyApprovedAfterSet).to.be.true(); }); }); describe('#subscribe', () => { @@ -357,7 +363,6 @@ describe('ERC721Wrapper', () => { ); contractWrappers.erc721Token.unsubscribe(subscriptionToken); - const tokenId = await tokenUtils.mintDummyERC721Async(tokenAddress, ownerAddress); const isApproved = true; await web3Wrapper.awaitTransactionSuccessAsync( await contractWrappers.erc721Token.setApprovalForAllAsync( @@ -373,15 +378,11 @@ describe('ERC721Wrapper', () => { }); }); describe('#getLogsAsync', () => { - let tokenTransferProxyAddress: string; const blockRange: BlockRange = { fromBlock: 0, toBlock: BlockParamLiteral.Latest, }; let txHash: string; - before(() => { - tokenTransferProxyAddress = contractWrappers.erc721Proxy.getContractAddress(); - }); it('should get logs with decoded args emitted by ApprovalForAll', async () => { const isApprovedForAll = true; txHash = await contractWrappers.erc721Token.setApprovalForAllAsync( diff --git a/packages/contract-wrappers/test/ether_token_wrapper_test.ts b/packages/contract-wrappers/test/ether_token_wrapper_test.ts index c15b8c016..c48fc224f 100644 --- a/packages/contract-wrappers/test/ether_token_wrapper_test.ts +++ b/packages/contract-wrappers/test/ether_token_wrapper_test.ts @@ -344,7 +344,7 @@ describe('EtherTokenWrapper', () => { etherTokenAddress = tokenUtils.getWethTokenAddress(); erc20ProxyAddress = contractWrappers.erc20Proxy.getContractAddress(); // Start the block range after all migrations to avoid unexpected logs - const currentBlock = await web3Wrapper.getBlockNumberAsync(); + const currentBlock: number = await web3Wrapper.getBlockNumberAsync(); const fromBlock = currentBlock + 1; blockRange = { fromBlock, diff --git a/packages/contract-wrappers/test/forwarder_wrapper_test.ts b/packages/contract-wrappers/test/forwarder_wrapper_test.ts index a969807b2..f77b47337 100644 --- a/packages/contract-wrappers/test/forwarder_wrapper_test.ts +++ b/packages/contract-wrappers/test/forwarder_wrapper_test.ts @@ -1,14 +1,12 @@ -import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { FillScenarios } from '@0xproject/fill-scenarios'; -import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils'; -import { DoneCallback, SignedOrder } from '@0xproject/types'; +import { assetDataUtils } from '@0xproject/order-utils'; +import { SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; -import { BlockParamLiteral } from 'ethereum-types'; import 'mocha'; -import { ContractWrappers, ExchangeCancelEventArgs, ExchangeEvents, ExchangeFillEventArgs, OrderStatus } from '../src'; -import { DecodedLogEvent } from '../src/types'; +import { ContractWrappers, OrderStatus } from '../src'; import { chaiSetup } from './utils/chai_setup'; import { constants } from './utils/constants'; diff --git a/packages/contract-wrappers/test/order_validator_wrapper_test.ts b/packages/contract-wrappers/test/order_validator_wrapper_test.ts index 2fdb00a71..baac3eeee 100644 --- a/packages/contract-wrappers/test/order_validator_wrapper_test.ts +++ b/packages/contract-wrappers/test/order_validator_wrapper_test.ts @@ -1,15 +1,14 @@ -import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { FillScenarios } from '@0xproject/fill-scenarios'; -import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils'; -import { DoneCallback, SignedOrder } from '@0xproject/types'; +import { assetDataUtils } from '@0xproject/order-utils'; +import { SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; -import { BlockParamLiteral } from 'ethereum-types'; import * as _ from 'lodash'; import 'mocha'; -import { ContractWrappers, ExchangeCancelEventArgs, ExchangeEvents, ExchangeFillEventArgs, OrderStatus } from '../src'; -import { DecodedLogEvent, OrderInfo, TraderInfo } from '../src/types'; +import { ContractWrappers, OrderStatus } from '../src'; +import { OrderInfo, TraderInfo } from '../src/types'; import { chaiSetup } from './utils/chai_setup'; import { constants } from './utils/constants'; @@ -26,7 +25,6 @@ describe('OrderValidator', () => { blockPollingIntervalMs: 0, }; const fillableAmount = new BigNumber(5); - const partialFillAmount = new BigNumber(2); let contractWrappers: ContractWrappers; let fillScenarios: FillScenarios; let exchangeContractAddress: string; diff --git a/packages/contract-wrappers/test/subscription_test.ts b/packages/contract-wrappers/test/subscription_test.ts index 68ef7225e..6ec7519fe 100644 --- a/packages/contract-wrappers/test/subscription_test.ts +++ b/packages/contract-wrappers/test/subscription_test.ts @@ -1,6 +1,5 @@ -import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { DoneCallback } from '@0xproject/types'; -import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; import 'mocha'; import * as Sinon from 'sinon'; @@ -18,17 +17,11 @@ const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); describe('SubscriptionTest', () => { let contractWrappers: ContractWrappers; - let userAddresses: string[]; - let coinbase: string; - let addressWithoutFunds: string; const config = { networkId: constants.TESTRPC_NETWORK_ID, }; before(async () => { contractWrappers = new ContractWrappers(provider, config); - userAddresses = await web3Wrapper.getAvailableAddressesAsync(); - coinbase = userAddresses[0]; - addressWithoutFunds = userAddresses[1]; }); beforeEach(async () => { await blockchainLifecycle.startAsync(); @@ -39,7 +32,6 @@ describe('SubscriptionTest', () => { describe('#subscribe', () => { const indexFilterValues = {}; let tokenAddress: string; - const allowanceAmount = new BigNumber(42); let stubs: Sinon.SinonStub[] = []; before(() => { const tokenAddresses = tokenUtils.getDummyERC20TokenAddresses(); @@ -53,7 +45,7 @@ describe('SubscriptionTest', () => { it('Should allow unsubscribeAll to be called successfully after an error', (done: DoneCallback) => { (async () => { const callback = (err: Error | null, _logEvent?: DecodedLogEvent<ERC20TokenApprovalEventArgs>) => - _.noop; + _.noop.bind(_); contractWrappers.erc20Token.subscribe( tokenAddress, ERC20TokenEvents.Approval, |