haskoin-store 0.4.1 → 0.4.2
raw patch · 4 files changed
+19/−24 lines, 4 files
Files
- CHANGELOG.md +4/−0
- haskoin-store.cabal +2/−2
- src/Haskoin/Store.hs +4/−6
- src/Network/Haskoin/Store/Data.hs +9/−16
CHANGELOG.md view
@@ -4,6 +4,10 @@ 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.4.2+### Removed+- Remove extended public key itself from output of relevant endpoints to save bandwidth.+ ## 0.4.1 ### Changed - Fix bug when deleting coinbase transactions.
haskoin-store.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: b407eb4e2b80720f1736beab7f8217e106b9cea576b4f209b23e33648e0600aa+-- hash: df955314f48f1a258269639f5f16eb7cf357def339f0545cc3b42abfd014743e name: haskoin-store-version: 0.4.1+version: 0.4.2 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
src/Haskoin/Store.hs view
@@ -67,7 +67,6 @@ import Data.Function import Data.List import Data.Maybe-import Data.Word import Haskoin import Haskoin.Node import Network.Haskoin.Store.Block@@ -215,7 +214,7 @@ else return [] as m n = map- (\(a, _, n) -> (a, Deriv :/ m :/ n))+ (\(a, _, n') -> (a, Deriv :/ m :/ n')) (take 100 (deriveAddrs (pubSubKey k m) n)) xpubTxs ::@@ -229,7 +228,7 @@ mergeSourcesBy (compare `on` (addressTxBlock . xPubTx)) cds where cnd a p = getAddressTxs i a .| mapC (f p)- f p t = XPubTx {xPubTxKey = xpub, xPubTxPath = p, xPubTx = t}+ f p t = XPubTx {xPubTxPath = p, xPubTx = t} xpubBals :: (Monad m, StoreStream i m, StoreRead i m) => i -> XPubKey -> m [XPubBal]@@ -243,8 +242,7 @@ then Nothing else Just XPubBal- { xPubBalKey = xpub- , xPubBalPath = p+ { xPubBalPath = p , xPubBal = b } @@ -261,7 +259,7 @@ cnd a p = getAddressUnspents i a .| mapC (f p) f p t = XPubUnspent- {xPubUnspentKey = xpub, xPubUnspentPath = p, xPubUnspent = t}+ {xPubUnspentPath = p, xPubUnspent = t} -- Snatched from: -- https://github.com/cblp/conduit-merge/blob/master/src/Data/Conduit/Merge.hs
src/Network/Haskoin/Store/Data.hs view
@@ -412,16 +412,14 @@ -- | Address transaction from an extended public key. data XPubTx = XPubTx- { xPubTxKey :: !XPubKey- , xPubTxPath :: !SoftPath+ { xPubTxPath :: !SoftPath , xPubTx :: !AddressTx } deriving (Show, Eq, Generic) -- | JSON serialization for 'XPubTx'. xPubTxPairs :: A.KeyValue kv => Network -> XPubTx -> [kv]-xPubTxPairs net XPubTx {xPubTxKey = k, xPubTxPath = p, xPubTx = tx} =- [ "key" .= xPubExport net k- , "path" .= pathToStr p+xPubTxPairs net XPubTx {xPubTxPath = p, xPubTx = tx} =+ [ "path" .= pathToStr p , "tx" .= addressTxToJSON net tx ] @@ -433,16 +431,14 @@ -- | Address balances for an extended public key. data XPubBal = XPubBal- { xPubBalKey :: !XPubKey- , xPubBalPath :: !SoftPath+ { xPubBalPath :: !SoftPath , xPubBal :: !Balance } deriving (Show, Eq, Generic) -- | JSON serialization for 'XPubBal'. xPubBalPairs :: A.KeyValue kv => Network -> XPubBal -> [kv]-xPubBalPairs net XPubBal {xPubBalKey = k, xPubBalPath = p, xPubBal = b} =- [ "key" .= xPubExport net k- , "path" .= pathToStr p+xPubBalPairs net XPubBal {xPubBalPath = p, xPubBal = b} =+ [ "path" .= pathToStr p , "balance" .= balanceToJSON net b ] @@ -454,19 +450,16 @@ -- | Unspent transaction for extended public key. data XPubUnspent = XPubUnspent- { xPubUnspentKey :: !XPubKey- , xPubUnspentPath :: !SoftPath+ { xPubUnspentPath :: !SoftPath , xPubUnspent :: !Unspent } deriving (Show, Eq, Generic) -- | JSON serialization for 'XPubUnspent'. xPubUnspentPairs :: A.KeyValue kv => Network -> XPubUnspent -> [kv]-xPubUnspentPairs net XPubUnspent { xPubUnspentKey = k- , xPubUnspentPath = p+xPubUnspentPairs net XPubUnspent { xPubUnspentPath = p , xPubUnspent = u } =- [ "key" .= xPubExport net k- , "path" .= pathToStr p+ [ "path" .= pathToStr p , "unspent" .= unspentToJSON net u ]