haskoin-store-data 0.54.0 → 0.55.0
raw patch · 3 files changed
+23/−12 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Haskoin.Store.Data: BinfoTxInput :: !Word32 -> !ByteString -> !ByteString -> !Word32 -> !Maybe BinfoTxOutput -> BinfoTxInput
+ Haskoin.Store.Data: BinfoTxInput :: !Word32 -> !ByteString -> !ByteString -> !Word32 -> !BinfoTxOutput -> BinfoTxInput
- Haskoin.Store.Data: [getBinfoTxInputPrevOut] :: BinfoTxInput -> !Maybe BinfoTxOutput
+ Haskoin.Store.Data: [getBinfoTxInputPrevOut] :: BinfoTxInput -> !BinfoTxOutput
Files
- CHANGELOG.md +4/−0
- haskoin-store-data.cabal +2/−2
- src/Haskoin/Store/Data.hs +17/−10
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.55.0+### Changed+- Always have a previous output object in Blockchain inputs.+ ## 0.54.0 ### Added - WebSocket support.
haskoin-store-data.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 7cbb2efe0fcb3828d079b8dc59d77dff7cb7c9223b2c536426873fc02f058c16+-- hash: a365a85acc90195546f799275844cbebb13a03fdc3b680e61b0ba6ef790b5772 name: haskoin-store-data-version: 0.54.0+version: 0.55.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
@@ -2838,7 +2838,7 @@ , getBinfoTxInputWitness :: !ByteString , getBinfoTxInputScript :: !ByteString , getBinfoTxInputIndex :: !Word32- , getBinfoTxInputPrevOut :: !(Maybe BinfoTxOutput)+ , getBinfoTxInputPrevOut :: !BinfoTxOutput } deriving (Eq, Show, Generic, NFData) @@ -2849,7 +2849,7 @@ , "witness" .= encodeHex getBinfoTxInputWitness , "script" .= encodeHex getBinfoTxInputScript , "index" .= getBinfoTxInputIndex- , "prev_out" .= (binfoTxOutputToJSON net <$> getBinfoTxInputPrevOut)+ , "prev_out" .= binfoTxOutputToJSON net getBinfoTxInputPrevOut ] binfoTxInputToEncoding :: Network -> BinfoTxInput -> Encoding@@ -2859,7 +2859,7 @@ <> "witness" .= encodeHex getBinfoTxInputWitness <> "script" .= encodeHex getBinfoTxInputScript <> "index" .= getBinfoTxInputIndex- <> "prev_out" .= (binfoTxOutputToJSON net <$> getBinfoTxInputPrevOut)+ <> "prev_out" .= binfoTxOutputToJSON net getBinfoTxInputPrevOut ) binfoTxInputParseJSON :: Network -> Value -> Parser BinfoTxInput@@ -2870,8 +2870,8 @@ getBinfoTxInputScript <- maybe mzero return . decodeHex =<< o .: "script" getBinfoTxInputIndex <- o .: "index"- getBinfoTxInputPrevOut <- o .:? "prev_out" >>=- mapM (binfoTxOutputParseJSON net)+ getBinfoTxInputPrevOut <- o .: "prev_out" >>=+ binfoTxOutputParseJSON net return BinfoTxInput {..} data BinfoTxOutput@@ -3470,10 +3470,8 @@ -> Transaction -> Word32 -> StoreInput- -> Maybe BinfoTxOutput-inputToBinfoTxOutput _ _ _ _ StoreCoinbase{} = Nothing-inputToBinfoTxOutput numtxid abook t n StoreInput{..} =- Just+ -> BinfoTxOutput+inputToBinfoTxOutput numtxid abook t n i = BinfoTxOutput { getBinfoTxOutputIndex = out_index , getBinfoTxOutputType = 0@@ -3486,7 +3484,16 @@ , getBinfoTxOutputXPub = xpub } where- OutPoint out_hash out_index = inputPoint+ inputAmount =+ case i of StoreCoinbase{} -> 0+ StoreInput{..} -> inputAmount+ inputPkScript =+ case i of StoreCoinbase{} -> BS.empty+ StoreInput{..} -> inputPkScript+ inputAddress =+ case i of StoreCoinbase{} -> Nothing+ StoreInput{} -> inputAddress+ OutPoint out_hash out_index = inputPoint i spender = BinfoSpender (encodeBinfoTxId numtxid (txHash (transactionData t)))