maps: expansion of Key concept (#1349)

* moves everything to use single map keys, also breaks

* full rollout

* tests

* fix a little bug

* minor test fixups

* Fix Key use

* rm 🔑 from 🔑 struct name
This commit is contained in:
Scott
2023-10-04 09:19:41 +10:00
committed by GitHub
parent 033a72b61a
commit 91d699be9d
47 changed files with 1478 additions and 1339 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/thrasher-corp/gocryptotrader/backtester/common"
"github.com/thrasher-corp/gocryptotrader/backtester/eventtypes/event"
gctcommon "github.com/thrasher-corp/gocryptotrader/common"
"github.com/thrasher-corp/gocryptotrader/common/key"
"github.com/thrasher-corp/gocryptotrader/currency"
"github.com/thrasher-corp/gocryptotrader/exchanges/asset"
gctkline "github.com/thrasher-corp/gocryptotrader/exchanges/kline"
@@ -37,7 +38,12 @@ func TestSetDataForCurrency(t *testing.T) {
if d.data == nil {
t.Error("expected not nil")
}
if d.data[exch][a][p.Base.Item][p.Quote.Item] != nil {
if d.data[key.ExchangePairAsset{
Exchange: exch,
Base: p.Base.Item,
Quote: p.Quote.Item,
Asset: a,
}] != nil {
t.Error("expected nil")
}
}