Skip to content

Commit

Permalink
fix test [goreleaser]
Browse files Browse the repository at this point in the history
  • Loading branch information
golangisfun123 committed Aug 26, 2024
1 parent 838fe2e commit 2758b5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 43 deletions.
34 changes: 0 additions & 34 deletions services/rfq/relayer/relapi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,40 +54,6 @@ func (r *relayerClient) Health(ctx context.Context) (ok bool, err error) {
return ok, nil
}

func (r *relayerClient) GetQuoteRequestStatusByTxHash(ctx context.Context, hash string) (*GetQuoteRequestResponse, error) {
var res GetQuoteRequestResponse

resp, err := r.client.R().SetContext(ctx).
SetQueryParam("hash", hash).
SetResult(&res).
Get(getQuoteStatusByTxHashRoute)
if err != nil {
return nil, fmt.Errorf("failed to get quote request status by tx hash: %w", err)
}
if resp.StatusCode() != http.StatusOK {
return nil, fmt.Errorf("unexpected status code: %d", resp.StatusCode())
}

return &res, nil
}

func (r *relayerClient) GetQuoteRequestStatusByTxID(ctx context.Context, txid string) (*GetQuoteRequestResponse, error) {
var res GetQuoteRequestResponse

resp, err := r.client.R().SetContext(ctx).
SetQueryParam("id", txid).
SetResult(&res).
Get(getQuoteStatusByTxIDRoute)
if err != nil {
return nil, fmt.Errorf("failed to get quote request status by tx hash: %w", err)
}
if resp.StatusCode() != http.StatusOK {
return nil, fmt.Errorf("unexpected status code: %d", resp.StatusCode())
}

return &res, nil
}

func (r *relayerClient) RetryTransaction(ctx context.Context, txhash string) (*GetTxRetryResponse, error) {
var res GetTxRetryResponse
resp, err := r.client.R().SetContext(ctx).
Expand Down
15 changes: 6 additions & 9 deletions services/rfq/relayer/relapi/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,12 @@ func NewRelayerAPI(
}

const (
getHealthRoute = "/health"
// TODO: replace with non-status specific endpoints.
getQuoteStatusByTxHashRoute = "/status"
getQuoteStatusByTxIDRoute = "/status/by_tx_id"
getRetryRoute = "/retry"
postWithdrawRoute = "/withdraw"
getTxHashByNonceRoute = "/tx_hash/by_nonce"
getRequestByTxID = "/request/by_tx_id"
getRequestByTxHash = "/request/by_tx_hash"
getHealthRoute = "/health"
getRetryRoute = "/retry"
postWithdrawRoute = "/withdraw"
getTxHashByNonceRoute = "/tx_hash/by_nonce"
getRequestByTxID = "/request/by_tx_id"
getRequestByTxHash = "/request/by_tx_hash"
)

var logger = log.Logger("relayer-api")
Expand Down

0 comments on commit 2758b5f

Please sign in to comment.