Skip to content

Commit

Permalink
fix withdrawal api [SLT-365] (#3306)
Browse files Browse the repository at this point in the history
Co-authored-by: Trajan0x <trajan0x@users.noreply.github.com>
  • Loading branch information
trajan0x and trajan0x authored Oct 17, 2024
1 parent 6880ddd commit 6415acd
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions services/rfq/relayer/relapi/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package relapi
import (
"encoding/json"
"fmt"
"github.com/synapsecns/sanguine/core"
"math/big"
"net/http"

Expand Down Expand Up @@ -196,17 +197,8 @@ func (h *Handler) Withdraw(c *gin.Context) {
if util.IsGasToken(req.TokenAddress) {
nonce, err = h.submitter.SubmitTransaction(ctx, big.NewInt(int64(req.ChainID)), func(transactor *bind.TransactOpts) (tx *types.Transaction, err error) {
bc := bind.NewBoundContract(req.To, abi.ABI{}, h.chains[req.ChainID].Client, h.chains[req.ChainID].Client, h.chains[req.ChainID].Client)
if transactor.GasPrice != nil {
transactor.Value = value
// nolint: wrapcheck
return bc.Transfer(transactor)
}
var signer *types.Transaction
signer, err = transactor.Signer(h.submitter.Address(), tx)
if err != nil {
return nil, fmt.Errorf("could not get signer: %w", err)
}
return signer, nil
transactor.Value = core.CopyBigInt(value)
return bc.Transfer(transactor)
})
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("could not submit transaction: %s", err.Error())})
Expand Down

0 comments on commit 6415acd

Please sign in to comment.