diff --git a/.jest b/.jest index 35ec7d7a44..091bbdd02a 100644 --- a/.jest +++ b/.jest @@ -1,3 +1,3 @@ -jasmine.DEFAULT_TIMEOUT_INTERVAL = 50000 +jasmine.DEFAULT_TIMEOUT_INTERVAL = 180000 process.on('unhandledRejection', e => console.log(e)) diff --git a/src/botPage/bot/TradeEngine/Sell.js b/src/botPage/bot/TradeEngine/Sell.js index d099463fda..cf5a0d5856 100644 --- a/src/botPage/bot/TradeEngine/Sell.js +++ b/src/botPage/bot/TradeEngine/Sell.js @@ -8,11 +8,14 @@ let delayIndex = 0; export default Engine => class Sell extends Engine { isSellAtMarketAvailable() { + console.log('Called isSellAtMarketAvailable'); return this.contractId && !this.isSold && this.isSellAvailable && !this.isExpired; } sellAtMarket() { + console.log('called sellAtMarket'); // Prevent calling sell twice if (this.store.getState().scope !== DURING_PURCHASE) { + console.log('Scope is not DURING_PURCHASE'); return Promise.resolve(); } diff --git a/src/botPage/bot/TradeEngine/index.js b/src/botPage/bot/TradeEngine/index.js index 8ad3f62180..371a971216 100644 --- a/src/botPage/bot/TradeEngine/index.js +++ b/src/botPage/bot/TradeEngine/index.js @@ -74,6 +74,7 @@ export default class TradeEngine extends Balance(Purchase(Sell(OpenContract(Prop this.store = createStore(rootReducer, applyMiddleware(thunk)); } init(...args) { + console.log('Init called', args); const [token, options] = expectInitArg(args); const { symbol } = options; @@ -91,6 +92,8 @@ export default class TradeEngine extends Balance(Purchase(Sell(OpenContract(Prop throw createError('NotInitialized', translate('Bot.init is not called')); } + console.log('Start called', tradeOptions); + globalObserver.emit('bot.running'); globalObserver.setState({ isRunning: true }); @@ -135,6 +138,7 @@ export default class TradeEngine extends Balance(Purchase(Sell(OpenContract(Prop this.observeProposals(); } watch(watchName) { + console.log('Watching', watchName); if (watchName === 'before') { return watchBefore(this.store); } diff --git a/src/botPage/bot/__tests__/tools.js b/src/botPage/bot/__tests__/tools.js index 1999d2bdf9..4fb3b03977 100644 --- a/src/botPage/bot/__tests__/tools.js +++ b/src/botPage/bot/__tests__/tools.js @@ -33,6 +33,7 @@ export const parts = { `, waitToSell: ` while (watch('during')) { + console.log('Attempting to sell...', Date.now()); if (Bot.isSellAvailable()) { Bot.sellAtMarket(); }