From a58f678757cefbc6d14579720061bd502ae29438 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 28 Aug 2021 11:43:20 +0200 Subject: [PATCH] Remove remaining ftbot.state references --- src/store/modules/ftbot/index.ts | 22 ++++++++++++++++++++++ src/views/Backtesting.vue | 11 ++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/store/modules/ftbot/index.ts b/src/store/modules/ftbot/index.ts index 31c6a915..543f12c3 100644 --- a/src/store/modules/ftbot/index.ts +++ b/src/store/modules/ftbot/index.ts @@ -28,6 +28,7 @@ import { ProfitInterface, PairHistory, LogLine, + BacktestSteps, } from '@/types'; import { @@ -76,6 +77,11 @@ export enum BotStoreGetters { strategy = 'strategy', strategyList = 'strategyList', candleData = 'candleData', + backtestRunning = 'backtestRunning', + backtestStep = 'backtestStep', + backtestProgress = 'backtestProgress', + backtestHistory = 'backtestHistory', + selectedBacktestResultKey = 'selectedBacktestResultKey', } export default { @@ -210,6 +216,22 @@ export default { [BotStoreGetters.history](state: FtbotStateType) { return state.history; }, + [BotStoreGetters.backtestRunning](state: FtbotStateType): boolean { + return state.backtestRunning; + }, + [BotStoreGetters.backtestStep](state: FtbotStateType): BacktestSteps { + return state.backtestStep; + }, + [BotStoreGetters.backtestProgress](state: FtbotStateType): number { + return state.backtestProgress; + }, + // TODO: type me + [BotStoreGetters.backtestHistory](state: FtbotStateType): {} { + return state.backtestHistory; + }, + [BotStoreGetters.selectedBacktestResultKey](state: FtbotStateType): string { + return state.selectedBacktestResultKey; + }, }, mutations: { updateRefreshRequired(state: FtbotStateType, refreshRequired: boolean) { diff --git a/src/views/Backtesting.vue b/src/views/Backtesting.vue index b764637e..42c251b4 100644 --- a/src/views/Backtesting.vue +++ b/src/views/Backtesting.vue @@ -298,6 +298,7 @@ import TimeframeSelect from '@/components/ftbot/TimeframeSelect.vue'; import { BacktestPayload, + BacktestSteps, BotState, PairHistory, PairHistoryPayload, @@ -351,17 +352,17 @@ export default class Backtesting extends Vue { selectedPlotConfig: PlotConfig = getCustomPlotConfig(getPlotConfigName()); - @ftbot.State backtestRunning!: boolean; + @ftbot.Getter [BotStoreGetters.backtestRunning]!: boolean; - @ftbot.State backtestStep!: string; + @ftbot.Getter [BotStoreGetters.backtestStep]!: BacktestSteps; @ftbot.Getter [BotStoreGetters.botState]?: BotState; - @ftbot.State backtestProgress!: number; + @ftbot.Getter [BotStoreGetters.backtestProgress]!: number; - @ftbot.State backtestHistory!: StrategyBacktestResult[]; + @ftbot.Getter [BotStoreGetters.backtestHistory]!: StrategyBacktestResult[]; - @ftbot.State selectedBacktestResultKey!: string; + @ftbot.Getter [BotStoreGetters.selectedBacktestResultKey]!: string; @ftbot.Getter [BotStoreGetters.history]!: PairHistory;