haskoin-store-data 0.46.2 → 0.46.3
raw patch · 3 files changed
+17/−4 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Haskoin.Store.Data: binfoHexValue :: Word64 -> Text
Files
- CHANGELOG.md +4/−0
- haskoin-store-data.cabal +2/−2
- src/Haskoin/Store/Data.hs +11/−2
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.46.3+### Fixed+- Make hex value encoding compatible with Java BigInteger decoder.+ ## 0.46.2 ### Changed - Allow negative confirmations for compatibility with old API.
haskoin-store-data.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: c253c00b9cb5278e19624620258973d4a989bc4cb42201c38cb60ba8af2e1f0a+-- hash: e61a03aefa59e9d7ac5391663077666467af98b8973d313c73102d14af8c6658 name: haskoin-store-data-version: 0.46.2+version: 0.46.3 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
@@ -102,6 +102,7 @@ , binfoUnspentToJSON , binfoUnspentToEncoding , binfoUnspentParseJSON+ , binfoHexValue , BinfoUnspents(..) , binfoUnspentsToJSON , binfoUnspentsToEncoding@@ -1803,6 +1804,14 @@ getBinfoWalletTotalSent <- o .: "total_sent" return BinfoWallet {..} +binfoHexValue :: Word64 -> Text+binfoHexValue w64 =+ let bs = B.dropWhile (== 0x00) (S.encode w64)+ in encodeHex $+ if B.null bs || B.head bs `testBit` 7+ then B.cons 0x00 bs+ else bs+ data BinfoUnspent = BinfoUnspent { getBinfoUnspentHash :: !TxHash@@ -1822,7 +1831,7 @@ , "tx_output_n" .= getBinfoUnspentOutputIndex , "script" .= encodeHex getBinfoUnspentScript , "value" .= getBinfoUnspentValue- , "value_hex" .= (printf "%x" getBinfoUnspentValue :: String)+ , "value_hex" .= binfoHexValue getBinfoUnspentValue , "confirmations" .= getBinfoUnspentConfirmations , "tx_index" .= getBinfoUnspentTxIndex ] <>@@ -1838,7 +1847,7 @@ "tx_output_n" .= getBinfoUnspentOutputIndex <> "script" .= encodeHex getBinfoUnspentScript <> "value" .= getBinfoUnspentValue <>- "value_hex" .= (printf "%x" getBinfoUnspentValue :: String) <>+ "value_hex" .= binfoHexValue getBinfoUnspentValue <> "confirmations" .= getBinfoUnspentConfirmations <> "tx_index" .= getBinfoUnspentTxIndex <> maybe mempty (("xpub" `pair`) . binfoXPubPathToEncoding net) getBinfoUnspentXPub