Skip to content

Commit

Permalink
Fix badger GetTradeBySwapAcceptId
Browse files Browse the repository at this point in the history
  • Loading branch information
altafan committed Dec 22, 2022
1 parent e175c5d commit 5f1e161
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ func (t tradeRepositoryImpl) GetCompletedTradesByMarket(
func (t tradeRepositoryImpl) GetTradeBySwapAcceptId(
ctx context.Context, swapAcceptId string,
) (*domain.Trade, error) {
query := badgerhold.Where("SwapAccept.Id").Eq(swapAcceptId)
query := badgerhold.Where("SwapAccept").MatchFunc(
func(ra *badgerhold.RecordAccess) (bool, error) {
swapAccept := ra.Field().(*domain.Swap)
return swapAccept != nil && swapAccept.Id == swapAcceptId, nil
},
)

trades, err := t.findTrades(ctx, query)
if err != nil {
Expand Down

0 comments on commit 5f1e161

Please sign in to comment.