packages feed

haskoin-store-data 0.51.0 → 0.52.0

raw patch · 3 files changed

+28/−28 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Haskoin.Store.Data: instance GHC.Classes.Ord Haskoin.Store.Data.XPubUnspent
- Haskoin.Store.Data: XPubUnspent :: ![KeyIndex] -> !Unspent -> XPubUnspent
+ Haskoin.Store.Data: XPubUnspent :: !Unspent -> ![KeyIndex] -> XPubUnspent

Files

CHANGELOG.md view
@@ -4,6 +4,15 @@ 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.52.0+### Changed+- Remove unnecessary performance optimisations.++### Fixed+- Reduce balance retrievals for xpubs.+- Hack UTXO ordering to avoid unwanted behaviours.+- Do not merge conduits when there are too many.+ ## 0.51.0 ### Fixed - Data type for RequestTooLarge was missing.
haskoin-store-data.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 0b8de92bdb68810249bfd7cce65a70ac0f0d175350afcb656d80ed2d7576b6fd+-- hash: 710e372481353f316363a2d8c3a13be49c3531b328b4d4f6237ad9208a7a3535  name:           haskoin-store-data-version:        0.51.0+version:        0.52.0 synopsis:       Data for Haskoin Store description:    Please see the README on GitHub at <https://github.com/haskoin/haskoin-store#readme> category:       Bitcoin, Finance, Network
src/Haskoin/Store/Data.hs view
@@ -510,8 +510,16 @@         , unspentScript  :: !ByteString         , unspentAddress :: !(Maybe Address)         }-    deriving (Show, Eq, Ord, Generic, Hashable, NFData)+    deriving (Show, Eq, Generic, Hashable, NFData) +-- | Follow same order as in database and cache by inverting outpoint sort+-- order.+instance Ord Unspent where+    compare a b =+        compare+        (unspentBlock a, unspentPoint b)+        (unspentBlock b, unspentPoint a)+ instance Serial Unspent where     serialize Unspent{..} = do         serialize unspentBlock@@ -1437,10 +1445,10 @@ -- | Unspent transaction for extended public key. data XPubUnspent =     XPubUnspent-        { xPubUnspentPath :: ![KeyIndex]-        , xPubUnspent     :: !Unspent+        { xPubUnspent     :: !Unspent+        , xPubUnspentPath :: ![KeyIndex]         }-    deriving (Show, Eq, Generic, NFData)+    deriving (Show, Eq, Ord, Generic, NFData)  instance Serial XPubUnspent where     serialize XPubUnspent{..} = do@@ -1460,35 +1468,18 @@     get = deserialize  xPubUnspentToJSON :: Network -> XPubUnspent -> Value-xPubUnspentToJSON-    net-    XPubUnspent-    {-        xPubUnspentPath = p,-        xPubUnspent = u-    } =-    A.object-    [ "path" .= p-    , "unspent" .= unspentToJSON net u-    ]+xPubUnspentToJSON net XPubUnspent{xPubUnspentPath = p, xPubUnspent = u} =+    A.object ["unspent" .= unspentToJSON net u, "path" .= p]  xPubUnspentToEncoding :: Network -> XPubUnspent -> Encoding-xPubUnspentToEncoding-    net-    XPubUnspent-    {-        xPubUnspentPath = p,-        xPubUnspent = u-    } =-    AE.pairs $-    "path" .= p <>-    "unspent" `AE.pair` unspentToEncoding net u+xPubUnspentToEncoding net XPubUnspent{xPubUnspentPath = p, xPubUnspent = u} =+    AE.pairs $ "unspent" `AE.pair` unspentToEncoding net u <> "path" .= p  xPubUnspentParseJSON :: Network -> Value -> Parser XPubUnspent xPubUnspentParseJSON net =     A.withObject "xpubunspent" $ \o -> do-        p <- o .: "path"         u <- o .: "unspent" >>= unspentParseJSON net+        p <- o .: "path"         return XPubUnspent {xPubUnspentPath = p, xPubUnspent = u}  data XPubSummary =