Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitryhil committed Dec 8, 2023
1 parent ebba217 commit d0ed1cd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions integration-tests/xrpl/scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ func validateTxsHashesInChannel(ctx context.Context, writtenTxHashes map[string]
case tx := <-txsCh:
// validate that we have all sent hashed and no duplicated
hash := tx.GetHash().String()
_, found := expectedHashes[hash]
if !found {
if _, found := expectedHashes[hash]; !found {
return errors.Errorf("not found expected tx hash:%s", hash)
}

Expand Down
4 changes: 2 additions & 2 deletions relayer/processes/xrpl_tx_observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (o *XRPLTxObserver) Start(ctx context.Context) error {
defer close(txCh)
return o.txScanner.ScanTxs(ctx, txCh)
})
spawn("tx-processor", parallel.Continue, func(ctx context.Context) error {
spawn("tx-processor", parallel.Fail, func(ctx context.Context) error {
for tx := range txCh {
if err := o.processTx(ctx, tx); err != nil {
if errors.Is(err, context.Canceled) {
Expand All @@ -78,7 +78,7 @@ func (o *XRPLTxObserver) Start(ctx context.Context) error {
}
}
}
return nil
return errors.WithStack(ctx.Err())
})

return nil
Expand Down
3 changes: 1 addition & 2 deletions relayer/xrpl/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ func (s *AccountScanner) scanTransactions(ctx context.Context, minLedger int64,
select {
case <-ctx.Done():
return lastLedger
default:
ch <- *tx
case ch <- *tx:
}
}
}
Expand Down

0 comments on commit d0ed1cd

Please sign in to comment.