Skip to content

Commit

Permalink
properly set query in req (#1174)
Browse files Browse the repository at this point in the history
  • Loading branch information
benny-conn authored Aug 25, 2023
1 parent 6726879 commit ba40a08
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions service/multichain/reservoir/reservoir.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ func (d *Provider) fetchToken(ctx context.Context, ti multichain.ChainAgnosticId
q := req.URL.Query()
q.Add("tokens", rtid)

req.URL.RawQuery = q.Encode()

resp, err := d.httpClient.Do(req)
if err != nil {
return Token{}, err
Expand All @@ -417,6 +419,7 @@ func (d *Provider) fetchToken(ctx context.Context, ti multichain.ChainAgnosticId
}

if len(res.Tokens) == 0 {
logger.For(ctx).Infof("token not found for %s (%s)", rtid, req.URL.String())
return Token{}, ErrTokenNotFoundByIdentifiers{ContractAddress: ti.ContractAddress, TokenID: TokenID(ti.TokenID.Base10String())}
}
return res.Tokens[0].Token, nil
Expand Down Expand Up @@ -457,6 +460,8 @@ func (d *Provider) fetchCollection(ctx context.Context, address persist.Address,
q.Add("id", fmt.Sprintf("%s", address))
q.Add("limit", "1")

req.URL.RawQuery = q.Encode()

resp, err := d.httpClient.Do(req)
if err != nil {
return Collection{}, err
Expand Down

0 comments on commit ba40a08

Please sign in to comment.