aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/parsers
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/parsers
parent549f5e4655f246062dd6451065ec01eb789dbd8f (diff)
downloaddexon-0x-contracts-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.tar.gz
dexon-0x-contracts-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.tar.zst
dexon-0x-contracts-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.zip
Address PR feedback
Diffstat (limited to 'packages/pipeline/src/parsers')
-rw-r--r--packages/pipeline/src/parsers/events/index.ts13
-rw-r--r--packages/pipeline/src/parsers/relayer_registry/index.ts13
-rw-r--r--packages/pipeline/src/parsers/token_metadata/index.ts6
-rw-r--r--packages/pipeline/src/parsers/web3/index.ts1
4 files changed, 17 insertions, 16 deletions
diff --git a/packages/pipeline/src/parsers/events/index.ts b/packages/pipeline/src/parsers/events/index.ts
index d42d1c57a..e18106c75 100644
--- a/packages/pipeline/src/parsers/events/index.ts
+++ b/packages/pipeline/src/parsers/events/index.ts
@@ -49,8 +49,8 @@ export function _convertToExchangeFillEvent(eventLog: LogWithDecodedArgs<Exchang
exchangeFillEvent.logIndex = eventLog.logIndex as number;
exchangeFillEvent.rawData = eventLog.data as string;
exchangeFillEvent.transactionHash = eventLog.transactionHash;
- exchangeFillEvent.makerAddress = eventLog.args.makerAddress.toString();
- exchangeFillEvent.takerAddress = eventLog.args.takerAddress.toString();
+ exchangeFillEvent.makerAddress = eventLog.args.makerAddress;
+ exchangeFillEvent.takerAddress = eventLog.args.takerAddress;
exchangeFillEvent.feeRecipientAddress = eventLog.args.feeRecipientAddress;
exchangeFillEvent.senderAddress = eventLog.args.senderAddress;
exchangeFillEvent.makerAssetFilledAmount = eventLog.args.makerAssetFilledAmount;
@@ -92,9 +92,8 @@ export function _convertToExchangeCancelEvent(
exchangeCancelEvent.logIndex = eventLog.logIndex as number;
exchangeCancelEvent.rawData = eventLog.data as string;
exchangeCancelEvent.transactionHash = eventLog.transactionHash;
- exchangeCancelEvent.makerAddress = eventLog.args.makerAddress.toString();
- exchangeCancelEvent.takerAddress =
- eventLog.args.takerAddress == null ? null : eventLog.args.takerAddress.toString();
+ exchangeCancelEvent.makerAddress = eventLog.args.makerAddress;
+ exchangeCancelEvent.takerAddress = eventLog.args.takerAddress;
exchangeCancelEvent.feeRecipientAddress = eventLog.args.feeRecipientAddress;
exchangeCancelEvent.senderAddress = eventLog.args.senderAddress;
exchangeCancelEvent.orderHash = eventLog.args.orderHash;
@@ -127,8 +126,8 @@ export function _convertToExchangeCancelUpToEvent(
exchangeCancelUpToEvent.logIndex = eventLog.logIndex as number;
exchangeCancelUpToEvent.rawData = eventLog.data as string;
exchangeCancelUpToEvent.transactionHash = eventLog.transactionHash;
- exchangeCancelUpToEvent.makerAddress = eventLog.args.makerAddress.toString();
- exchangeCancelUpToEvent.senderAddress = eventLog.args.senderAddress.toString();
+ exchangeCancelUpToEvent.makerAddress = eventLog.args.makerAddress;
+ exchangeCancelUpToEvent.senderAddress = eventLog.args.senderAddress;
exchangeCancelUpToEvent.orderEpoch = eventLog.args.orderEpoch;
return exchangeCancelUpToEvent;
}
diff --git a/packages/pipeline/src/parsers/relayer_registry/index.ts b/packages/pipeline/src/parsers/relayer_registry/index.ts
index 7b1235005..9723880a4 100644
--- a/packages/pipeline/src/parsers/relayer_registry/index.ts
+++ b/packages/pipeline/src/parsers/relayer_registry/index.ts
@@ -18,12 +18,13 @@ function parseRelayer(relayerResp: RelayerResponse, uuid: string): Relayer {
relayer.name = relayerResp.name;
relayer.homepageUrl = relayerResp.homepage_url;
relayer.appUrl = relayerResp.app_url;
- const mainnet = getMainNetwork(relayerResp);
- if (mainnet !== undefined) {
- relayer.sraHttpEndpoint = mainnet.sra_http_endpoint || null;
- relayer.sraWsEndpoint = mainnet.sra_ws_endpoint || null;
- relayer.feeRecipientAddresses = R.path(['static_order_fields', 'fee_recipient_addresses'], mainnet) || [];
- relayer.takerAddresses = R.path(['static_order_fields', 'taker_addresses'], mainnet) || [];
+ const mainNetworkRelayerInfo = getMainNetwork(relayerResp);
+ if (mainNetworkRelayerInfo !== undefined) {
+ relayer.sraHttpEndpoint = mainNetworkRelayerInfo.sra_http_endpoint || null;
+ relayer.sraWsEndpoint = mainNetworkRelayerInfo.sra_ws_endpoint || null;
+ relayer.feeRecipientAddresses =
+ R.path(['static_order_fields', 'fee_recipient_addresses'], mainNetworkRelayerInfo) || [];
+ relayer.takerAddresses = R.path(['static_order_fields', 'taker_addresses'], mainNetworkRelayerInfo) || [];
} else {
relayer.feeRecipientAddresses = [];
relayer.takerAddresses = [];
diff --git a/packages/pipeline/src/parsers/token_metadata/index.ts b/packages/pipeline/src/parsers/token_metadata/index.ts
index 916448cb3..3b3e05d76 100644
--- a/packages/pipeline/src/parsers/token_metadata/index.ts
+++ b/packages/pipeline/src/parsers/token_metadata/index.ts
@@ -1,7 +1,9 @@
+import { BigNumber } from '@0x/utils';
import * as R from 'ramda';
import { MetamaskTrustedTokenMeta, ZeroExTrustedTokenMeta } from '../../data_sources/trusted_tokens';
import { TokenMetadata } from '../../entities';
+import {} from '../../utils';
/**
* Parses Metamask's trusted tokens list.
@@ -24,7 +26,7 @@ function parseMetamaskTrustedToken(resp: MetamaskTrustedTokenMeta, address: stri
const trustedToken = new TokenMetadata();
trustedToken.address = address;
- trustedToken.decimals = resp.decimals;
+ trustedToken.decimals = new BigNumber(resp.decimals);
trustedToken.symbol = resp.symbol;
trustedToken.name = resp.name;
trustedToken.authority = 'metamask';
@@ -36,7 +38,7 @@ function parseZeroExTrustedToken(resp: ZeroExTrustedTokenMeta): TokenMetadata {
const trustedToken = new TokenMetadata();
trustedToken.address = resp.address;
- trustedToken.decimals = resp.decimals;
+ trustedToken.decimals = new BigNumber(resp.decimals);
trustedToken.symbol = resp.symbol;
trustedToken.name = resp.name;
trustedToken.authority = '0x';
diff --git a/packages/pipeline/src/parsers/web3/index.ts b/packages/pipeline/src/parsers/web3/index.ts
index 9b5b3b55d..86f924151 100644
--- a/packages/pipeline/src/parsers/web3/index.ts
+++ b/packages/pipeline/src/parsers/web3/index.ts
@@ -42,7 +42,6 @@ export function parseTransaction(rawTransaction: EthTransaction): Transaction {
tx.blockNumber = rawTransaction.blockNumber;
tx.gasUsed = rawTransaction.gas;
- // TODO(albrow) figure out bignum solution.
tx.gasPrice = rawTransaction.gasPrice.toNumber();
return tx;