Skip to content

Commit

Permalink
request id [goreleaser]
Browse files Browse the repository at this point in the history
  • Loading branch information
trajan0x committed Jul 5, 2024
1 parent 5f0b232 commit e28b400
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contrib/opbot/botmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Check failure on line 333 in contrib/opbot/botmd/commands.go

View workflow job for this annotation

GitHub Actions / Lint (contrib/opbot)

error returned from external package is unwrapped: sig: func (*github.com/synapsecns/sanguine/services/rfq/contracts/fastbridge.FastBridgeTransactor).Refund(opts *github.com/ethereum/go-ethereum/accounts/abi/bind.TransactOpts, request []byte) (*github.com/ethereum/go-ethereum/core/types.Transaction, error) (wrapcheck)
})
if err != nil {
log.Printf("error submitting refund: %v\n", err)
Expand Down Expand Up @@ -384,7 +384,7 @@ func convertChainName(input string) string {
return input

Check warning on line 384 in contrib/opbot/botmd/commands.go

View check run for this annotation

Codecov / codecov/patch

contrib/opbot/botmd/commands.go#L379-L384

Added lines #L379 - L384 were not covered by tests
}

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 {
Expand All @@ -398,5 +398,5 @@ func getQuoteRequest(ctx context.Context, client relapi.RelayerClient, tx string
return nil, fmt.Errorf("error fetching quote request: %w", err)
}

Check warning on line 399 in contrib/opbot/botmd/commands.go

View check run for this annotation

Codecov / codecov/patch

contrib/opbot/botmd/commands.go#L396-L399

Added lines #L396 - L399 were not covered by tests

return common.Hex2Bytes(qr.QuoteRequestRaw), nil
return qr, nil

Check warning on line 401 in contrib/opbot/botmd/commands.go

View check run for this annotation

Codecov / codecov/patch

contrib/opbot/botmd/commands.go#L401

Added line #L401 was not covered by tests
}
4 changes: 4 additions & 0 deletions services/rfq/relayer/relapi/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 4 additions & 0 deletions services/rfq/relayer/relapi/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

0 comments on commit e28b400

Please sign in to comment.