diff --git a/currency/pairs.go b/currency/pairs.go index cc5e2f6db52..99398cd1e0d 100644 --- a/currency/pairs.go +++ b/currency/pairs.go @@ -9,14 +9,15 @@ import ( "strings" ) +// Public Errors +var ( + ErrPairDuplication = errors.New("currency pair duplication") +) + var ( errSymbolEmpty = errors.New("symbol is empty") errNoDelimiter = errors.New("no delimiter was supplied") errPairFormattingInconsistent = errors.New("pair formatting is inconsistent") - - // ErrPairDuplication defines an error when there is multiple of the same - // currency pairs found. - ErrPairDuplication = errors.New("currency pair duplication") ) // NewPairsFromStrings takes in currency pair strings and returns a currency diff --git a/engine/rpcserver.go b/engine/rpcserver.go index 72e7e76e8b6..76fdf12579a 100644 --- a/engine/rpcserver.go +++ b/engine/rpcserver.go @@ -79,7 +79,6 @@ var ( errGRPCShutdownSignalIsNil = errors.New("cannot shutdown, gRPC shutdown channel is nil") errInvalidStrategy = errors.New("invalid strategy") errSpecificPairNotEnabled = errors.New("specified pair is not enabled") - errPairNotEnabled = errors.New("pair is not enabled") ) // RPCServer struct @@ -4723,7 +4722,7 @@ func (s *RPCServer) GetFundingRates(ctx context.Context, r *gctrpc.GetFundingRat } if !pairs.Contains(cp, true) { - return nil, fmt.Errorf("%w %v", errPairNotEnabled, cp) + return nil, fmt.Errorf("%w %v", currency.ErrPairNotEnabled, cp) } funding, err := exch.GetHistoricalFundingRates(ctx, &fundingrate.HistoricalRatesRequest{ @@ -4821,7 +4820,7 @@ func (s *RPCServer) GetLatestFundingRate(ctx context.Context, r *gctrpc.GetLates } if !pairs.Contains(cp, true) { - return nil, fmt.Errorf("%w %v", errPairNotEnabled, cp) + return nil, fmt.Errorf("%w %v", currency.ErrPairNotEnabled, cp) } fundingRates, err := exch.GetLatestFundingRates(ctx, &fundingrate.LatestRateRequest{ diff --git a/exchanges/gateio/gateio_wrapper.go b/exchanges/gateio/gateio_wrapper.go index daf2ebed50c..0b32d0d748a 100644 --- a/exchanges/gateio/gateio_wrapper.go +++ b/exchanges/gateio/gateio_wrapper.go @@ -2215,7 +2215,7 @@ func (g *Gateio) GetOpenInterest(ctx context.Context, k ...key.PairAsset) ([]fut return nil, err } if !isEnabled { - return nil, fmt.Errorf("%w %v", asset.ErrNotEnabled, k[0].Pair()) + return nil, fmt.Errorf("%w: %v", currency.ErrPairNotEnabled, k[0].Pair()) } switch k[0].Asset { case asset.DeliveryFutures: