aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/order_filled_cancelled_lazy_store.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-11-13 07:10:47 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-11-13 09:06:13 +0800
commit84c965d459b948eb03cb8a70a66663bd7b35f463 (patch)
treefbcb47a43d4b029c2f1a46644eb64ca1d75f5921 /src/stores/order_filled_cancelled_lazy_store.ts
parent22cd6989a0217f2a49e59ce64bcc69b2c238aba4 (diff)
downloaddexon-sol-tools-84c965d459b948eb03cb8a70a66663bd7b35f463.tar
dexon-sol-tools-84c965d459b948eb03cb8a70a66663bd7b35f463.tar.gz
dexon-sol-tools-84c965d459b948eb03cb8a70a66663bd7b35f463.tar.bz2
dexon-sol-tools-84c965d459b948eb03cb8a70a66663bd7b35f463.tar.lz
dexon-sol-tools-84c965d459b948eb03cb8a70a66663bd7b35f463.tar.xz
dexon-sol-tools-84c965d459b948eb03cb8a70a66663bd7b35f463.tar.zst
dexon-sol-tools-84c965d459b948eb03cb8a70a66663bd7b35f463.zip
Remove blockStore and default to numConfirmations === 0
Diffstat (limited to 'src/stores/order_filled_cancelled_lazy_store.ts')
-rw-r--r--src/stores/order_filled_cancelled_lazy_store.ts12
1 files changed, 4 insertions, 8 deletions
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<BigNumber> {
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<BigNumber> {
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);