aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/index.ts
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-09-26 07:06:52 +0800
committerFred Carlsen <fred@sjelfull.no>2018-12-06 19:04:24 +0800
commit3ba98e219205752d1a2ccf3f8aee6ba38b2b0c01 (patch)
tree678a4701c1c4d54f4f1a5e46079d7586773080bf /packages/pipeline/src/index.ts
parent1ae3592e45d163682d8ef2ca076ee57bc170d7ad (diff)
downloaddexon-sol-tools-3ba98e219205752d1a2ccf3f8aee6ba38b2b0c01.tar
dexon-sol-tools-3ba98e219205752d1a2ccf3f8aee6ba38b2b0c01.tar.gz
dexon-sol-tools-3ba98e219205752d1a2ccf3f8aee6ba38b2b0c01.tar.bz2
dexon-sol-tools-3ba98e219205752d1a2ccf3f8aee6ba38b2b0c01.tar.lz
dexon-sol-tools-3ba98e219205752d1a2ccf3f8aee6ba38b2b0c01.tar.xz
dexon-sol-tools-3ba98e219205752d1a2ccf3f8aee6ba38b2b0c01.tar.zst
dexon-sol-tools-3ba98e219205752d1a2ccf3f8aee6ba38b2b0c01.zip
For event entities, rename address -> contractAddress and make it a primary key
Diffstat (limited to 'packages/pipeline/src/index.ts')
-rw-r--r--packages/pipeline/src/index.ts12
1 files changed, 10 insertions, 2 deletions
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`,
+ );
})();