rename the variables and read the stables param from the config
This commit is contained in:
parent
a354371a94
commit
343d30a2f2
@ -403,20 +403,23 @@ func (as HTTPAccountService) getPoolSwappableVouchers(ctx context.Context, poolA
|
|||||||
PoolSwappableVouchers []dataserviceapi.TokenHoldings `json:"filtered"`
|
PoolSwappableVouchers []dataserviceapi.TokenHoldings `json:"filtered"`
|
||||||
}
|
}
|
||||||
|
|
||||||
ep, err := url.JoinPath(config.PoolSwappableVouchersURL, poolAddress, "to")
|
basePath, err := url.JoinPath(config.PoolSwappableVouchersURL, poolAddress, "to")
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
u, err := url.Parse(ep)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
query := u.Query()
|
parsedURL, err := url.Parse(basePath)
|
||||||
query.Set("stable", "true")
|
if err != nil {
|
||||||
u.RawQuery = query.Encode()
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
req, err := http.NewRequest("GET", u.String(), nil)
|
query := parsedURL.Query()
|
||||||
|
if config.IncludeStablesParam != "" {
|
||||||
|
query.Set("stables", config.IncludeStablesParam)
|
||||||
|
}
|
||||||
|
parsedURL.RawQuery = query.Encode()
|
||||||
|
|
||||||
|
req, err := http.NewRequest("GET", parsedURL.String(), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user