Skip to content

Commit

Permalink
Use interface
Browse files Browse the repository at this point in the history
  • Loading branch information
klaidliadon committed Jun 5, 2024
1 parent dc8818b commit 9f53ea7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ type Provider interface {
FetchTokenList(ctx context.Context, chainID uint64, source SourceType) (*TokenList, error)
}

func NewSequenceProvider(client *http.Client, rootURL string) (Provider, error) {
type HTTPClient interface {
Do(req *http.Request) (*http.Response, error)
}

func NewSequenceProvider(client HTTPClient, rootURL string) (Provider, error) {
if client == nil {
client = http.DefaultClient
}
Expand All @@ -31,7 +35,7 @@ func NewSequenceProvider(client *http.Client, rootURL string) (Provider, error)

type sequenceProvider struct {
id string
client *http.Client
client HTTPClient
rootURL string
}

Expand Down

0 comments on commit 9f53ea7

Please sign in to comment.