From 71a015f2aa32fedd3d3c5e9d5a3fa4eb272b2852 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 25 Sep 2018 16:06:52 -0700 Subject: For event entities, rename address -> contractAddress and make it a primary key --- packages/pipeline/src/index.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'packages/pipeline/src/index.ts') diff --git a/packages/pipeline/src/index.ts b/packages/pipeline/src/index.ts index 1a010b6e5..07ab1d991 100644 --- a/packages/pipeline/src/index.ts +++ b/packages/pipeline/src/index.ts @@ -17,11 +17,19 @@ const EXCHANGE_ADDRESS = '0x4f833a24e1f95d70f028921e27040ca56e09ab0b'; const fillRepository = connection.getRepository(ExchangeFillEvent); const cancelRepository = connection.getRepository(ExchangeCancelEvent); const cancelUpToRepository = connection.getRepository(ExchangeCancelUpToEvent); - console.log(`found ${(await fillRepository.count()) + (await cancelRepository.count())} existing events`); + console.log( + `found ${(await fillRepository.count()) + + (await cancelRepository.count()) + + (await cancelUpToRepository.count())} existing events`, + ); const rawEvents = await etherscan.getContractEventsAsync(EXCHANGE_ADDRESS); const events = parseExchangeEvents(rawEvents); for (const event of events) { await event.save(); } - console.log(`now there are ${(await fillRepository.count()) + (await cancelRepository.count())} total events`); + console.log( + `now there are ${(await fillRepository.count()) + + (await cancelRepository.count()) + + (await cancelUpToRepository.count())} total events`, + ); })(); -- cgit