Subscriptions: Fix IBotExchange not implementing sub.IExchange (#1765)

Thusfar ExpandTemplates had only been called internally.
All methods consumers might want to get, in this case GetPairFormat,
need to be in the interface we're passing out, otherwise users can't
call them (or things that use them, like ExpandTemplates)
This commit is contained in:
Gareth Kirwan
2025-01-10 00:21:02 +00:00
committed by GitHub
parent b3e640ef5e
commit 1efd8e0db0
4 changed files with 23 additions and 5 deletions

View File

@@ -0,0 +1,16 @@
package subscription_test
import (
"testing"
"github.com/stretchr/testify/assert"
exchange "github.com/thrasher-corp/gocryptotrader/exchanges"
shared "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues"
"github.com/thrasher-corp/gocryptotrader/exchanges/subscription"
)
// TestIExchange ensures that IExchange is a subset of IBotExchange, so when an exchange is passed by interface, it can still use ExpandTemplates
func TestIExchange(t *testing.T) {
assert.Implements(t, (*subscription.IExchange)(nil), exchange.IBotExchange(&shared.CustomEx{}))
var _ subscription.IExchange = exchange.IBotExchange(nil)
}