Skip to content

Commit

Permalink
refactor: ✅ bebop/client: update test
Browse files Browse the repository at this point in the history
Signed-off-by: thanhpp <[email protected]>
  • Loading branch information
thanhpp committed Oct 3, 2024
1 parent 5280694 commit 6368ceb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/liquidity-source/bebop/client/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestHTTPClient(t *testing.T) {
},
)

resp, err := c.QuoteSingleOrder(context.Background(), bebop.QuoteParams{
resp, err := c.QuoteSingleOrderResult(context.Background(), bebop.QuoteParams{
SellTokens: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
BuyTokens: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
SellAmounts: "100000000000000000",
Expand Down
8 changes: 5 additions & 3 deletions pkg/liquidity-source/bebop/rfq.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package bebop

import (
"context"
"fmt"
"math/big"

"github.com/KyberNetwork/kyberswap-dex-lib/pkg/source/pool"
Expand Down Expand Up @@ -36,16 +37,17 @@ func (h *RFQHandler) RFQ(ctx context.Context, params pool.RFQParams) (*pool.RFQR
return nil, err
}
logger.Infof("params.SwapInfo: %v -> swapInfo: %v", params.SwapInfo, swapInfo)
result, err := h.client.QuoteSingleOrderResult(ctx, QuoteParams{
p := QuoteParams{
SellTokens: swapInfo.BaseToken,
BuyTokens: swapInfo.QuoteToken,
SellAmounts: swapInfo.BaseTokenAmount,
BuyAmounts: swapInfo.QuoteTokenAmount,
TakerAddress: params.RFQSender,
ReceiverAddress: params.RFQRecipient,
})
}
result, err := h.client.QuoteSingleOrderResult(ctx, p)
if err != nil {
return nil, err
return nil, fmt.Errorf("quote single order result: %w", err)
}

newAmountOut, _ := new(big.Int).SetString(result.ToSign.MakerAmount, 10)
Expand Down

0 comments on commit 6368ceb

Please sign in to comment.