From 84c965d459b948eb03cb8a70a66663bd7b35f463 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Sun, 12 Nov 2017 18:10:47 -0500 Subject: Remove blockStore and default to numConfirmations === 0 --- src/stores/order_filled_cancelled_lazy_store.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/stores/order_filled_cancelled_lazy_store.ts') diff --git a/src/stores/order_filled_cancelled_lazy_store.ts b/src/stores/order_filled_cancelled_lazy_store.ts index 104a8240e..39adff4d1 100644 --- a/src/stores/order_filled_cancelled_lazy_store.ts +++ b/src/stores/order_filled_cancelled_lazy_store.ts @@ -2,31 +2,28 @@ import * as _ from 'lodash'; import * as Web3 from 'web3'; import {BigNumber} from 'bignumber.js'; import {ExchangeWrapper} from '../contract_wrappers/exchange_wrapper'; -import {BlockStore} from './block_store'; +import {BlockParamLiteral} from '../types'; /** * Copy on read store for filled/cancelled taker amounts */ export class OrderFilledCancelledLazyStore { private exchange: ExchangeWrapper; - private blockStore: BlockStore; private filledTakerAmount: { [orderHash: string]: BigNumber, }; private cancelledTakerAmount: { [orderHash: string]: BigNumber, }; - constructor(exchange: ExchangeWrapper, blockStore: BlockStore) { + constructor(exchange: ExchangeWrapper) { this.exchange = exchange; - this.blockStore = blockStore; this.filledTakerAmount = {}; this.cancelledTakerAmount = {}; } public async getFilledTakerAmountAsync(orderHash: string): Promise { if (_.isUndefined(this.filledTakerAmount[orderHash])) { - const defaultBlock = this.blockStore.getBlockNumber(); const methodOpts = { - defaultBlock, + defaultBlock: BlockParamLiteral.Pending, }; const filledTakerAmount = await this.exchange.getFilledTakerAmountAsync(orderHash, methodOpts); this.setFilledTakerAmount(orderHash, filledTakerAmount); @@ -42,9 +39,8 @@ export class OrderFilledCancelledLazyStore { } public async getCancelledTakerAmountAsync(orderHash: string): Promise { if (_.isUndefined(this.cancelledTakerAmount[orderHash])) { - const defaultBlock = this.blockStore.getBlockNumber(); const methodOpts = { - defaultBlock, + defaultBlock: BlockParamLiteral.Pending, }; const cancelledTakerAmount = await this.exchange.getCanceledTakerAmountAsync(orderHash, methodOpts); this.setCancelledTakerAmount(orderHash, cancelledTakerAmount); -- cgit v1.2.3