Skip to content

Commit

Permalink
Merge pull request #447 from ambrosus/dev
Browse files Browse the repository at this point in the history
Fix 0x api
  • Loading branch information
SvineruS authored Jul 12, 2023
2 parents 1141bdb + 2d58f61 commit 3f0d0db
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 0 additions & 3 deletions relay/pkg/price/price_0x.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ func doRequest(urlFormat NetworkUrl, sellToken string) (float64, error) {
if err != nil {
return 0, err
}
if resp.StatusCode >= 400 {
return 0, fmt.Errorf("0xApi answered error code %d", resp.StatusCode)
}
defer resp.Body.Close()

var r response
Expand Down
1 change: 1 addition & 0 deletions relay/pkg/price/price_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func Test0x(t *testing.T) {
}

func Test0xBNB(t *testing.T) {
os.Setenv("0X_API_KEY", "c7a70fdd-3474-425b-9fc3-2e40a7275ca3") // test api key
e, err := TokenToUSD(&TokenInfo{Symbol: "WBNB", Decimals: 18, Address: common.Address{}})
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 3f0d0db

Please sign in to comment.