mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-02 15:10:46 +00:00
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:
16
exchanges/subscription/interface_test.go
Normal file
16
exchanges/subscription/interface_test.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user