aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-11-11 04:05:24 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-11-13 09:03:18 +0800
commitffcc4877638262b29c8a88535e9535da07428396 (patch)
tree207e5e0465e03169ecb4a6a82af1f1cba37e4732
parent473ce8b61750103843173518bac599186405f7b3 (diff)
downloaddexon-sol-tools-ffcc4877638262b29c8a88535e9535da07428396.tar
dexon-sol-tools-ffcc4877638262b29c8a88535e9535da07428396.tar.gz
dexon-sol-tools-ffcc4877638262b29c8a88535e9535da07428396.tar.bz2
dexon-sol-tools-ffcc4877638262b29c8a88535e9535da07428396.tar.lz
dexon-sol-tools-ffcc4877638262b29c8a88535e9535da07428396.tar.xz
dexon-sol-tools-ffcc4877638262b29c8a88535e9535da07428396.tar.zst
dexon-sol-tools-ffcc4877638262b29c8a88535e9535da07428396.zip
Create fake blockStore for exchange transfer simulator
-rw-r--r--src/utils/exchange_transfer_simulator.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/utils/exchange_transfer_simulator.ts b/src/utils/exchange_transfer_simulator.ts
index 56bd48f17..cd46397ed 100644
--- a/src/utils/exchange_transfer_simulator.ts
+++ b/src/utils/exchange_transfer_simulator.ts
@@ -3,6 +3,7 @@ import BigNumber from 'bignumber.js';
import {ExchangeContractErrs, TradeSide, TransferType, BlockParamLiteral} from '../types';
import {TokenWrapper} from '../contract_wrappers/token_wrapper';
import {BalanceAndProxyAllowanceLazyStore} from '../stores/balance_proxy_allowance_lazy_store';
+import {BlockStore} from '../stores/block_store';
enum FailureReason {
Balance = 'balance',
@@ -36,7 +37,9 @@ export class ExchangeTransferSimulator {
private store: BalanceAndProxyAllowanceLazyStore;
private UNLIMITED_ALLOWANCE_IN_BASE_UNITS: BigNumber;
constructor(token: TokenWrapper) {
- this.store = new BalanceAndProxyAllowanceLazyStore(token, BlockParamLiteral.Latest);
+ const blockStore = new BlockStore();
+ const latestBlockConfirmationNumber = 1;
+ this.store = new BalanceAndProxyAllowanceLazyStore(token, blockStore, latestBlockConfirmationNumber);
this.UNLIMITED_ALLOWANCE_IN_BASE_UNITS = token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS;
}
/**