Skip to content

Commit

Permalink
MatcherAPISpecification fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
koloale committed May 23, 2017
1 parent e86435f commit 36e85d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,19 @@ import scorex.wallet.Wallet
class OrderHistoryActor(val settings: MatcherSettings, val storedState: StoredState, val wallet: Wallet)
extends Actor with OrderValidator {

val dbFile = new File(settings.orderHistoryFile)
dbFile.getParentFile.mkdirs().ensuring(dbFile.getParentFile.exists())
val db: MVStore = new MVStore.Builder().fileName(settings.orderHistoryFile).compress().open()
def createMVStore(fileName: String): MVStore = {
Option(fileName).filter(_.trim.nonEmpty) match {
case Some(s) =>
val file = new File(s)
file.getParentFile.mkdirs().ensuring(file.getParentFile.exists())

new MVStore.Builder().fileName(s).compress().open()
case None =>
new MVStore.Builder().open()
}
}

val db: MVStore = createMVStore(settings.orderHistoryFile)
val storage = new OrderHistoryStorage(db)
val orderHistory = OrderHistoryImpl(storage)

Expand Down Expand Up @@ -61,10 +71,6 @@ class OrderHistoryActor(val settings: MatcherSettings, val storedState: StoredSt
sender() ! GetOrderHistoryResponse(res)
}

def validateOrder(): Unit = {

}

def deleteFromOrderHistory(req: DeleteOrderFromHistory): Unit = {
orderHistory.getOrderStatus(req.id) match {
case Filled | LimitOrder.Cancelled(_) =>
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/scorex/waves/TestingCommons.scala
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ trait TestingCommons extends Suite with BeforeAndAfterAll with Eventually {
| port: 9093
| journal-directory: ${waves.directory}"/journal"
| snapshots-directory: ${waves.directory}"/snapshots"
| order-history-file = ${waves.directory}"/matcher/orderhistory.dat"
| order-history-file = ""
| max-timestamp-diff = 3h
| is-migrate-to-new-order-history-storage = no
| }
Expand Down

0 comments on commit 36e85d1

Please sign in to comment.