From d013713c0021dd5bb3aa9fa00bc5722f4d5dd93b Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 7 Jan 2022 01:25:07 +0800 Subject: [PATCH] types: add exchange name to trade key --- pkg/types/trade.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkg/types/trade.go b/pkg/types/trade.go index c0ef1bda5..e7e61e0ae 100644 --- a/pkg/types/trade.go +++ b/pkg/types/trade.go @@ -185,10 +185,15 @@ func (trade Trade) Liquidity() (o string) { } func (trade Trade) Key() TradeKey { - return TradeKey{ID: trade.ID, Side: trade.Side} + return TradeKey{ + Exchange: trade.Exchange, + ID: trade.ID, + Side: trade.Side, + } } type TradeKey struct { - ID uint64 - Side SideType + Exchange ExchangeName + ID uint64 + Side SideType }