Skip to content

Commit 628a044

Browse files
authored
fix: use tx hash from lifi api (#80)
* fix: use tx hash from lifi api * Fix tests
1 parent d7ddecb commit 628a044

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

chains/evm/message/confirmations.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (w *Watcher) wait(ctx context.Context, txHash common.Hash, requiredConfirma
8888
for {
8989
select {
9090
case <-ctx.Done():
91-
return fmt.Errorf("timed out waiting for confirmations")
91+
return fmt.Errorf("timed out waiting for confirmations %s", txHash.Hex())
9292
default:
9393
txReceipt, err := w.client.TransactionReceipt(ctx, txHash)
9494
if err != nil {

chains/evm/message/lifiEscrow.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func (h *LifiEscrowMessageHandler) HandleMessage(m *message.Message) (*proposal.
118118
err = h.confirmationWatcher.WaitForOrderConfirmations(
119119
context.Background(),
120120
h.chainID,
121-
common.HexToHash(data.DepositTxHash),
121+
*order.Meta.OrderInitiatedTxHash,
122122
orderValue,
123123
)
124124
if err != nil {

chains/evm/message/lifiEscrow_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,11 @@ func (s *LifiEscrowMessageHandlerTestSuite) Test_HandleMessage_ValidOrder() {
205205
LiquidityPool: common.HexToAddress("0xe59aaf21c4D9Cf92d9eD4537f4404BA031f83b23"),
206206
BorrowAmount: big.NewInt(10000),
207207
OrderID: "orderID",
208-
DepositTxHash: "0xhash",
209208
}
210209
s.mockOrderFetcher.EXPECT().GetOrder("orderID").Return(s.mockOrder, nil)
211210
s.mockOrderValidator.EXPECT().Validate(s.mockOrder).Return(nil)
212211
s.mockOrderPricer.EXPECT().PriceInputs(gomock.Any()).Return(float64(1000), nil)
213-
s.mockWatcher.EXPECT().WaitForOrderConfirmations(gomock.Any(), uint64(8453), common.HexToHash(ad.DepositTxHash), float64(1000)).Return(nil)
212+
s.mockWatcher.EXPECT().WaitForOrderConfirmations(gomock.Any(), uint64(8453), gomock.Any(), float64(1000)).Return(nil)
214213
s.mockCoordinator.EXPECT().Execute(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
215214

216215
m := &coreMessage.Message{

0 commit comments

Comments
 (0)