Skip to content
Permalink
Browse files

Using the same folder as node for testing

  • Loading branch information...
tubackkhoa committed Jan 9, 2019
1 parent f77b125 commit 17c3a958d9d23f81d7bb8670aaf6d62d1e9f4595
Showing with 4 additions and 1 deletion.
  1. +2 −1 OrderBook/orderbook/mocks_test.go
  2. +2 −0 OrderBook/protocol/orderbook_model.go
@@ -1,6 +1,7 @@
package orderbook

var datadir = "../datadir/testing"
// var datadir = "../datadir/testing"
var datadir = "../../.data_30100/orderbook/"

// override Encode and Decode for better performance
var testDB = NewBatchDatabaseWithEncode(datadir, 0, 0, EncodeBytesItem, DecodeBytesItem)
@@ -5,6 +5,7 @@ import (
"math/big"
"strings"

demo "github.com/tomochain/orderbook/common"
"github.com/tomochain/orderbook/orderbook"
)

@@ -121,6 +122,7 @@ func (m *OrderbookModel) getAndCreateIfNotExisted(pairName string) (*orderbook.O
ob := orderbook.NewOrderBook(name, m.db)
if ob != nil {
ob.Restore()
demo.LogInfo("\nOrderBook :%s", ob.String(0))
m.Orderbooks[name] = ob
}
}

0 comments on commit 17c3a95

Please sign in to comment.
You can’t perform that action at this time.