From 61f35ec14f4a0d0876025bc7883e6fc35a760175 Mon Sep 17 00:00:00 2001 From: Larry Ruane Date: Fri, 15 Jul 2022 14:20:44 -0600 Subject: [PATCH] Return fake price data for darkside test mode --- common/prices.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/prices.go b/common/prices.go index 119de7d7..517a17d6 100644 --- a/common/prices.go +++ b/common/prices.go @@ -218,6 +218,9 @@ func writeHistoricalPricesMap() { // have fetched if no more than 3 hours old, else an error. An error // should not occur unless we can't reach enough price oracles. func GetCurrentPrice() (float64, error) { + if DarksideEnabled { + return 222.333, nil + } mutex.Lock() defer mutex.Unlock() @@ -241,6 +244,9 @@ func day(t time.Time) string { // GetHistoricalPrice returns the price for the given day, but only // accurate to day granularity. func GetHistoricalPrice(ts time.Time) (float64, *time.Time, error) { + if DarksideEnabled { + return 333.444, &ts, nil + } dt := day(ts) canonicalTime, err := time.Parse("2006-01-02", dt) if err != nil {