aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/utils
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-12-05 12:04:08 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-12-05 12:04:08 +0800
commit00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe (patch)
treee2e1c5394deac225bf493b3fe51da9f3074f1691 /packages/pipeline/src/utils
parent549f5e4655f246062dd6451065ec01eb789dbd8f (diff)
downloaddexon-sol-tools-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.tar
dexon-sol-tools-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.tar.gz
dexon-sol-tools-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.tar.bz2
dexon-sol-tools-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.tar.lz
dexon-sol-tools-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.tar.xz
dexon-sol-tools-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.tar.zst
dexon-sol-tools-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.zip
Address PR feedback
Diffstat (limited to 'packages/pipeline/src/utils')
-rw-r--r--packages/pipeline/src/utils/constants.ts3
-rw-r--r--packages/pipeline/src/utils/index.ts1
-rw-r--r--packages/pipeline/src/utils/transformers/big_number.ts8
3 files changed, 8 insertions, 4 deletions
diff --git a/packages/pipeline/src/utils/constants.ts b/packages/pipeline/src/utils/constants.ts
new file mode 100644
index 000000000..56f3e82d8
--- /dev/null
+++ b/packages/pipeline/src/utils/constants.ts
@@ -0,0 +1,3 @@
+// Block number when the Exchange contract was deployed to mainnet.
+export const EXCHANGE_START_BLOCK = 6271590;
+export const INFURA_ROOT_URL = 'https://mainnet.infura.io';
diff --git a/packages/pipeline/src/utils/index.ts b/packages/pipeline/src/utils/index.ts
index 718ea6133..2096a0a39 100644
--- a/packages/pipeline/src/utils/index.ts
+++ b/packages/pipeline/src/utils/index.ts
@@ -1,5 +1,6 @@
import { BigNumber } from '@0x/utils';
export * from './transformers';
+export * from './constants';
/**
* If the given BigNumber is not null, returns the string representation of that
diff --git a/packages/pipeline/src/utils/transformers/big_number.ts b/packages/pipeline/src/utils/transformers/big_number.ts
index a0471a5e3..5f2e4d565 100644
--- a/packages/pipeline/src/utils/transformers/big_number.ts
+++ b/packages/pipeline/src/utils/transformers/big_number.ts
@@ -3,13 +3,13 @@ import { ValueTransformer } from 'typeorm/decorator/options/ValueTransformer';
export class BigNumberTransformer implements ValueTransformer {
// tslint:disable-next-line:prefer-function-over-method
- public to(value: BigNumber): string {
- return value.toString();
+ public to(value: BigNumber | null): string | null {
+ return value === null ? null : value.toString();
}
// tslint:disable-next-line:prefer-function-over-method
- public from(value: string): BigNumber {
- return new BigNumber(value);
+ public from(value: string | null): BigNumber | null {
+ return value === null ? null : new BigNumber(value);
}
}