Address PR feedback
This commit is contained in:
committed by
Fred Carlsen
parent
da51f6e56f
commit
e1d77d6e10
@@ -150,17 +150,17 @@ set the`ZEROEX_DATA_PIPELINE_DB_URL` environment variable to a valid
|
||||
|
||||
#### Additional guidelines and tips:
|
||||
|
||||
* Table names should be plural and separated by underscores (e.g.,
|
||||
- Table names should be plural and separated by underscores (e.g.,
|
||||
`exchange_fill_events`).
|
||||
* Any table which contains data which comes directly from a third-party source
|
||||
- Any table which contains data which comes directly from a third-party source
|
||||
should be namespaced in the `raw` PostgreSQL schema.
|
||||
* Column names in the database should be separated by underscores (e.g.,
|
||||
- Column names in the database should be separated by underscores (e.g.,
|
||||
`maker_asset_type`).
|
||||
* Field names in entity classes (like any other fields in TypeScript) should
|
||||
- Field names in entity classes (like any other fields in TypeScript) should
|
||||
be camel-cased (e.g., `makerAssetType`).
|
||||
* All timestamps should be stored as milliseconds since the Unix Epoch.
|
||||
* Use the `BigNumber` type for TypeScript code which deals with 256-bit
|
||||
- All timestamps should be stored as milliseconds since the Unix Epoch.
|
||||
- Use the `BigNumber` type for TypeScript code which deals with 256-bit
|
||||
numbers from smart contracts or for any case where we are dealing with large
|
||||
floating point numbers.
|
||||
* [TypeORM documentation](http://typeorm.io/#/) is pretty robust and can be a
|
||||
- [TypeORM documentation](http://typeorm.io/#/) is pretty robust and can be a
|
||||
helpful resource.
|
||||
|
||||
@@ -48,6 +48,4 @@ export class ExchangeCancelEvent {
|
||||
public takerTokenAddress!: string;
|
||||
@Column({ nullable: true, type: String, name: 'taker_token_id' })
|
||||
public takerTokenId!: string | null;
|
||||
|
||||
// TODO(albrow): Include topics?
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ export class ExchangeCancelUpToEvent {
|
||||
@PrimaryColumn({ name: 'block_number', transformer: numberToBigIntTransformer })
|
||||
public blockNumber!: number;
|
||||
|
||||
// TODO(albrow): Include transaction hash
|
||||
@Column({ name: 'raw_data' })
|
||||
public rawData!: string;
|
||||
|
||||
@@ -24,5 +23,4 @@ export class ExchangeCancelUpToEvent {
|
||||
public senderAddress!: string;
|
||||
@Column({ name: 'order_epoch', type: 'numeric', transformer: bigNumberTransformer })
|
||||
public orderEpoch!: BigNumber;
|
||||
// TODO(albrow): Include topics?
|
||||
}
|
||||
|
||||
@@ -57,6 +57,4 @@ export class ExchangeFillEvent {
|
||||
public takerTokenAddress!: string;
|
||||
@Column({ nullable: true, type: String, name: 'taker_token_id' })
|
||||
public takerTokenId!: string | null;
|
||||
|
||||
// TODO(albrow): Include topics?
|
||||
}
|
||||
|
||||
@@ -14,9 +14,6 @@ export class Relayer {
|
||||
@Column({ name: 'app_url', type: 'varchar', nullable: true })
|
||||
public appUrl!: string | null;
|
||||
|
||||
// TODO(albrow): Add exchange contract or protocol version?
|
||||
// TODO(albrow): Add network ids for addresses?
|
||||
|
||||
@Column({ name: 'fee_recipient_addresses', type: 'varchar', array: true })
|
||||
public feeRecipientAddresses!: string[];
|
||||
@Column({ name: 'taker_addresses', type: 'varchar', array: true })
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user