diff options
author | zkao <zichongkao@gmail.com> | 2018-12-05 05:21:46 +0800 |
---|---|---|
committer | Fred Carlsen <fred@sjelfull.no> | 2018-12-06 19:05:38 +0800 |
commit | f96711bac373ac7caaca647defd68d91ba43a181 (patch) | |
tree | 64c8933954de8ec8eb0cc8c7437543c649a65329 /packages/pipeline/test/entities | |
parent | ddd246a945cb29ba0115987cc215398e4fc0066b (diff) | |
download | dexon-sol-tools-f96711bac373ac7caaca647defd68d91ba43a181.tar dexon-sol-tools-f96711bac373ac7caaca647defd68d91ba43a181.tar.gz dexon-sol-tools-f96711bac373ac7caaca647defd68d91ba43a181.tar.bz2 dexon-sol-tools-f96711bac373ac7caaca647defd68d91ba43a181.tar.lz dexon-sol-tools-f96711bac373ac7caaca647defd68d91ba43a181.tar.xz dexon-sol-tools-f96711bac373ac7caaca647defd68d91ba43a181.tar.zst dexon-sol-tools-f96711bac373ac7caaca647defd68d91ba43a181.zip |
Token_orderbook_snapshots for Ddex and Paradex(#1354)
* Implements the TokenOrderbookSnapshot Table
* Scripts, Data Sources and Entities to pull Ddex and Paradex API data.
Diffstat (limited to 'packages/pipeline/test/entities')
-rw-r--r-- | packages/pipeline/test/entities/token_order_test.ts | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/packages/pipeline/test/entities/token_order_test.ts b/packages/pipeline/test/entities/token_order_test.ts new file mode 100644 index 000000000..c6057f5aa --- /dev/null +++ b/packages/pipeline/test/entities/token_order_test.ts @@ -0,0 +1,31 @@ +import { BigNumber } from '@0x/utils'; +import 'mocha'; + +import { TokenOrderbookSnapshot } from '../../src/entities'; +import { createDbConnectionOnceAsync } from '../db_setup'; +import { chaiSetup } from '../utils/chai_setup'; + +import { testSaveAndFindEntityAsync } from './util'; + +chaiSetup.configure(); + +const tokenOrderbookSnapshot: TokenOrderbookSnapshot = { + source: 'ddextest', + observedTimestamp: Date.now(), + orderType: 'bid', + price: new BigNumber(10.1), + baseAssetSymbol: 'ETH', + baseAssetAddress: '0x818e6fecd516ecc3849daf6845e3ec868087b755', + baseVolume: new BigNumber(143), + quoteAssetSymbol: 'ABC', + quoteAssetAddress: '0x00923b9a074762b93650716333b3e1473a15048e', + quoteVolume: new BigNumber(12.3234234), +}; + +describe('TokenOrderbookSnapshot entity', () => { + it('save/find', async () => { + const connection = await createDbConnectionOnceAsync(); + const tokenOrderbookSnapshotRepository = connection.getRepository(TokenOrderbookSnapshot); + await testSaveAndFindEntityAsync(tokenOrderbookSnapshotRepository, tokenOrderbookSnapshot); + }); +}); |