summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxenog <>2018-09-14 13:12:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-09-14 13:12:00 (GMT)
commitbfc66b524de82344534e2083c0db41b02efb4f98 (patch)
tree6239188363846ca397b3b6a63e9c184e9317a96a
parent346fcc378fbaeb146b025dca884ca87bf7182961 (diff)
version 0.2.10.2.1
-rw-r--r--CHANGELOG.md4
-rw-r--r--haskoin-store.cabal4
-rw-r--r--test/Spec.hs16
3 files changed, 14 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8f97157..da4bba3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+## 0.1.0
+### Changed
+- Fix tests
+
## 0.2.0
### Added
- Documentation everywhere.
diff --git a/haskoin-store.cabal b/haskoin-store.cabal
index 2b32136..c12e196 100644
--- a/haskoin-store.cabal
+++ b/haskoin-store.cabal
@@ -2,10 +2,10 @@
--
-- see: https://github.com/sol/hpack
--
--- hash: df37cb39caa6d4694913200ee8ccf5e190db23ea20a046529710b3b0f72252e8
+-- hash: d2db143d3299c65407b7acb184fdfa25fcc90f3a6e1c81bfc9fb15c4813ad705
name: haskoin-store
-version: 0.2.0
+version: 0.2.1
synopsis: Storage and index for Bitcoin and Bitcoin Cash
description: Store blocks, transactions, and balances for Bitcoin or Bitcoin Cash, and make that information via REST API.
category: Bitcoin, Finance, Network
diff --git a/test/Spec.hs b/test/Spec.hs
index cb509ca..fb52772 100644
--- a/test/Spec.hs
+++ b/test/Spec.hs
@@ -6,7 +6,7 @@ import Control.Monad.Logger
import Control.Monad.Trans
import Data.Maybe
import Database.RocksDB (DB)
-import qualified Database.RocksDB as RocksDB
+import Database.RocksDB as R
import Haskoin
import Haskoin.Node
import Haskoin.Store
@@ -45,7 +45,7 @@ main = do
| otherwise -> get_the_block ((h :: Int) - 1)
_ -> get_the_block h
bh <- get_the_block 381
- m <- getBlock bh testStoreDB Nothing
+ m <- withSnapshot testStoreDB $ getBlock bh testStoreDB
let BlockValue {..} =
fromMaybe (error "Could not get block") m
blockValueHeight `shouldBe` 381
@@ -56,10 +56,10 @@ main = do
"7e621eeb02874ab039a8566fd36f4591e65eca65313875221842c53de6907d6c"
head blockValueTxs `shouldBe` h1
last blockValueTxs `shouldBe` h2
- t1 <- getTx net h1 testStoreDB Nothing
+ t1 <- withSnapshot testStoreDB $ getTx net h1 testStoreDB
t1 `shouldSatisfy` isJust
txHash (detailedTxData (fromJust t1)) `shouldBe` h1
- t2 <- getTx net h2 testStoreDB Nothing
+ t2 <- withSnapshot testStoreDB $ getTx net h2 testStoreDB
t2 `shouldSatisfy` isJust
txHash (detailedTxData (fromJust t2)) `shouldBe` h2
@@ -69,11 +69,11 @@ withTestStore net t f =
withSystemTempDirectory ("haskoin-store-test-" <> t <> "-") $ \w ->
runNoLoggingT $ do
db <-
- RocksDB.open
+ open
w
- RocksDB.defaultOptions
- { RocksDB.createIfMissing = True
- , RocksDB.compression = RocksDB.SnappyCompression
+ defaultOptions
+ { createIfMissing = True
+ , compression = SnappyCompression
}
let cfg =
StoreConfig