diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-09-28 08:32:56 +0800 |
---|---|---|
committer | Fred Carlsen <fred@sjelfull.no> | 2018-12-06 19:04:24 +0800 |
commit | 392e89fcbb768e76968ad94591e665da630dc988 (patch) | |
tree | eaf6f0301136341fdd0c2340e9103caa83378839 /packages/pipeline/src | |
parent | 44c19477406fc1742a351388152ff4b1cef1752b (diff) | |
download | dexon-sol-tools-392e89fcbb768e76968ad94591e665da630dc988.tar.gz dexon-sol-tools-392e89fcbb768e76968ad94591e665da630dc988.tar.zst dexon-sol-tools-392e89fcbb768e76968ad94591e665da630dc988.zip |
Add tests for SRA order conversion
Diffstat (limited to 'packages/pipeline/src')
-rw-r--r-- | packages/pipeline/src/data_types/sra_orders/index.ts (renamed from packages/pipeline/src/data_types/sra_order/index.ts) | 4 | ||||
-rw-r--r-- | packages/pipeline/src/index.ts | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/packages/pipeline/src/data_types/sra_order/index.ts b/packages/pipeline/src/data_types/sra_orders/index.ts index b6364415c..fb2b74dfe 100644 --- a/packages/pipeline/src/data_types/sra_order/index.ts +++ b/packages/pipeline/src/data_types/sra_orders/index.ts @@ -22,8 +22,8 @@ export function _convertToEntity(apiOrder: APIOrder): SraOrder { sraOrder.orderHashHex = orderHashUtils.getOrderHashHex(apiOrder.order); // TODO(albrow): Set these fields to the correct values upstack. - sraOrder.lastUpdatedTimestamp = Date.now(); - sraOrder.firstSeenTimestamp = Date.now(); + sraOrder.lastUpdatedTimestamp = 0; + sraOrder.firstSeenTimestamp = 0; sraOrder.makerAddress = apiOrder.order.makerAddress; sraOrder.takerAddress = apiOrder.order.takerAddress; diff --git a/packages/pipeline/src/index.ts b/packages/pipeline/src/index.ts index c442c7970..a1dbb35ff 100644 --- a/packages/pipeline/src/index.ts +++ b/packages/pipeline/src/index.ts @@ -4,7 +4,7 @@ import { Connection, createConnection } from 'typeorm'; import { Etherscan } from './data_sources/etherscan'; import { parseExchangeEvents } from './data_types/events/exchange_events'; -import { parseSraOrders } from './data_types/sra_order'; +import { parseSraOrders } from './data_types/sra_orders'; import { ExchangeCancelEvent } from './entities/ExchangeCancelEvent'; import { ExchangeCancelUpToEvent } from './entities/ExchangeCancelUpToEvent'; import { ExchangeFillEvent } from './entities/ExchangeFillEvent'; @@ -53,7 +53,7 @@ async function getSraOrdersAsync(): Promise<void> { const orders = parseSraOrders(rawOrders); for (const order of orders) { order.sourceUrl = sraUrl; - order.save(); + await order.save(); } console.log(`now there are ${await orderRepository.count()} total orders`); } |