Skip to content

Commit

Permalink
DEX-775 Starting issue when there is matching rules (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
vsuharnikov authored May 28, 2020
1 parent 0b57e17 commit a107f40
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,15 @@ class OrderBookActor(settings: Settings,
matchingRules = actualRules
updateCurrentMatchingRules(matchingRules.head)
actualRule = normalizeMatchingRule(matchingRules.head)
aggregatedRef ! AggregatedOrderBookActor.Command.ApplyChanges(LevelAmounts.empty,
None,
Some(matchingRules.head.tickSize.toDouble),
System.currentTimeMillis)
// Could be unset during the start
Option(aggregatedRef).foreach {
_ ! AggregatedOrderBookActor.Command.ApplyChanges(
LevelAmounts.empty,
None,
Some(matchingRules.head.tickSize.toDouble),
System.currentTimeMillis
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ class OrderBookActorSpecification
tp.expectMsg(OrderBookRecovered(pair, Some(50)))
}

"recovery - if there is a matching rule - DEX-775" in obcTestWithPrepare(
prepare = (obsdb, p) => obsdb.update(p, 50, Some(OrderBookSnapshot.empty)),
matchingRules = NonEmptyList.of(DenormalizedMatchingRule(0, 0.00000001), DenormalizedMatchingRule(40, 0.0000001))
) { (pair, _, tp) =>
tp.expectMsg(OrderBookRecovered(pair, Some(50)))
}

"recovery - notify address actor about orders" in obcTestWithPrepare(
{ (obsdb, p) =>
val ord = buy(p, 10 * Order.PriceConstant, 100)
Expand Down

0 comments on commit a107f40

Please sign in to comment.