diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-12-23 04:56:52 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2019-01-08 07:50:48 +0800 |
commit | c6ab380685098dbf3a0a6ee5fae137e816839c2d (patch) | |
tree | 2f4e6f2934fde26d5fadbab0eea9a590c1a1b6f1 /packages/contract-wrappers/test | |
parent | d6467d707fdc1797eba4a445e805ccadc1f47872 (diff) | |
download | dexon-sol-tools-c6ab380685098dbf3a0a6ee5fae137e816839c2d.tar dexon-sol-tools-c6ab380685098dbf3a0a6ee5fae137e816839c2d.tar.gz dexon-sol-tools-c6ab380685098dbf3a0a6ee5fae137e816839c2d.tar.bz2 dexon-sol-tools-c6ab380685098dbf3a0a6ee5fae137e816839c2d.tar.lz dexon-sol-tools-c6ab380685098dbf3a0a6ee5fae137e816839c2d.tar.xz dexon-sol-tools-c6ab380685098dbf3a0a6ee5fae137e816839c2d.tar.zst dexon-sol-tools-c6ab380685098dbf3a0a6ee5fae137e816839c2d.zip |
Ran prettier & linter
Diffstat (limited to 'packages/contract-wrappers/test')
-rw-r--r-- | packages/contract-wrappers/test/dutch_auction_wrapper_test.ts | 10 | ||||
-rw-r--r-- | packages/contract-wrappers/test/utils/dutch_auction_utils.ts | 18 |
2 files changed, 13 insertions, 15 deletions
diff --git a/packages/contract-wrappers/test/dutch_auction_wrapper_test.ts b/packages/contract-wrappers/test/dutch_auction_wrapper_test.ts index 16d370cb6..4e6ad44e9 100644 --- a/packages/contract-wrappers/test/dutch_auction_wrapper_test.ts +++ b/packages/contract-wrappers/test/dutch_auction_wrapper_test.ts @@ -1,3 +1,4 @@ +import { expectTransactionFailedAsync, getLatestBlockTimestampAsync } from '@0x/contracts-test-utils'; import { BlockchainLifecycle } from '@0x/dev-utils'; import { assetDataUtils } from '@0x/order-utils'; import { RevertReason, SignedOrder } from '@0x/types'; @@ -9,13 +10,10 @@ import { ContractWrappers } from '../src'; import { chaiSetup } from './utils/chai_setup'; import { constants } from './utils/constants'; +import { DutchAuctionUtils } from './utils/dutch_auction_utils'; import { migrateOnceAsync } from './utils/migrate'; import { tokenUtils } from './utils/token_utils'; import { provider, web3Wrapper } from './utils/web3_wrapper'; -import { getLatestBlockTimestampAsync } from '@0x/contracts-test-utils'; -import { DutchAuctionUtils } from './utils/dutch_auction_utils'; - -import { expectTransactionFailedAsync } from '@0x/contracts-test-utils'; chaiSetup.configure(); const expect = chai.expect; @@ -23,7 +21,7 @@ const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); // tslint:disable:custom-no-magic-numbers describe('DutchAuctionWrapper', () => { - const fillableAmount = new BigNumber(2); //Web3Wrapper.toBaseUnitAmount(new BigNumber(50), 18); + const fillableAmount = new BigNumber(2); const tenMinutesInSeconds = 10 * 60; let contractWrappers: ContractWrappers; let exchangeContractAddress: string; @@ -62,7 +60,7 @@ describe('DutchAuctionWrapper', () => { // setup auction details in maker asset data auctionEndAmount = fillableAmount; auctionBeginAmount = auctionEndAmount.times(2); - const currentBlockTimestamp = await getLatestBlockTimestampAsync(); + const currentBlockTimestamp: number = await getLatestBlockTimestampAsync(); auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds); auctionEndTimeSeconds = new BigNumber(currentBlockTimestamp + tenMinutesInSeconds); // create auction orders diff --git a/packages/contract-wrappers/test/utils/dutch_auction_utils.ts b/packages/contract-wrappers/test/utils/dutch_auction_utils.ts index 9cff1930d..766fc373a 100644 --- a/packages/contract-wrappers/test/utils/dutch_auction_utils.ts +++ b/packages/contract-wrappers/test/utils/dutch_auction_utils.ts @@ -1,19 +1,20 @@ -import { DummyERC20TokenContract, DummyERC721TokenContract, ExchangeContract } from '@0x/abi-gen-wrappers'; -import { SignedOrder } from '@0x/types'; +import { DummyERC20TokenContract } from '@0x/abi-gen-wrappers'; import * as artifacts from '@0x/contract-artifacts'; +import { assetDataUtils } from '@0x/order-utils'; +import { orderFactory } from '@0x/order-utils/lib/src/order_factory'; +import { SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; -import { orderFactory } from '@0x/order-utils/lib/src/order_factory'; import { DutchAuctionWrapper } from '../../src/contract_wrappers/dutch_auction_wrapper'; + import { constants } from './constants'; -import { assetDataUtils } from '@0x/order-utils'; export class DutchAuctionUtils { - private _web3Wrapper: Web3Wrapper; - private _coinbase: string; - private _exchangeAddress: string; - private _erc20ProxyAddress: string; + private readonly _web3Wrapper: Web3Wrapper; + private readonly _coinbase: string; + private readonly _exchangeAddress: string; + private readonly _erc20ProxyAddress: string; constructor(web3Wrapper: Web3Wrapper, coinbase: string, exchangeAddress: string, erc20ProxyAddress: string) { this._web3Wrapper = web3Wrapper; @@ -36,7 +37,6 @@ export class DutchAuctionUtils { takerFee?: BigNumber, feeRecipientAddress?: string, ): Promise<SignedOrder> { - console.log(`asdasd`); const makerAssetAmount = auctionEndAmount; const makerAssetDataWithAuctionDetails = DutchAuctionWrapper.encodeDutchAuctionAssetData( makerAssetData, |