From e28b4007a35b36edaf274f989c9c81d47f2d223f Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 5 Jul 2024 17:56:20 -0400 Subject: [PATCH] request id [goreleaser] --- contrib/opbot/botmd/commands.go | 6 +++--- services/rfq/relayer/relapi/handler.go | 4 ++++ services/rfq/relayer/relapi/model.go | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/contrib/opbot/botmd/commands.go b/contrib/opbot/botmd/commands.go index 0818271ec3..340d570ad0 100644 --- a/contrib/opbot/botmd/commands.go +++ b/contrib/opbot/botmd/commands.go @@ -330,7 +330,7 @@ func (b *Bot) rfqRefund() *slacker.CommandDefinition { } nonce, err := b.submitter.SubmitTransaction(ctx.Context(), big.NewInt(int64(originChainID)), func(transactor *bind.TransactOpts) (tx *types.Transaction, err error) { - return fastBridgeHandle.Refund(transactor, rawRequest) + return fastBridgeHandle.Refund(transactor, common.Hex2Bytes(rawRequest.QuoteRequestRaw)) }) if err != nil { log.Printf("error submitting refund: %v\n", err) @@ -384,7 +384,7 @@ func convertChainName(input string) string { return input } -func getQuoteRequest(ctx context.Context, client relapi.RelayerClient, tx string) ([]byte, error) { +func getQuoteRequest(ctx context.Context, client relapi.RelayerClient, tx string) (*relapi.GetQuoteRequestResponse, error) { // at this point tx can be a txid or a has, we try both txRequest, err := client.GetQuoteRequestStatusByTxHash(ctx, tx) if err == nil { @@ -398,5 +398,5 @@ func getQuoteRequest(ctx context.Context, client relapi.RelayerClient, tx string return nil, fmt.Errorf("error fetching quote request: %w", err) } - return common.Hex2Bytes(qr.QuoteRequestRaw), nil + return qr, nil } diff --git a/services/rfq/relayer/relapi/handler.go b/services/rfq/relayer/relapi/handler.go index 04d20184c7..85644c8139 100644 --- a/services/rfq/relayer/relapi/handler.go +++ b/services/rfq/relayer/relapi/handler.go @@ -166,6 +166,10 @@ func (h *Handler) GetQuoteRequestByTxID(c *gin.Context) { resp := GetQuoteRequestResponse{ QuoteRequestRaw: common.Bytes2Hex(quoteRequest.RawRequest), + OriginChainID: quoteRequest.Transaction.OriginChainId, + DestChainID: quoteRequest.Transaction.DestChainId, + OriginToken: quoteRequest.Transaction.OriginToken.Hex(), + DestToken: quoteRequest.Transaction.DestToken.Hex(), } c.JSON(http.StatusOK, resp) } diff --git a/services/rfq/relayer/relapi/model.go b/services/rfq/relayer/relapi/model.go index dffab9ce5c..e84c313983 100644 --- a/services/rfq/relayer/relapi/model.go +++ b/services/rfq/relayer/relapi/model.go @@ -28,4 +28,8 @@ type PutRelayAckResponse struct { // GetQuoteRequestResponse is the response to a get quote request. type GetQuoteRequestResponse struct { QuoteRequestRaw string `json:"quote_request"` + OriginChainID uint32 `json:"origin_chain_id"` + DestChainID uint32 `json:"dest_chain_id"` + OriginToken string `json:"origin_token"` + DestToken string `json:"dest_token"` }