From 6fb333f2003a67277a7605332f146adb2758cdd0 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Thu, 8 Nov 2018 12:35:59 -0800 Subject: Rename Transaction.ts to transaction.ts Rename Relayer.ts to relayer.ts Rename Block.ts to block.ts --- packages/pipeline/src/entities/transaction.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 packages/pipeline/src/entities/transaction.ts (limited to 'packages/pipeline/src/entities/transaction.ts') diff --git a/packages/pipeline/src/entities/transaction.ts b/packages/pipeline/src/entities/transaction.ts new file mode 100644 index 000000000..eb2883fda --- /dev/null +++ b/packages/pipeline/src/entities/transaction.ts @@ -0,0 +1,16 @@ +import { Column, Entity, PrimaryColumn } from 'typeorm'; + +@Entity({ name: 'transactions' }) +export class Transaction { + @PrimaryColumn({ name: 'transaction_hash' }) + public transactionHash!: string; + @PrimaryColumn({ name: 'block_hash' }) + public blockHash!: string; + @PrimaryColumn({ name: 'block_number' }) + public blockNumber!: number; + + @Column({ type: 'bigint', name: 'gas_used' }) + public gasUsed!: number; + @Column({ type: 'bigint', name: 'gas_price' }) + public gasPrice!: number; +} -- cgit v1.2.3 From 96134003e1aa1903bdf051e39e7e244cc8684043 Mon Sep 17 00:00:00 2001 From: Jake Ellowitz Date: Tue, 13 Nov 2018 09:57:02 -0800 Subject: Pointing entities to raw schema Fix linter issues --- packages/pipeline/src/entities/transaction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/pipeline/src/entities/transaction.ts') diff --git a/packages/pipeline/src/entities/transaction.ts b/packages/pipeline/src/entities/transaction.ts index eb2883fda..dd2143df5 100644 --- a/packages/pipeline/src/entities/transaction.ts +++ b/packages/pipeline/src/entities/transaction.ts @@ -1,6 +1,6 @@ import { Column, Entity, PrimaryColumn } from 'typeorm'; -@Entity({ name: 'transactions' }) +@Entity({ name: 'transactions', schema: 'raw' }) export class Transaction { @PrimaryColumn({ name: 'transaction_hash' }) public transactionHash!: string; -- cgit v1.2.3 From 3d211c415b58a67f84332ff512bf9372cac5a3ac Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Wed, 28 Nov 2018 13:21:04 -0800 Subject: Introduce framework for running basic tests for entities (#1344) * Introduce framework for running basic tests for entities * Add pipeline tests to CircleCI config * Make pipeline tests more configurable and fix CircleCI config * Add coverage dir to pipeline package * Add basic tests for all exchange event entities * Add tests for remaining entities * Create separate test scripts in package.json and add new info to README * Update db_setup.ts to revert migrations even if you are using docker * Automatically pull the postgres image if needed * Add comment about why NumberToBigIntTransformer is needed --- packages/pipeline/src/entities/transaction.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'packages/pipeline/src/entities/transaction.ts') diff --git a/packages/pipeline/src/entities/transaction.ts b/packages/pipeline/src/entities/transaction.ts index dd2143df5..91e4ecb5d 100644 --- a/packages/pipeline/src/entities/transaction.ts +++ b/packages/pipeline/src/entities/transaction.ts @@ -1,16 +1,18 @@ import { Column, Entity, PrimaryColumn } from 'typeorm'; +import { numberToBigIntTransformer } from '../utils'; + @Entity({ name: 'transactions', schema: 'raw' }) export class Transaction { @PrimaryColumn({ name: 'transaction_hash' }) public transactionHash!: string; @PrimaryColumn({ name: 'block_hash' }) public blockHash!: string; - @PrimaryColumn({ name: 'block_number' }) + @PrimaryColumn({ name: 'block_number', transformer: numberToBigIntTransformer }) public blockNumber!: number; - @Column({ type: 'bigint', name: 'gas_used' }) + @Column({ type: 'bigint', name: 'gas_used', transformer: numberToBigIntTransformer }) public gasUsed!: number; - @Column({ type: 'bigint', name: 'gas_price' }) + @Column({ type: 'bigint', name: 'gas_price', transformer: numberToBigIntTransformer }) public gasPrice!: number; } -- cgit v1.2.3 From e0348f9c044b4909260e4864398b4f50232da620 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 4 Dec 2018 20:20:49 -0800 Subject: Change type of transactions.gas_used and gas_price to BigNumber/numeric --- packages/pipeline/src/entities/transaction.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'packages/pipeline/src/entities/transaction.ts') diff --git a/packages/pipeline/src/entities/transaction.ts b/packages/pipeline/src/entities/transaction.ts index 91e4ecb5d..742050177 100644 --- a/packages/pipeline/src/entities/transaction.ts +++ b/packages/pipeline/src/entities/transaction.ts @@ -1,6 +1,7 @@ +import { BigNumber } from '@0x/utils'; import { Column, Entity, PrimaryColumn } from 'typeorm'; -import { numberToBigIntTransformer } from '../utils'; +import { bigNumberTransformer, numberToBigIntTransformer } from '../utils'; @Entity({ name: 'transactions', schema: 'raw' }) export class Transaction { @@ -11,8 +12,8 @@ export class Transaction { @PrimaryColumn({ name: 'block_number', transformer: numberToBigIntTransformer }) public blockNumber!: number; - @Column({ type: 'bigint', name: 'gas_used', transformer: numberToBigIntTransformer }) - public gasUsed!: number; - @Column({ type: 'bigint', name: 'gas_price', transformer: numberToBigIntTransformer }) - public gasPrice!: number; + @Column({ type: 'numeric', name: 'gas_used', transformer: bigNumberTransformer }) + public gasUsed!: BigNumber; + @Column({ type: 'numeric', name: 'gas_price', transformer: bigNumberTransformer }) + public gasPrice!: BigNumber; } -- cgit v1.2.3