diff options
author | Hsuan Lee <hsuan@cobinhood.com> | 2019-01-19 18:42:04 +0800 |
---|---|---|
committer | Hsuan Lee <hsuan@cobinhood.com> | 2019-01-19 18:42:04 +0800 |
commit | 7ae38906926dc09bc10670c361af0d2bf0050426 (patch) | |
tree | 5fb10ae366b987db09e4ddb4bc3ba0f75404ad08 /packages/pipeline/test/parsers/paradex_orders/index_test.ts | |
parent | b5fd3c72a08aaa6957917d74c333387a16edf66b (diff) | |
download | dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.gz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.bz2 dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.lz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.xz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.zst dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.zip |
Update dependency packages
Diffstat (limited to 'packages/pipeline/test/parsers/paradex_orders/index_test.ts')
-rw-r--r-- | packages/pipeline/test/parsers/paradex_orders/index_test.ts | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/packages/pipeline/test/parsers/paradex_orders/index_test.ts b/packages/pipeline/test/parsers/paradex_orders/index_test.ts deleted file mode 100644 index c5dd8751b..000000000 --- a/packages/pipeline/test/parsers/paradex_orders/index_test.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { BigNumber } from '@0x/utils'; -import * as chai from 'chai'; -import 'mocha'; - -import { ParadexMarket, ParadexOrder } from '../../../src/data_sources/paradex'; -import { TokenOrderbookSnapshot as TokenOrder } from '../../../src/entities'; -import { parseParadexOrder } from '../../../src/parsers/paradex_orders'; -import { OrderType } from '../../../src/types'; -import { chaiSetup } from '../../utils/chai_setup'; - -chaiSetup.configure(); -const expect = chai.expect; - -// tslint:disable:custom-no-magic-numbers -describe('paradex_orders', () => { - describe('parseParadexOrder', () => { - it('converts ParadexOrder to TokenOrder entity', () => { - const paradexOrder: ParadexOrder = { - amount: '412', - price: '0.1245', - }; - const paradexMarket: ParadexMarket = { - id: '2', - symbol: 'ABC/DEF', - baseToken: 'DEF', - quoteToken: 'ABC', - minOrderSize: '0.1', - maxOrderSize: '1000', - priceMaxDecimals: 5, - amountMaxDecimals: 5, - baseTokenAddress: '0xb45df06e38540a675fdb5b598abf2c0dbe9d6b81', - quoteTokenAddress: '0x0000000000000000000000000000000000000000', - }; - const observedTimestamp: number = Date.now(); - const orderType: OrderType = OrderType.Bid; - const source: string = 'paradex'; - - const expected = new TokenOrder(); - expected.source = 'paradex'; - expected.observedTimestamp = observedTimestamp; - expected.orderType = OrderType.Bid; - expected.price = new BigNumber(0.1245); - expected.baseAssetSymbol = 'DEF'; - expected.baseAssetAddress = '0xb45df06e38540a675fdb5b598abf2c0dbe9d6b81'; - expected.baseVolume = new BigNumber(412); - expected.quoteAssetSymbol = 'ABC'; - expected.quoteAssetAddress = '0x0000000000000000000000000000000000000000'; - expected.quoteVolume = new BigNumber(412 * 0.1245); - - const actual = parseParadexOrder(paradexMarket, observedTimestamp, orderType, source, paradexOrder); - expect(actual).deep.equal(expected); - }); - }); -}); |