haskoin-store 0.11.2 → 0.12.0
raw patch · 37 files changed
+3801/−284 lines, 37 filesdep +protocol-buffersdep +protocol-buffers-descriptor
Dependencies added: protocol-buffers, protocol-buffers-descriptor
Files
- CHANGELOG.md +12/−0
- README.md +1/−8
- app/Main.hs +267/−268
- haskoin-store.cabal +39/−2
- src/Haskoin/Store.hs +8/−3
- src/Network/Haskoin/Store/Data.hs +75/−3
- src/Network/Haskoin/Store/Proto.hs +422/−0
- src/Network/Haskoin/Store/ProtocolBuffers.hs +23/−0
- src/Network/Haskoin/Store/ProtocolBuffers/Balance.hs +128/−0
- src/Network/Haskoin/Store/ProtocolBuffers/BalanceList.hs +82/−0
- src/Network/Haskoin/Store/ProtocolBuffers/BlockData.hs +228/−0
- src/Network/Haskoin/Store/ProtocolBuffers/BlockDataList.hs +82/−0
- src/Network/Haskoin/Store/ProtocolBuffers/BlockRef.hs +110/−0
- src/Network/Haskoin/Store/ProtocolBuffers/BlockRef/Block.hs +88/−0
- src/Network/Haskoin/Store/ProtocolBuffers/BlockRef/Block_ref.hs +28/−0
- src/Network/Haskoin/Store/ProtocolBuffers/BlockRef/Mempool.hs +81/−0
- src/Network/Haskoin/Store/ProtocolBuffers/BlockTx.hs +89/−0
- src/Network/Haskoin/Store/ProtocolBuffers/BlockTxList.hs +82/−0
- src/Network/Haskoin/Store/ProtocolBuffers/Event.hs +89/−0
- src/Network/Haskoin/Store/ProtocolBuffers/Event/Type.hs +65/−0
- src/Network/Haskoin/Store/ProtocolBuffers/EventList.hs +82/−0
- src/Network/Haskoin/Store/ProtocolBuffers/HealthCheck.hs +164/−0
- src/Network/Haskoin/Store/ProtocolBuffers/Input.hs +163/−0
- src/Network/Haskoin/Store/ProtocolBuffers/Output.hs +109/−0
- src/Network/Haskoin/Store/ProtocolBuffers/Peer.hs +117/−0
- src/Network/Haskoin/Store/ProtocolBuffers/PeerList.hs +82/−0
- src/Network/Haskoin/Store/ProtocolBuffers/Spender.hs +88/−0
- src/Network/Haskoin/Store/ProtocolBuffers/Transaction.hs +200/−0
- src/Network/Haskoin/Store/ProtocolBuffers/TransactionList.hs +82/−0
- src/Network/Haskoin/Store/ProtocolBuffers/TxAfterHeight.hs +81/−0
- src/Network/Haskoin/Store/ProtocolBuffers/TxIdList.hs +81/−0
- src/Network/Haskoin/Store/ProtocolBuffers/Unspent.hs +127/−0
- src/Network/Haskoin/Store/ProtocolBuffers/UnspentList.hs +82/−0
- src/Network/Haskoin/Store/ProtocolBuffers/XPubBalance.hs +90/−0
- src/Network/Haskoin/Store/ProtocolBuffers/XPubBalanceList.hs +82/−0
- src/Network/Haskoin/Store/ProtocolBuffers/XPubUnspent.hs +90/−0
- src/Network/Haskoin/Store/ProtocolBuffers/XPubUnspentList.hs +82/−0
CHANGELOG.md view
@@ -4,6 +4,18 @@ 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.12.0+### Added+- Support for binary serialization using Protocol Buffers.+- New endpoints for binary raw transactions (not hex-encoded).++### Changed+- Services field now a hex string instead of a number to avoid overflowing signed 64-bit integer.+- Flatten list of block data objects when responding to request for multiple block heights.+- Errors now reported in plain text without container JSON object.+- Transaction broadcasts are responded to with transaction id in plaintext hex (no JSON).+- Remove database snapshots to improve performance.+ ## 0.11.2 ### Changed - Fix duplicate mempool transaction announcements in event stream.
README.md view
@@ -9,7 +9,7 @@ - Persistent storage using RocksDB. - RESTful endpoints for blockchain data. - Concurrent non-blocking transactional design.-- Guaranteed consistency within a request.+- JSON and Protocol Buffers serialization support. ## Install@@ -24,10 +24,3 @@ ## API Documentation * [Swagger API Documentation](https://btc.haskoin.com/).--## Notes--### Transaction Ordering-Transactions are returned in reverse blockchain or mempool order, meaning that the latest transactions are shown first, starting from the mempool and then from the highest block in the blockchain. If many transactions are returned from the same block, they are in reverse order as they appear in the block, meaning the latest transaction in the block comes first.--After the November 2018 hard fork Bitcoin Cash transactions are not stored in a block in topological order. If multiple transactions in one block depend on each other, they may appear in the "wrong" order. This is intentional and does not need to be fixed.
app/Main.hs view
@@ -1,8 +1,8 @@ {-# LANGUAGE ApplicativeDo #-} {-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE MultiWayIf #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-}+{-# LANGUAGE MultiWayIf #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-orphans #-}@@ -12,9 +12,9 @@ import Control.Monad import Control.Monad.Logger import Control.Monad.Trans.Maybe-import Data.Aeson as A import Data.Bits import Data.ByteString.Builder+import qualified Data.ByteString.Lazy as L import qualified Data.ByteString.Lazy.Char8 as C import Data.Char import Data.Function@@ -22,6 +22,7 @@ import Data.Maybe import Data.Serialize as Serialize import Data.String.Conversions+import qualified Data.Text.Lazy as T import Data.Version import Database.RocksDB as R import Haskoin@@ -74,25 +75,7 @@ instance ScottyError Except where stringError = StringError- showError = cs . show--instance ToJSON Except where- toJSON ThingNotFound = object ["error" .= String "not found"]- toJSON BadRequest = object ["error" .= String "bad request"]- toJSON ServerError = object ["error" .= String "you made me kill a unicorn"]- toJSON (StringError _) = object ["error" .= String "you made me kill a unicorn"]- toJSON (UserError s) = object ["error" .= s]--data JsonEvent- = JsonEventTx TxHash- | JsonEventBlock BlockHash- deriving (Eq, Show)--instance ToJSON JsonEvent where- toJSON (JsonEventTx tx_hash) =- object ["type" .= String "tx", "id" .= tx_hash]- toJSON (JsonEventBlock block_hash) =- object ["type" .= String "block", "id" .= block_hash]+ showError = T.pack . show netNames :: String netNames = intercalate "|" (map getNetworkName allNets)@@ -151,15 +134,16 @@ return (host, port) defHandler :: Monad m => Except -> ActionT Except m ()-defHandler ServerError = S.json ServerError-defHandler ThingNotFound = status status404 >> S.json ThingNotFound-defHandler BadRequest = status status400 >> S.json BadRequest-defHandler (UserError s) = status status400 >> S.json (UserError s)-defHandler e = status status400 >> S.json e+defHandler ServerError = S.text "server error"+defHandler ThingNotFound = status status404 >> S.text "not found"+defHandler BadRequest = status status400 >> S.text "bad request"+defHandler (UserError s) = status status400 >> S.text (T.pack s)+defHandler (StringError s) = status status400 >> S.text (T.pack s) -maybeJSON :: (Monad m, ToJSON a) => Maybe a -> ActionT Except m ()-maybeJSON Nothing = raise ThingNotFound-maybeJSON (Just x) = S.json x+maybeSerial :: (Monad m, JsonSerial a, ProtoSerial a) => Network -> Bool -- ^ protobuf+ -> Maybe a -> ActionT Except m ()+maybeSerial _ _ Nothing = raise ThingNotFound+maybeSerial net proto (Just x) = S.raw $ serialAny net proto x myDirectory :: FilePath myDirectory = unsafePerformIO $ getAppUserDataDirectory "haskoin-store"@@ -221,91 +205,87 @@ S.get "/block/best" $ do cors n <- parse_no_tx+ proto <- setup_proto res <-- withSnapshot db $ \s ->- runMaybeT $ do- let d = (db, defaultReadOptions {useSnapshot = Just s})- bh <- MaybeT $ getBestBlock d- b <- MaybeT $ getBlock d bh- if n- then return- b {blockDataTxs = take 1 (blockDataTxs b)}- else return b- maybeJSON (blockDataToJSON net <$> res)+ runMaybeT $ do+ let d = (db, defaultReadOptions)+ bh <- MaybeT $ getBestBlock d+ b <- MaybeT $ getBlock d bh+ if n+ then return b {blockDataTxs = take 1 (blockDataTxs b)}+ else return b+ maybeSerial net proto res S.get "/block/:block" $ do cors block <- param "block" n <- parse_no_tx+ proto <- setup_proto res <-- withSnapshot db $ \s ->- runMaybeT $ do- let d = (db, defaultReadOptions {useSnapshot = Just s})- b <- MaybeT $ getBlock d block- if n- then return- b {blockDataTxs = take 1 (blockDataTxs b)}- else return b- maybeJSON (blockDataToJSON net <$> res)+ runMaybeT $ do+ let d = (db, defaultReadOptions)+ b <- MaybeT $ getBlock d block+ if n+ then return b {blockDataTxs = take 1 (blockDataTxs b)}+ else return b+ maybeSerial net proto res S.get "/block/height/:height" $ do cors height <- param "height"- n <- parse_no_tx+ no_tx <- parse_no_tx+ proto <- setup_proto res <-- withSnapshot db $ \s -> do- let d = (db, defaultReadOptions {useSnapshot = Just s})- bs <- getBlocksAtHeight d height- fmap catMaybes . forM bs $ \bh ->- runMaybeT $ do- b <- MaybeT $ getBlock d bh- return . blockDataToJSON net $- if n- then b- { blockDataTxs =- take 1 (blockDataTxs b)- }- else b- S.json res+ do let d = (db, defaultReadOptions)+ bs <- getBlocksAtHeight d height+ fmap catMaybes . forM bs $ \bh ->+ runMaybeT $ do+ b <- MaybeT $ getBlock d bh+ return+ b+ { blockDataTxs =+ if no_tx+ then take 1 (blockDataTxs b)+ else blockDataTxs b+ }+ S.raw $ serialAny net proto res S.get "/block/heights" $ do cors heights <- param "heights"- n <- parse_no_tx+ no_tx <- parse_no_tx+ proto <- setup_proto res <-- withSnapshot db $ \s -> do- let d = (db, defaultReadOptions {useSnapshot = Just s})- bs <- mapM (getBlocksAtHeight d) (nub heights)- forM bs $ \hs ->- fmap catMaybes . forM hs $ \bh ->- runMaybeT $ do- b <- MaybeT $ getBlock d bh- return . blockDataToJSON net $- if n- then b- { blockDataTxs =- take 1 (blockDataTxs b)- }- else b- S.json res+ do let d = (db, defaultReadOptions)+ bs <- concat <$> mapM (getBlocksAtHeight d) (nub heights)+ fmap catMaybes . forM bs $ \bh ->+ runMaybeT $ do+ b <- MaybeT $ getBlock d bh+ return+ b+ { blockDataTxs =+ if no_tx+ then take 1 (blockDataTxs b)+ else blockDataTxs b+ }+ S.raw $ serialAny net proto res S.get "/blocks" $ do cors blocks <- param "blocks"- n <- parse_no_tx+ no_tx <- parse_no_tx+ proto <- setup_proto res <-- withSnapshot db $ \s -> do- let d = (db, defaultReadOptions {useSnapshot = Just s})- fmap catMaybes . forM blocks $ \bh ->- runMaybeT $ do- b <- MaybeT $ getBlock d bh- return . blockDataToJSON net $- if n- then b- { blockDataTxs =- take 1 (blockDataTxs b)- }- else b- S.json res+ do let d = (db, defaultReadOptions)+ fmap catMaybes . forM blocks $ \bh ->+ runMaybeT $ do+ b <- MaybeT $ getBlock d bh+ return+ b+ { blockDataTxs =+ if no_tx+ then take 1 (blockDataTxs b)+ else blockDataTxs b+ }+ S.raw $ serialAny net proto res S.get "/mempool" $ do cors- setHeader "Content-Type" "application/json" (mlimit, mbr) <- parse_limits mpu <- case mbr of@@ -314,237 +294,203 @@ UserError "mempool transactions do not have height" Just (MemRef t) -> return $ Just t Nothing -> return Nothing- stream $ \io flush' ->- withSnapshot db $ \s ->- runResourceT . runConduit $- getMempool- (db, defaultReadOptions {useSnapshot = Just s})- mpu .|- mapC snd .|- apply_limit mlimit .|- jsonListConduit toEncoding .|- streamConduit io >>- liftIO flush'+ proto <- setup_proto+ stream $ \io flush' -> do+ let d = (db, defaultReadOptions)+ runResourceT . runConduit $+ getMempool d mpu .| mapC snd .| apply_limit mlimit .|+ streamAny net proto io+ liftIO flush' S.get "/transaction/:txid" $ do cors txid <- param "txid"+ proto <- setup_proto res <-- withSnapshot db $ \s -> do- let d = (db, defaultReadOptions {useSnapshot = Just s})- getTransaction d txid- let f = transactionToJSON net- maybeJSON $ fmap f res+ do let d = (db, defaultReadOptions)+ getTransaction d txid+ maybeSerial net proto res S.get "/transaction/:txid/hex" $ do cors txid <- param "txid" res <-- withSnapshot db $ \s -> do- let d = (db, defaultReadOptions {useSnapshot = Just s})- getTransaction d txid+ do let d = (db, defaultReadOptions)+ getTransaction d txid case res of Nothing -> raise ThingNotFound Just x -> text . cs . encodeHex $ Serialize.encode (transactionData x)+ S.get "/transaction/:txid/bin" $ do+ cors+ txid <- param "txid"+ res <-+ do let d = (db, defaultReadOptions)+ getTransaction d txid+ case res of+ Nothing -> raise ThingNotFound+ Just x -> do+ S.setHeader "Content-Type" "application/octet-stream"+ S.raw $ Serialize.encodeLazy (transactionData x) S.get "/transaction/:txid/after/:height" $ do cors txid <- param "txid" height <- param "height"+ proto <- setup_proto res <-- withSnapshot db $ \s -> do- let d = (db, defaultReadOptions {useSnapshot = Just s})- cbAfterHeight d 10000 height txid- S.json $ object ["result" .= res]+ do let d = (db, defaultReadOptions)+ cbAfterHeight d 10000 height txid+ S.raw $ serialAny net proto res S.get "/transactions" $ do cors txids <- param "txids"+ proto <- setup_proto res <-- withSnapshot db $ \s -> do- let d = (db, defaultReadOptions {useSnapshot = Just s})- catMaybes <$> mapM (getTransaction d) (nub txids)- S.json $ map (transactionToJSON net) res+ do let d = (db, defaultReadOptions)+ catMaybes <$> mapM (getTransaction d) (nub txids)+ S.raw $ serialAny net proto res S.get "/transactions/hex" $ do cors txids <- param "txids" res <-- withSnapshot db $ \s -> do- let d = (db, defaultReadOptions {useSnapshot = Just s})- catMaybes <$> mapM (getTransaction d) (nub txids)+ do let d = (db, defaultReadOptions)+ catMaybes <$> mapM (getTransaction d) (nub txids) S.json $ map (encodeHex . Serialize.encode . transactionData) res+ S.get "/transactions/bin" $ do+ cors+ txids <- param "txids"+ res <-+ do let d = (db, defaultReadOptions)+ catMaybes <$> mapM (getTransaction d) (nub txids)+ S.setHeader "Content-Type" "application/octet-stream"+ S.raw . L.concat $ map (Serialize.encodeLazy . transactionData) res S.get "/address/:address/transactions" $ do cors address <- parse_address- setHeader "Content-Type" "application/json" (mlimit, mbr) <- parse_limits- liftIO $ print (mlimit, mbr)- stream $ \io flush' ->- withSnapshot db $ \s ->- runResourceT . runConduit $- getAddressTxs- (db, defaultReadOptions {useSnapshot = Just s})- address- mbr .|- apply_limit mlimit .|- jsonListConduit toEncoding .|- streamConduit io >>- liftIO flush'+ proto <- setup_proto+ stream $ \io flush' -> do+ let d = (db, defaultReadOptions)+ runResourceT . runConduit $+ getAddressTxs d address mbr .| apply_limit mlimit .|+ streamAny net proto io+ liftIO flush' S.get "/address/transactions" $ do cors addresses <- parse_addresses- setHeader "Content-Type" "application/json" (mlimit, mbr) <- parse_limits- stream $ \io flush' ->- withSnapshot db $ \s ->- runResourceT . runConduit $+ proto <- setup_proto+ stream $ \io flush' -> do+ let d = (db, defaultReadOptions)+ runResourceT . runConduit $ mergeSourcesBy (flip compare `on` blockTxBlock)- (map (\a ->- getAddressTxs- ( db- , defaultReadOptions- {useSnapshot = Just s})- a- mbr)- addresses) .|+ (map (\a -> getAddressTxs d a mbr) addresses) .| dedup .| apply_limit mlimit .|- jsonListConduit toEncoding .|- streamConduit io >>- liftIO flush'+ streamAny net proto io+ liftIO flush' S.get "/address/:address/unspent" $ do cors address <- parse_address- setHeader "Content-Type" "application/json" (mlimit, mbr) <- parse_limits- stream $ \io flush' ->- withSnapshot db $ \s ->- runResourceT . runConduit $- getAddressUnspents- (db, defaultReadOptions {useSnapshot = Just s})- address- mbr .|- apply_limit mlimit .|- jsonListConduit (unspentToEncoding net) .|- streamConduit io >>- liftIO flush'+ proto <- setup_proto+ stream $ \io flush' -> do+ let d = (db, defaultReadOptions)+ runResourceT . runConduit $+ getAddressUnspents d address mbr .| apply_limit mlimit .|+ streamAny net proto io+ liftIO flush' S.get "/address/unspent" $ do cors addresses <- parse_addresses- setHeader "Content-Type" "application/json" (mlimit, mbr) <- parse_limits- stream $ \io flush' ->- withSnapshot db $ \s ->- runResourceT . runConduit $+ proto <- setup_proto+ stream $ \io flush' -> do+ let d = (db, defaultReadOptions)+ runResourceT . runConduit $ mergeSourcesBy (flip compare `on` unspentBlock)- (map (\a ->- getAddressUnspents- ( db- , defaultReadOptions- {useSnapshot = Just s})- a- mbr)- addresses) .|+ (map (\a -> getAddressUnspents d a mbr) addresses) .| apply_limit mlimit .|- jsonListConduit (unspentToEncoding net) .|- streamConduit io >>- liftIO flush'+ streamAny net proto io+ liftIO flush' S.get "/address/:address/balance" $ do cors address <- parse_address+ proto <- setup_proto res <-- withSnapshot db $ \s -> do- let d = (db, defaultReadOptions {useSnapshot = Just s})- getBalance d address >>= \case- Just b -> return b- Nothing ->- return- Balance- { balanceAddress = address- , balanceAmount = 0- , balanceUnspentCount = 0- , balanceZero = 0- , balanceTxCount = 0- , balanceTotalReceived = 0- }- S.json $ balanceToJSON net res+ do let d = (db, defaultReadOptions)+ getBalance d address >>= \case+ Just b -> return b+ Nothing ->+ return+ Balance+ { balanceAddress = address+ , balanceAmount = 0+ , balanceUnspentCount = 0+ , balanceZero = 0+ , balanceTxCount = 0+ , balanceTotalReceived = 0+ }+ S.raw $ serialAny net proto res S.get "/address/balances" $ do cors addresses <- parse_addresses+ proto <- setup_proto res <-- withSnapshot db $ \s -> do- let d = (db, defaultReadOptions {useSnapshot = Just s})- f a Nothing =- Balance- { balanceAddress = a- , balanceAmount = 0- , balanceUnspentCount = 0- , balanceZero = 0- , balanceTxCount = 0- , balanceTotalReceived = 0- }- f _ (Just b) = b- mapM (\a -> f a <$> getBalance d a) addresses- S.json $ map (balanceToJSON net) res+ do let d = (db, defaultReadOptions)+ f a Nothing =+ Balance+ { balanceAddress = a+ , balanceAmount = 0+ , balanceUnspentCount = 0+ , balanceZero = 0+ , balanceTxCount = 0+ , balanceTotalReceived = 0+ }+ f _ (Just b) = b+ mapM (\a -> f a <$> getBalance d a) addresses+ S.raw $ serialAny net proto res S.get "/xpub/:xpub/balances" $ do cors xpub <- parse_xpub+ proto <- setup_proto res <-- withSnapshot db $ \s -> do- let d = (db, defaultReadOptions {useSnapshot = Just s})- runResourceT $ xpubBals d xpub- S.json $ map (xPubBalToJSON net) res+ do let d = (db, defaultReadOptions)+ xpubBals d xpub+ S.raw $ serialAny net proto res S.get "/xpub/:xpub/transactions" $ do cors xpub <- parse_xpub- setHeader "Content-Type" "application/json" (mlimit, mbr) <- parse_limits- stream $ \io flush' ->- withSnapshot db $ \s ->- runResourceT . runConduit $- xpubTxs- (db, defaultReadOptions {useSnapshot = Just s})- mbr- xpub .|- dedup .|- apply_limit mlimit .|- jsonListConduit toEncoding .|- streamConduit io >>- liftIO flush'+ proto <- setup_proto+ stream $ \io flush' -> do+ let d = (db, defaultReadOptions)+ runResourceT . runConduit $+ xpubTxs d mbr xpub .| dedup .| apply_limit mlimit .|+ streamAny net proto io+ liftIO flush' S.get "/xpub/:xpub/unspent" $ do cors xpub <- parse_xpub- setHeader "Content-Type" "application/json"+ proto <- setup_proto (mlimit, mbr) <- parse_limits- stream $ \io flush' ->- withSnapshot db $ \s ->- runResourceT . runConduit $- xpubUnspent- (db, defaultReadOptions {useSnapshot = Just s})- mbr- xpub .|- apply_limit mlimit .|- jsonListConduit (xPubUnspentToEncoding net) .|- streamConduit io >>- liftIO flush'+ stream $ \io flush' -> do+ let d = (db, defaultReadOptions)+ runResourceT . runConduit $+ xpubUnspent d mbr xpub .| apply_limit mlimit .|+ streamAny net proto io+ liftIO flush' S.post "/transactions" $ do cors- hex_tx <- C.filter (not . isSpace) <$> body- bin_tx <-- case decodeHex (cs hex_tx) of- Nothing -> do- status status400- S.json (UserError "decode hex fail")- finish- Just x -> return x+ b <- body+ let bin = eitherToMaybe . Serialize.decode+ hex = bin <=< decodeHex . cs . C.filter (not . isSpace) tx <-- case Serialize.decode bin_tx of- Left _ -> do- status status400- S.json (UserError "decode tx within hex fail")- finish- Right x -> return x+ case hex b <|> bin (L.toStrict b) of+ Nothing -> raise (UserError "decode tx fail")+ Just x -> return x lift (publishTx pub st db tx) >>= \case- Right () -> S.json $ object ["txid" .= txHash tx]+ Right () -> S.text (T.fromStrict (txHashToHex (txHash tx))) Left e -> do case e of PubNoPeers -> status status500@@ -552,31 +498,42 @@ PubPeerDisconnected -> status status500 PubNotFound -> status status500 PubReject _ -> status status400- S.json (UserError (show e))+ S.text (T.pack (show e)) finish S.get "/dbstats" $ do cors getProperty db Stats >>= text . cs . fromJust S.get "/events" $ do cors- setHeader "Content-Type" "application/x-json-stream"+ proto <- setup_proto stream $ \io flush' -> withSubscription pub $ \sub -> forever $- flush' >> receive sub >>= \case- StoreBestBlock block_hash -> do- let bs =- A.encode (JsonEventBlock block_hash) <> "\n"- io (lazyByteString bs)- StoreMempoolNew tx_hash -> do- let bs = A.encode (JsonEventTx tx_hash) <> "\n"- io (lazyByteString bs)- _ -> return ()+ flush' >> receive sub >>= \se -> do+ let me =+ case se of+ StoreBestBlock block_hash ->+ Just (EventBlock block_hash)+ StoreMempoolNew tx_hash ->+ Just (EventTx tx_hash)+ _ -> Nothing+ case me of+ Nothing -> return ()+ Just e -> do+ let bs =+ serialAny net proto e <>+ if proto+ then mempty+ else "\n"+ io (lazyByteString bs) S.get "/peers" $ do cors- getPeersInformation (storeManager st) >>= S.json+ proto <- setup_proto+ ps <- getPeersInformation (storeManager st)+ S.raw $ serialAny net proto ps S.get "/health" $ do cors+ proto <- setup_proto h <- liftIO $ healthCheck@@ -585,7 +542,7 @@ (storeManager st) (storeChain st) when (not (healthOK h) || not (healthSynced h)) $ status status503- S.json h+ S.raw $ serialAny net proto h notFound $ raise ThingNotFound where parse_limits = do@@ -642,10 +599,52 @@ u <- askUnliftIO unliftIO u (runLoggingT l f) cors = setHeader "Access-Control-Allow-Origin" "*"+ setup_proto =+ let p = do+ setHeader "Content-Type" "application/x-protobuf"+ return True+ j = do+ setHeader "Content-Type" "application/json"+ return False+ in S.header "accept" >>= \case+ Nothing -> j+ Just x ->+ if is_proto x+ then p+ else j+ is_proto x =+ let ts =+ map+ (T.takeWhile (/= ';'))+ (T.splitOn "," (T.filter (not . isSpace) x))+ ps =+ [ "application/x-protobuf"+ , "application/protobuf"+ , "application/vnd.google.protobuf"+ ]+ in any (`elem` ps) ts -jsonListConduit :: Monad m => (a -> Encoding) -> ConduitT a Builder m ()-jsonListConduit f =- yield "[" >> mapC (fromEncoding . f) .| intersperseC "," >> yield "]"+serialAny :: (JsonSerial a, ProtoSerial a) => Network -> Bool -- ^ protobuf+ -> a -> L.ByteString+serialAny net True = protoSerial net+serialAny net False = toLazyByteString . jsonSerial net++streamAny ::+ (JsonSerial i, ProtoSerial [i], MonadIO m)+ => Network+ -> Bool -- ^ protobuf+ -> (Builder -> IO ())+ -> ConduitT i o m ()+streamAny net True io = protoConduit net .| mapC lazyByteString .| streamConduit io+streamAny net False io = jsonListConduit net .| streamConduit io++jsonListConduit :: (JsonSerial a, Monad m) => Network -> ConduitT a Builder m ()+jsonListConduit net =+ yield "[" >> mapC (jsonSerial net) .| intersperseC "," >> yield "]"++protoConduit ::+ (ProtoSerial [a], Monad m) => Network -> ConduitT a L.ByteString m ()+protoConduit net = mapC (protoSerial net . (: [])) streamConduit :: MonadIO m => (i -> IO ()) -> ConduitT i o m () streamConduit io = mapM_C (liftIO . io)
haskoin-store.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: fb34b3d0d4ea2f11f65e907766f8a85bb16500b28c01fef91a8e4cc677a558bb+-- hash: 9923b389f9afccabf5cc2595a6ee0819f38f58e28acd03cb0f13910684c06606 name: haskoin-store-version: 0.11.2+version: 0.12.0 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@@ -38,6 +38,37 @@ Network.Haskoin.Store.Data.RocksDB Network.Haskoin.Store.Logic Network.Haskoin.Store.Messages+ Network.Haskoin.Store.Proto+ Network.Haskoin.Store.ProtocolBuffers+ Network.Haskoin.Store.ProtocolBuffers.Balance+ Network.Haskoin.Store.ProtocolBuffers.BalanceList+ Network.Haskoin.Store.ProtocolBuffers.BlockData+ Network.Haskoin.Store.ProtocolBuffers.BlockDataList+ Network.Haskoin.Store.ProtocolBuffers.BlockRef+ Network.Haskoin.Store.ProtocolBuffers.BlockRef.Block+ Network.Haskoin.Store.ProtocolBuffers.BlockRef.Block_ref+ Network.Haskoin.Store.ProtocolBuffers.BlockRef.Mempool+ Network.Haskoin.Store.ProtocolBuffers.BlockTx+ Network.Haskoin.Store.ProtocolBuffers.BlockTxList+ Network.Haskoin.Store.ProtocolBuffers.Event+ Network.Haskoin.Store.ProtocolBuffers.Event.Type+ Network.Haskoin.Store.ProtocolBuffers.EventList+ Network.Haskoin.Store.ProtocolBuffers.HealthCheck+ Network.Haskoin.Store.ProtocolBuffers.Input+ Network.Haskoin.Store.ProtocolBuffers.Output+ Network.Haskoin.Store.ProtocolBuffers.Peer+ Network.Haskoin.Store.ProtocolBuffers.PeerList+ Network.Haskoin.Store.ProtocolBuffers.Spender+ Network.Haskoin.Store.ProtocolBuffers.Transaction+ Network.Haskoin.Store.ProtocolBuffers.TransactionList+ Network.Haskoin.Store.ProtocolBuffers.TxAfterHeight+ Network.Haskoin.Store.ProtocolBuffers.TxIdList+ Network.Haskoin.Store.ProtocolBuffers.Unspent+ Network.Haskoin.Store.ProtocolBuffers.UnspentList+ Network.Haskoin.Store.ProtocolBuffers.XPubBalance+ Network.Haskoin.Store.ProtocolBuffers.XPubBalanceList+ Network.Haskoin.Store.ProtocolBuffers.XPubUnspent+ Network.Haskoin.Store.ProtocolBuffers.XPubUnspentList Paths_haskoin_store hs-source-dirs: src@@ -56,6 +87,8 @@ , mtl , network , nqe+ , protocol-buffers+ , protocol-buffers-descriptor , random , rocksdb-haskell , rocksdb-query@@ -91,6 +124,8 @@ , monad-logger , nqe , optparse-applicative+ , protocol-buffers+ , protocol-buffers-descriptor , rocksdb-haskell , scotty , string-conversions@@ -118,6 +153,8 @@ , monad-logger , mtl , nqe+ , protocol-buffers+ , protocol-buffers-descriptor , rocksdb-haskell , transformers , unliftio
src/Haskoin/Store.hs view
@@ -25,6 +25,10 @@ , PreciseUnixTime(..) , HealthCheck(..) , PubExcept(..)+ , Event(..)+ , TxAfterHeight(..)+ , JsonSerial(..)+ , ProtoSerial(..) , withStore , store , getBestBlock@@ -84,6 +88,7 @@ import Network.Haskoin.Store.Block import Network.Haskoin.Store.Data import Network.Haskoin.Store.Messages+import Network.Haskoin.Store.Proto import Network.Socket (SockAddr (..)) import NQE import System.Random@@ -364,10 +369,10 @@ -> Int -- ^ how many ancestors to test before giving up -> BlockHeight -> TxHash- -> m (Maybe Bool)+ -> m TxAfterHeight cbAfterHeight i d h t- | d <= 0 = return Nothing- | otherwise = runMaybeT $ snd <$> tst d t+ | d <= 0 = return $ TxAfterHeight Nothing+ | otherwise = TxAfterHeight <$> runMaybeT (snd <$> tst d t) where tst e x | e <= 0 = MaybeT $ return Nothing
src/Network/Haskoin/Store/Data.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} module Network.Haskoin.Store.Data where@@ -11,6 +12,7 @@ import Data.Aeson as A import Data.ByteString (ByteString) import qualified Data.ByteString as B+import Data.ByteString.Builder import Data.ByteString.Short (ShortByteString) import qualified Data.ByteString.Short as B.Short import Data.Hashable@@ -110,6 +112,12 @@ toJSON (PreciseUnixTime w) = toJSON w toEncoding (PreciseUnixTime w) = toEncoding w +class JsonSerial a where+ jsonSerial :: Network -> a -> Builder++instance JsonSerial TxHash where+ jsonSerial _ = fromEncoding . toEncoding+ -- | Reference to a block where a transaction is stored. data BlockRef = BlockRef { blockRefHeight :: !BlockHeight@@ -157,9 +165,9 @@ -- | Transaction in relation to an address. data BlockTx = BlockTx- { blockTxBlock :: !BlockRef+ { blockTxBlock :: !BlockRef -- ^ block information- , blockTxHash :: !TxHash+ , blockTxHash :: !TxHash -- ^ transaction hash } deriving (Show, Eq, Ord, Generic, Serialize, Hashable) @@ -174,6 +182,9 @@ toJSON = object . blockTxPairs toEncoding = pairs . mconcat . blockTxPairs +instance JsonSerial BlockTx where+ jsonSerial _ = fromEncoding . toEncoding+ -- | Address balance information. data Balance = Balance { balanceAddress :: !Address@@ -207,6 +218,12 @@ balanceToEncoding :: Network -> Balance -> Encoding balanceToEncoding net = pairs . mconcat . balancePairs net +instance JsonSerial Balance where+ jsonSerial net = fromEncoding . balanceToEncoding net++instance JsonSerial [Balance] where+ jsonSerial net = fromEncoding . toEncoding . map (balanceToJSON net)+ -- | Unspent output. data Unspent = Unspent { unspentBlock :: !BlockRef@@ -248,6 +265,9 @@ unspentToEncoding :: Network -> Unspent -> Encoding unspentToEncoding net = pairs . mconcat . unspentPairs net +instance JsonSerial Unspent where+ jsonSerial net = fromEncoding . unspentToEncoding net+ -- | Database value for a block entry. data BlockData = BlockData { blockDataHeight :: !BlockHeight@@ -297,6 +317,12 @@ blockDataToEncoding :: Network -> BlockData -> Encoding blockDataToEncoding net = pairs . mconcat . blockDataPairs net +instance JsonSerial BlockData where+ jsonSerial net = fromEncoding . blockDataToEncoding net++instance JsonSerial [BlockData] where+ jsonSerial net = fromEncoding . toEncoding . map (blockDataToJSON net)+ -- | Input information. data Input = Coinbase { inputPoint :: !OutPoint@@ -565,6 +591,12 @@ transactionToEncoding :: Network -> Transaction -> Encoding transactionToEncoding net = pairs . mconcat . transactionPairs net +instance JsonSerial Transaction where+ jsonSerial net = fromEncoding . transactionToEncoding net++instance JsonSerial [Transaction] where+ jsonSerial net = fromEncoding . toEncoding . map (transactionToJSON net)+ -- | Information about a connected peer. data PeerInformation = PeerInformation { peerUserAgent :: !ByteString@@ -586,7 +618,7 @@ [ "useragent" .= String (cs (peerUserAgent p)) , "address" .= String (cs (show (peerAddress p))) , "version" .= peerVersion p- , "services" .= peerServices p+ , "services" .= String (encodeHex (S.encode (peerServices p))) , "relay" .= peerRelay p ] @@ -594,6 +626,12 @@ toJSON = object . peerInformationPairs toEncoding = pairs . mconcat . peerInformationPairs +instance JsonSerial PeerInformation where+ jsonSerial _ = fromEncoding . toEncoding++instance JsonSerial [PeerInformation] where+ jsonSerial _ = fromEncoding . toEncoding+ -- | Address balances for an extended public key. data XPubBal = XPubBal { xPubBalPath :: ![KeyIndex]@@ -613,6 +651,12 @@ xPubBalToEncoding :: Network -> XPubBal -> Encoding xPubBalToEncoding net = pairs . mconcat . xPubBalPairs net +instance JsonSerial XPubBal where+ jsonSerial net = fromEncoding . xPubBalToEncoding net++instance JsonSerial [XPubBal] where+ jsonSerial net = fromEncoding . toEncoding . map (xPubBalToJSON net)+ -- | Unspent transaction for extended public key. data XPubUnspent = XPubUnspent { xPubUnspentPath :: ![KeyIndex]@@ -634,6 +678,9 @@ xPubUnspentToEncoding :: Network -> XPubUnspent -> Encoding xPubUnspentToEncoding net = pairs . mconcat . xPubUnspentPairs net +instance JsonSerial XPubUnspent where+ jsonSerial net = fromEncoding . xPubUnspentToEncoding net+ data HealthCheck = HealthCheck { healthHeaderBest :: !(Maybe BlockHash) , healthHeaderHeight :: !(Maybe BlockHeight)@@ -661,3 +708,28 @@ instance ToJSON HealthCheck where toJSON = object . healthCheckPairs toEncoding = pairs . mconcat . healthCheckPairs++instance JsonSerial HealthCheck where+ jsonSerial _ = fromEncoding . toEncoding++data Event+ = EventBlock BlockHash+ | EventTx TxHash+ deriving (Show, Eq, Generic)++instance ToJSON Event where+ toJSON (EventTx h) = object ["type" .= String "tx", "id" .= h]+ toJSON (EventBlock h) = object ["type" .= String "block", "id" .= h]++instance JsonSerial Event where+ jsonSerial _ = fromEncoding . toEncoding++newtype TxAfterHeight = TxAfterHeight+ { txAfterHeight :: Maybe Bool+ } deriving (Show, Eq, Generic)++instance ToJSON TxAfterHeight where+ toJSON (TxAfterHeight b) = object ["result" .= b]++instance JsonSerial TxAfterHeight where+ jsonSerial _ = fromEncoding . toEncoding
+ src/Network/Haskoin/Store/Proto.hs view
@@ -0,0 +1,422 @@+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE MultiParamTypeClasses #-}+module Network.Haskoin.Store.Proto where++import Data.ByteString (ByteString)+import qualified Data.ByteString as B+import qualified Data.ByteString.Lazy as L+import qualified Data.ByteString.Lazy.Char8 as L8+import qualified Data.ByteString.Short as S+import qualified Data.Sequence as Seq+import Data.Serialize+import qualified Data.Text.Encoding as E+import Data.Version+import Haskoin+import Network.Haskoin.Store.Data+import qualified Network.Haskoin.Store.ProtocolBuffers.Balance as P.Balance+import qualified Network.Haskoin.Store.ProtocolBuffers.BalanceList as P.BalanceList+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockData as P.BlockData+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockDataList as P.BlockDataList+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockRef as P.BlockRef+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockRef.Block as P.BlockRef.Block+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockRef.Block_ref as P.BlockRef.Block_ref+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockRef.Mempool as P.BlockRef.Mempool+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockTx as P.BlockTx+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockTxList as P.BlockTxList+import qualified Network.Haskoin.Store.ProtocolBuffers.Event as P.Event+import qualified Network.Haskoin.Store.ProtocolBuffers.Event.Type as P.Event.Type+import qualified Network.Haskoin.Store.ProtocolBuffers.EventList as P.EventList+import qualified Network.Haskoin.Store.ProtocolBuffers.HealthCheck as P.HealthCheck+import qualified Network.Haskoin.Store.ProtocolBuffers.Input as P.Input+import qualified Network.Haskoin.Store.ProtocolBuffers.Output as P.Output+import qualified Network.Haskoin.Store.ProtocolBuffers.Peer as P.Peer+import qualified Network.Haskoin.Store.ProtocolBuffers.PeerList as P.PeerList+import qualified Network.Haskoin.Store.ProtocolBuffers.Spender as P.Spender+import qualified Network.Haskoin.Store.ProtocolBuffers.Transaction as P.Transaction+import qualified Network.Haskoin.Store.ProtocolBuffers.TransactionList as P.TransactionList+import qualified Network.Haskoin.Store.ProtocolBuffers.TxAfterHeight as P.TxAfterHeight+import qualified Network.Haskoin.Store.ProtocolBuffers.TxIdList as P.TxIdList+import qualified Network.Haskoin.Store.ProtocolBuffers.Unspent as P.Unspent+import qualified Network.Haskoin.Store.ProtocolBuffers.UnspentList as P.UnspentList+import qualified Network.Haskoin.Store.ProtocolBuffers.XPubBalance as P.XPubBalance+import qualified Network.Haskoin.Store.ProtocolBuffers.XPubBalanceList as P.XPubBalanceList+import qualified Network.Haskoin.Store.ProtocolBuffers.XPubUnspent as P.XPubUnspent+import qualified Network.Haskoin.Store.ProtocolBuffers.XPubUnspentList as P.XPubUnspentList+import Paths_haskoin_store as Paths+import Text.ProtocolBuffers++class ProtoSerial a where+ protoSerial :: Network -> a -> L.ByteString++protoAddress :: Network -> Address -> Utf8+protoAddress net = Utf8 . L.fromStrict . E.encodeUtf8 . addrToString net++protoPkScriptAddr :: Network -> ByteString -> Maybe Utf8+protoPkScriptAddr net pks =+ Utf8 . L.fromStrict . E.encodeUtf8 . addrToString net <$>+ eitherToMaybe (scriptToAddressBS pks)++protoBalance :: Network -> Balance -> P.Balance.Balance+protoBalance net Balance { balanceAddress = a+ , balanceAmount = v+ , balanceZero = z+ , balanceUnspentCount = u+ , balanceTxCount = c+ , balanceTotalReceived = t+ } =+ P.Balance.Balance+ { P.Balance.address = protoAddress net a+ , P.Balance.confirmed = v+ , P.Balance.unconfirmed = z+ , P.Balance.utxo = u+ , P.Balance.received = t+ , P.Balance.txs = c+ }++instance ProtoSerial Balance where+ protoSerial net = messagePut . protoBalance net++protoBalanceList :: Network -> [Balance] -> P.BalanceList.BalanceList+protoBalanceList net bs =+ P.BalanceList.BalanceList+ {P.BalanceList.balance = Seq.fromList (map (protoBalance net) bs)}++instance ProtoSerial [Balance] where+ protoSerial net = messagePut . protoBalanceList net++protoBlockRef :: BlockRef -> P.BlockRef.BlockRef+protoBlockRef BlockRef {blockRefHeight = h, blockRefPos = p} =+ P.BlockRef.BlockRef+ { P.BlockRef.block_ref =+ Just+ (P.BlockRef.Block_ref.Block+ { P.BlockRef.Block_ref.block =+ P.BlockRef.Block.Block+ { P.BlockRef.Block.height = h+ , P.BlockRef.Block.position = p+ }+ })+ }+protoBlockRef MemRef {memRefTime = PreciseUnixTime t} =+ P.BlockRef.BlockRef+ { P.BlockRef.block_ref =+ Just+ (P.BlockRef.Block_ref.Mempool+ { P.BlockRef.Block_ref.mempool =+ P.BlockRef.Mempool.Mempool+ {P.BlockRef.Mempool.mempool = t}+ })+ }++instance ProtoSerial BlockRef where+ protoSerial _ = messagePut . protoBlockRef++protoBlockTx :: BlockTx -> P.BlockTx.BlockTx+protoBlockTx BlockTx {blockTxBlock = b, blockTxHash = t} =+ P.BlockTx.BlockTx+ { P.BlockTx.block = protoBlockRef b+ , P.BlockTx.txid = encodeLazy t+ }++instance ProtoSerial BlockTx where+ protoSerial _ = messagePut . protoBlockTx++protoBlockTxList :: [BlockTx] -> P.BlockTxList.BlockTxList+protoBlockTxList bs =+ P.BlockTxList.BlockTxList+ {P.BlockTxList.blocktx = Seq.fromList (map protoBlockTx bs)}++instance ProtoSerial [BlockTx] where+ protoSerial _ = messagePut . protoBlockTxList++protoUnspent :: Network -> Unspent -> P.Unspent.Unspent+protoUnspent net Unspent { unspentBlock = b+ , unspentPoint = OutPoint { outPointHash = t+ , outPointIndex = i+ }+ , unspentAmount = v+ , unspentScript = s+ } =+ P.Unspent.Unspent+ { P.Unspent.txid = encodeLazy t+ , P.Unspent.index = i+ , P.Unspent.pkscript = L.fromStrict (S.fromShort s)+ , P.Unspent.value = v+ , P.Unspent.block = protoBlockRef b+ , P.Unspent.address = protoPkScriptAddr net (S.fromShort s)+ }++instance ProtoSerial Unspent where+ protoSerial net = messagePut . protoUnspent net++protoUnspentList :: Network -> [Unspent] -> P.UnspentList.UnspentList+protoUnspentList net us =+ P.UnspentList.UnspentList+ {P.UnspentList.unspent = Seq.fromList (map (protoUnspent net) us)}++instance ProtoSerial [Unspent] where+ protoSerial net = messagePut . protoUnspentList net++protoBlockData :: BlockData -> P.BlockData.BlockData+protoBlockData BlockData { blockDataHeight = g+ , blockDataMainChain = m+ , blockDataHeader = h+ , blockDataSize = s+ , blockDataWeight = e+ , blockDataTxs = t+ , blockDataOutputs = o+ , blockDataFees = f+ , blockDataSubsidy = y+ } =+ P.BlockData.BlockData+ { P.BlockData.hash = encodeLazy (headerHash h)+ , P.BlockData.size = s+ , P.BlockData.height = g+ , P.BlockData.mainchain = m+ , P.BlockData.previous = encodeLazy (prevBlock h)+ , P.BlockData.time = blockTimestamp h+ , P.BlockData.version = blockVersion h+ , P.BlockData.bits = blockBits h+ , P.BlockData.nonce = bhNonce h+ , P.BlockData.tx = encodeLazy <$> Seq.fromList t+ , P.BlockData.merkle = encodeLazy (merkleRoot h)+ , P.BlockData.fees = f+ , P.BlockData.outputs = o+ , P.BlockData.subsidy = y+ , P.BlockData.weight = e+ }++instance ProtoSerial BlockData where+ protoSerial _ = messagePut . protoBlockData++protoBlockDataList :: [BlockData] -> P.BlockDataList.BlockDataList+protoBlockDataList bs =+ P.BlockDataList.BlockDataList+ {P.BlockDataList.blockdata = Seq.fromList (map protoBlockData bs)}++instance ProtoSerial [BlockData] where+ protoSerial _ = messagePut . protoBlockDataList++protoInput :: Network -> Input -> P.Input.Input+protoInput _ Coinbase { inputPoint = OutPoint { outPointHash = h+ , outPointIndex = i+ }+ , inputSequence = q+ , inputSigScript = s+ , inputWitness = w+ } =+ P.Input.Input+ { P.Input.coinbase = True+ , P.Input.txid = encodeLazy h+ , P.Input.output = i+ , P.Input.sigscript = L.fromStrict s+ , P.Input.sequence = q+ , P.Input.witness = Seq.fromList (maybe [] (map L.fromStrict) w)+ , P.Input.value = Nothing+ , P.Input.pkscript = Nothing+ , P.Input.address = Nothing+ }+protoInput net Input { inputPoint = OutPoint { outPointHash = h+ , outPointIndex = i+ }+ , inputSequence = q+ , inputSigScript = s+ , inputPkScript = k+ , inputAmount = v+ , inputWitness = w+ } =+ P.Input.Input+ { P.Input.coinbase = False+ , P.Input.txid = encodeLazy h+ , P.Input.output = i+ , P.Input.sigscript = L.fromStrict s+ , P.Input.sequence = q+ , P.Input.witness = Seq.fromList (maybe [] (map L.fromStrict) w)+ , P.Input.value = Just v+ , P.Input.pkscript = Just (L.fromStrict k)+ , P.Input.address = protoPkScriptAddr net k+ }++protoSpender :: Spender -> P.Spender.Spender+protoSpender Spender {spenderHash = h, spenderIndex = i} =+ P.Spender.Spender {P.Spender.txid = encodeLazy h, P.Spender.input = i}++protoOutput :: Network -> Output -> P.Output.Output+protoOutput net Output {outputAmount = v, outputScript = k, outputSpender = s} =+ P.Output.Output+ { P.Output.pkscript = L.fromStrict k+ , P.Output.value = v+ , P.Output.address = protoPkScriptAddr net k+ , P.Output.spender = protoSpender <$> s+ }++protoTransaction :: Network -> Transaction -> P.Transaction.Transaction+protoTransaction net tx@Transaction { transactionBlock = b+ , transactionVersion = v+ , transactionLockTime = l+ , transactionInputs = i+ , transactionOutputs = o+ , transactionDeleted = d+ , transactionRBF = r+ , transactionTime = t+ } =+ P.Transaction.Transaction+ { P.Transaction.txid = encodeLazy (txHash (transactionData tx))+ , P.Transaction.size =+ fromIntegral (B.length (encode (transactionData tx)))+ , P.Transaction.version = v+ , P.Transaction.locktime = l+ , P.Transaction.block = protoBlockRef b+ , P.Transaction.deleted = d+ , P.Transaction.fee =+ if all isCoinbase i+ then 0+ else sum (map inputAmount i) - sum (map outputAmount o)+ , P.Transaction.rbf = r+ , P.Transaction.time = t+ , P.Transaction.inputs = Seq.fromList (map (protoInput net) i)+ , P.Transaction.outputs = Seq.fromList (map (protoOutput net) o)+ , P.Transaction.weight =+ if getSegWit net+ then Just w+ else Nothing+ }+ where+ w =+ let base = B.length $ encode (transactionData tx) {txWitness = []}+ wit = B.length $ encode (transactionData tx)+ in fromIntegral $ base * 3 + wit++instance ProtoSerial Transaction where+ protoSerial net = messagePut . protoTransaction net++protoTransactionList :: Network -> [Transaction] -> P.TransactionList.TransactionList+protoTransactionList net ts =+ P.TransactionList.TransactionList+ { P.TransactionList.transaction =+ Seq.fromList (map (protoTransaction net) ts)+ }++instance ProtoSerial [Transaction] where+ protoSerial net = messagePut . protoTransactionList net++protoTxIdList :: Network -> [TxHash] -> P.TxIdList.TxIdList+protoTxIdList _ ts =+ P.TxIdList.TxIdList {P.TxIdList.txid = Seq.fromList (map encodeLazy ts)}++instance ProtoSerial [TxHash] where+ protoSerial net = messagePut . protoTxIdList net++protoPeer :: PeerInformation -> P.Peer.Peer+protoPeer PeerInformation { peerUserAgent = u+ , peerAddress = a+ , peerVersion = v+ , peerServices = s+ , peerRelay = r+ } =+ P.Peer.Peer+ { P.Peer.useragent =+ either (const (Utf8 L.empty)) id (toUtf8 (L.fromStrict u))+ , P.Peer.address = Utf8 (L8.pack (show a))+ , P.Peer.version = v+ , P.Peer.services = s+ , P.Peer.relay = r+ }++instance ProtoSerial PeerInformation where+ protoSerial _ = messagePut . protoPeer++protoPeerList :: [PeerInformation] -> P.PeerList.PeerList+protoPeerList ps =+ P.PeerList.PeerList {P.PeerList.peer = Seq.fromList (map protoPeer ps)}++instance ProtoSerial [PeerInformation] where+ protoSerial _ = messagePut . protoPeerList++protoXPubBalance :: Network -> XPubBal -> P.XPubBalance.XPubBalance+protoXPubBalance net XPubBal {xPubBalPath = p, xPubBal = b} =+ P.XPubBalance.XPubBalance+ { P.XPubBalance.path = Seq.fromList p+ , P.XPubBalance.balance = protoBalance net b+ }++instance ProtoSerial XPubBal where+ protoSerial net = messagePut . protoXPubBalance net++protoXPubBalanceList :: Network -> [XPubBal] -> P.XPubBalanceList.XPubBalanceList+protoXPubBalanceList net bs =+ P.XPubBalanceList.XPubBalanceList+ { P.XPubBalanceList.xpubbalance =+ Seq.fromList (map (protoXPubBalance net) bs)+ }++instance ProtoSerial [XPubBal] where+ protoSerial net = messagePut . protoXPubBalanceList net++protoXPubUnspent :: Network -> XPubUnspent -> P.XPubUnspent.XPubUnspent+protoXPubUnspent net XPubUnspent {xPubUnspentPath = p, xPubUnspent = u} =+ P.XPubUnspent.XPubUnspent+ { P.XPubUnspent.path = Seq.fromList p+ , P.XPubUnspent.unspent = protoUnspent net u+ }++instance ProtoSerial XPubUnspent where+ protoSerial net = messagePut . protoXPubUnspent net++protoXPubUnspentList :: Network -> [XPubUnspent] -> P.XPubUnspentList.XPubUnspentList+protoXPubUnspentList net us =+ P.XPubUnspentList.XPubUnspentList+ { P.XPubUnspentList.xpubunspent =+ Seq.fromList (map (protoXPubUnspent net) us)+ }++instance ProtoSerial [XPubUnspent] where+ protoSerial net = messagePut . protoXPubUnspentList net++protoEvent :: Event -> P.Event.Event+protoEvent (EventTx h) =+ P.Event.Event {P.Event.type' = P.Event.Type.TX, P.Event.id = encodeLazy h}+protoEvent (EventBlock h) =+ P.Event.Event+ {P.Event.type' = P.Event.Type.BLOCK, P.Event.id = encodeLazy h}++instance ProtoSerial Event where+ protoSerial _ = messagePut . protoEvent++protoEventList :: [Event] -> P.EventList.EventList+protoEventList es =+ P.EventList.EventList {P.EventList.event = Seq.fromList (map protoEvent es)}++instance ProtoSerial [Event] where+ protoSerial _ = messagePut . protoEventList++protoHealthCheck :: HealthCheck -> P.HealthCheck.HealthCheck+protoHealthCheck HealthCheck { healthHeaderBest = maybe_header_hash+ , healthHeaderHeight = maybe_header_height+ , healthBlockBest = maybe_block_hash+ , healthBlockHeight = maybe_block_height+ , healthPeers = maybe_peer_count+ , healthNetwork = network_name+ , healthOK = ok+ , healthSynced = synced+ } =+ P.HealthCheck.HealthCheck+ { P.HealthCheck.ok = ok+ , P.HealthCheck.synced = synced+ , P.HealthCheck.version = Utf8 (L8.pack (showVersion Paths.version))+ , P.HealthCheck.net = Utf8 (L8.pack network_name)+ , P.HealthCheck.peers = fromIntegral <$> maybe_peer_count+ , P.HealthCheck.headers_hash = encodeLazy <$> maybe_header_hash+ , P.HealthCheck.headers_height = maybe_header_height+ , P.HealthCheck.blocks_hash = encodeLazy <$> maybe_block_hash+ , P.HealthCheck.blocks_height = maybe_block_height+ }++instance ProtoSerial HealthCheck where+ protoSerial _ = messagePut . protoHealthCheck++protoTxAfterHeight :: TxAfterHeight -> P.TxAfterHeight.TxAfterHeight+protoTxAfterHeight (TxAfterHeight b) = P.TxAfterHeight.TxAfterHeight b++instance ProtoSerial TxAfterHeight where+ protoSerial _ = messagePut . protoTxAfterHeight
+ src/Network/Haskoin/Store/ProtocolBuffers.hs view
@@ -0,0 +1,23 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers (protoInfo, fileDescriptorProto) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import Text.DescriptorProtos.FileDescriptorProto (FileDescriptorProto)+import Text.ProtocolBuffers.Reflections (ProtoInfo)+import qualified Text.ProtocolBuffers.WireMessage as P' (wireGet,getFromBS)++protoInfo :: ProtoInfo+protoInfo+ = Prelude'.read+ "ProtoInfo {protoMod = ProtoName {protobufName = FIName \".ProtocolBuffers\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [], baseName = MName \"ProtocolBuffers\"}, protoFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers.hs\"], protoSource = \"protocol-buffers.proto\", extensionKeys = fromList [], messages = [DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockRef\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockRef.hs\"], isGroup = False, fields = fromList [], descOneofs = fromList [OneofInfo {oneofName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.block_ref\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName = MName \"Block_ref\"}, oneofFName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockRef.block_ref\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName' = FName \"block_ref\", baseNamePrefix' = \"\"}, oneofFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockRef\",\"Block_ref.hs\"], oneofFields = fromList [(ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.block_ref.block\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block_ref\"], baseName = MName \"Block\"},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockRef.block_ref.block\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block_ref\"], baseName' = FName \"block\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.Block\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName = MName \"Block\"}), hsRawDefault = Nothing, hsDefault = Nothing}),(ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.block_ref.mempool\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block_ref\"], baseName = MName \"Mempool\"},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockRef.block_ref.mempool\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block_ref\"], baseName' = FName \"mempool\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.Mempool\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName = MName \"Mempool\"}), hsRawDefault = Nothing, hsDefault = Nothing})], oneofMakeLenses = False}], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.Mempool\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName = MName \"Mempool\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockRef\",\"Mempool.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockRef.Mempool.mempool\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Mempool\"], baseName' = FName \"mempool\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 0}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.Block\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName = MName \"Block\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockRef\",\"Block.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockRef.Block.height\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block\"], baseName' = FName \"height\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 0}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockRef.Block.position\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block\"], baseName' = FName \"position\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Balance\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Balance\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Balance.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Balance.address\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Balance\"], baseName' = FName \"address\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Balance.confirmed\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Balance\"], baseName' = FName \"confirmed\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Balance.unconfirmed\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Balance\"], baseName' = FName \"unconfirmed\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Balance.utxo\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Balance\"], baseName' = FName \"utxo\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Balance.received\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Balance\"], baseName' = FName \"received\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 32}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Balance.txs\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Balance\"], baseName' = FName \"txs\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 40}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BalanceList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BalanceList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BalanceList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BalanceList.balance\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BalanceList\"], baseName' = FName \"balance\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Balance\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Balance\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Unspent\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Unspent\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Unspent.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Unspent.txid\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Unspent\"], baseName' = FName \"txid\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Unspent.index\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Unspent\"], baseName' = FName \"index\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Unspent.pkscript\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Unspent\"], baseName' = FName \"pkscript\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Unspent.value\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Unspent\"], baseName' = FName \"value\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Unspent.block\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Unspent\"], baseName' = FName \"block\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 34}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockRef\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Unspent.address\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Unspent\"], baseName' = FName \"address\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 42}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.UnspentList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"UnspentList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"UnspentList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.UnspentList.unspent\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"UnspentList\"], baseName' = FName \"unspent\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Unspent\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Unspent\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.XPubBalance\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"XPubBalance\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"XPubBalance.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.XPubBalance.path\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"XPubBalance\"], baseName' = FName \"path\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Just (WireTag {getWireTag = 0},WireTag {getWireTag = 2}), wireTagLength = 1, isPacked = True, isRequired = False, canRepeat = True, mightPack = True, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.XPubBalance.balance\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"XPubBalance\"], baseName' = FName \"balance\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Balance\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Balance\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.XPubBalanceList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"XPubBalanceList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"XPubBalanceList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.XPubBalanceList.xpubbalance\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"XPubBalanceList\"], baseName' = FName \"xpubbalance\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.XPubBalance\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"XPubBalance\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.XPubUnspent\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"XPubUnspent\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"XPubUnspent.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.XPubUnspent.path\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"XPubUnspent\"], baseName' = FName \"path\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Just (WireTag {getWireTag = 0},WireTag {getWireTag = 2}), wireTagLength = 1, isPacked = True, isRequired = False, canRepeat = True, mightPack = True, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.XPubUnspent.unspent\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"XPubUnspent\"], baseName' = FName \"unspent\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Unspent\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Unspent\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.XPubUnspentList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"XPubUnspentList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"XPubUnspentList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.XPubUnspentList.xpubunspent\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"XPubUnspentList\"], baseName' = FName \"xpubunspent\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.XPubUnspent\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"XPubUnspent\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockTx\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockTx\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockTx.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockTx.block\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockTx\"], baseName' = FName \"block\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockRef\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockTx.txid\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockTx\"], baseName' = FName \"txid\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockTxList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockTxList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockTxList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockTxList.blocktx\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockTxList\"], baseName' = FName \"blocktx\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockTx\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockTx\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockData\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockData\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockData.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.hash\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"hash\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.size\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"size\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.height\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"height\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.mainchain\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"mainchain\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.previous\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"previous\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 34}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.time\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"time\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 40}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.version\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"version\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 48}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.bits\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"bits\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 56}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.nonce\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"nonce\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 64}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.tx\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"tx\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 9}, wireTag = WireTag {getWireTag = 74}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.merkle\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"merkle\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 10}, wireTag = WireTag {getWireTag = 82}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.fees\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"fees\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 11}, wireTag = WireTag {getWireTag = 88}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.outputs\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"outputs\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 12}, wireTag = WireTag {getWireTag = 96}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.subsidy\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"subsidy\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 13}, wireTag = WireTag {getWireTag = 104}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.weight\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"weight\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 14}, wireTag = WireTag {getWireTag = 112}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockDataList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockDataList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockDataList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockDataList.blockdata\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockDataList\"], baseName' = FName \"blockdata\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockData\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockData\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Input\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Input\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Input.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.coinbase\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"coinbase\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 0}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.txid\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"txid\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.output\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"output\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.sigscript\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"sigscript\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.sequence\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"sequence\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 32}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.witness\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"witness\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 42}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.value\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"value\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 48}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.pkscript\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"pkscript\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 58}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.address\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"address\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 66}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Spender\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Spender\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Spender.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Spender.txid\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Spender\"], baseName' = FName \"txid\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Spender.input\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Spender\"], baseName' = FName \"input\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Output\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Output\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Output.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Output.pkscript\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Output\"], baseName' = FName \"pkscript\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Output.value\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Output\"], baseName' = FName \"value\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Output.address\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Output\"], baseName' = FName \"address\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Output.spender\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Output\"], baseName' = FName \"spender\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Spender\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Spender\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Transaction\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Transaction\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Transaction.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.txid\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"txid\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.size\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"size\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.version\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"version\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.locktime\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"locktime\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.block\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"block\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 34}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockRef\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.deleted\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"deleted\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 40}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.fee\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"fee\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 48}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.time\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"time\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 56}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.rbf\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"rbf\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 64}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.inputs\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"inputs\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 9}, wireTag = WireTag {getWireTag = 74}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Input\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Input\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.outputs\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"outputs\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 10}, wireTag = WireTag {getWireTag = 82}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Output\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Output\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.weight\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"weight\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 11}, wireTag = WireTag {getWireTag = 88}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.TransactionList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"TransactionList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"TransactionList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.TransactionList.transaction\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"TransactionList\"], baseName' = FName \"transaction\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Transaction\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Transaction\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.TxIdList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"TxIdList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"TxIdList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.TxIdList.txid\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"TxIdList\"], baseName' = FName \"txid\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Event\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Event\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Event.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Event.type\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Event\"], baseName' = FName \"type'\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 0}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Event.Type\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"Event\"], baseName = MName \"Type\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Event.id\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Event\"], baseName' = FName \"id\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.EventList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"EventList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"EventList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.EventList.event\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"EventList\"], baseName' = FName \"event\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Event\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Event\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Peer\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Peer\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Peer.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Peer.useragent\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Peer\"], baseName' = FName \"useragent\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Peer.address\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Peer\"], baseName' = FName \"address\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Peer.version\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Peer\"], baseName' = FName \"version\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Peer.services\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Peer\"], baseName' = FName \"services\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Peer.relay\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Peer\"], baseName' = FName \"relay\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 32}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.PeerList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"PeerList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"PeerList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.PeerList.peer\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"PeerList\"], baseName' = FName \"peer\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Peer\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Peer\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.HealthCheck\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"HealthCheck\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"HealthCheck.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.ok\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"ok\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 0}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.synced\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"synced\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.version\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"version\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.net\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"net\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.peers\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"peers\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 32}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.headers_hash\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"headers_hash\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 42}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.headers_height\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"headers_height\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 48}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.blocks_hash\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"blocks_hash\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 58}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.blocks_height\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"blocks_height\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 64}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False},DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.TxAfterHeight\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"TxAfterHeight\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"TxAfterHeight.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.TxAfterHeight.result\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"TxAfterHeight\"], baseName' = FName \"result\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 0}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}], enums = [EnumInfo {enumName = ProtoName {protobufName = FIName \".ProtocolBuffers.Event.Type\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"Event\"], baseName = MName \"Type\"}, enumFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Event\",\"Type.hs\"], enumValues = [(EnumCode {getEnumCode = 0},\"TX\"),(EnumCode {getEnumCode = 1},\"BLOCK\")], enumJsonInstances = False}], oneofs = [OneofInfo {oneofName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.block_ref\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName = MName \"Block_ref\"}, oneofFName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockRef.block_ref\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName' = FName \"block_ref\", baseNamePrefix' = \"\"}, oneofFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockRef\",\"Block_ref.hs\"], oneofFields = fromList [(ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.block_ref.block\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block_ref\"], baseName = MName \"Block\"},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockRef.block_ref.block\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block_ref\"], baseName' = FName \"block\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.Block\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName = MName \"Block\"}), hsRawDefault = Nothing, hsDefault = Nothing}),(ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.block_ref.mempool\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block_ref\"], baseName = MName \"Mempool\"},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockRef.block_ref.mempool\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block_ref\"], baseName' = FName \"mempool\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.Mempool\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName = MName \"Mempool\"}), hsRawDefault = Nothing, hsDefault = Nothing})], oneofMakeLenses = False}], knownKeyMap = fromList []}"++fileDescriptorProto :: FileDescriptorProto+fileDescriptorProto+ = P'.getFromBS (P'.wireGet 11)+ (P'.pack+ "\206\DC3\n\SYNprotocol-buffers.proto\"\198\SOH\n\bBlockRef\DC20\n\ENQblock\CAN\NUL \SOH(\v2\US.ProtocolBuffers.BlockRef.BlockH\NUL\DC24\n\amempool\CAN\SOH \SOH(\v2!.ProtocolBuffers.BlockRef.MempoolH\NUL\SUB\SUB\n\aMempool\DC2\SI\n\amempool\CAN\NUL \STX(\EOT\SUB)\n\ENQBlock\DC2\SO\n\ACKheight\CAN\NUL \STX(\r\DC2\DLE\n\bposition\CAN\SOH \STX(\rB\v\n\tblock_ref\"o\n\aBalance\DC2\SI\n\aaddress\CAN\NUL \STX(\t\DC2\DC1\n\tconfirmed\CAN\SOH \STX(\EOT\DC2\DC3\n\vunconfirmed\CAN\STX \STX(\EOT\DC2\f\n\EOTutxo\CAN\ETX \STX(\EOT\DC2\DLE\n\breceived\CAN\EOT \STX(\EOT\DC2\v\n\ETXtxs\CAN\ENQ \STX(\EOT\"8\n\vBalanceList\DC2)\n\abalance\CAN\NUL \ETX(\v2\CAN.ProtocolBuffers.Balance\"\130\SOH\n\aUnspent\DC2\f\n\EOTtxid\CAN\NUL \STX(\f\DC2\r\n\ENQindex\CAN\SOH \STX(\r\DC2\DLE\n\bpkscript\CAN\STX \STX(\f\DC2\r\n\ENQvalue\CAN\ETX \STX(\EOT\DC2(\n\ENQblock\CAN\EOT \STX(\v2\EM.ProtocolBuffers.BlockRef\DC2\SI\n\aaddress\CAN\ENQ \SOH(\t\"8\n\vUnspentList\DC2)\n\aunspent\CAN\NUL \ETX(\v2\CAN.ProtocolBuffers.Unspent\"T\n\vXPubBalance\DC2\SUB\n\EOTpath\CAN\NUL \ETX(\rB\f\b\NUL\DLE\SOH\CAN\NUL(\NUL0\NULP\NUL\DC2)\n\abalance\CAN\SOH \STX(\v2\CAN.ProtocolBuffers.Balance\"D\n\SIXPubBalanceList\DC21\n\vxpubbalance\CAN\NUL \ETX(\v2\FS.ProtocolBuffers.XPubBalance\"T\n\vXPubUnspent\DC2\SUB\n\EOTpath\CAN\NUL \ETX(\rB\f\b\NUL\DLE\SOH\CAN\NUL(\NUL0\NULP\NUL\DC2)\n\aunspent\CAN\SOH \STX(\v2\CAN.ProtocolBuffers.Unspent\"D\n\SIXPubUnspentList\DC21\n\vxpubunspent\CAN\NUL \ETX(\v2\FS.ProtocolBuffers.XPubUnspent\"A\n\aBlockTx\DC2(\n\ENQblock\CAN\NUL \STX(\v2\EM.ProtocolBuffers.BlockRef\DC2\f\n\EOTtxid\CAN\SOH \STX(\f\"8\n\vBlockTxList\DC2)\n\ablocktx\CAN\NUL \ETX(\v2\CAN.ProtocolBuffers.BlockTx\"\244\SOH\n\tBlockData\DC2\f\n\EOThash\CAN\NUL \STX(\f\DC2\f\n\EOTsize\CAN\SOH \STX(\r\DC2\SO\n\ACKheight\CAN\STX \STX(\r\DC2\DC1\n\tmainchain\CAN\ETX \STX(\b\DC2\DLE\n\bprevious\CAN\EOT \STX(\f\DC2\f\n\EOTtime\CAN\ENQ \STX(\r\DC2\SI\n\aversion\CAN\ACK \STX(\r\DC2\f\n\EOTbits\CAN\a \STX(\r\DC2\r\n\ENQnonce\CAN\b \STX(\r\DC2\n\n\STXtx\CAN\t \ETX(\f\DC2\SO\n\ACKmerkle\CAN\n \STX(\f\DC2\f\n\EOTfees\CAN\v \STX(\EOT\DC2\SI\n\aoutputs\CAN\f \STX(\EOT\DC2\SI\n\asubsidy\CAN\r \STX(\EOT\DC2\SO\n\ACKweight\CAN\SO \STX(\r\">\n\rBlockDataList\DC2-\n\tblockdata\CAN\NUL \ETX(\v2\SUB.ProtocolBuffers.BlockData\"\159\SOH\n\ENQInput\DC2\DLE\n\bcoinbase\CAN\NUL \STX(\b\DC2\f\n\EOTtxid\CAN\SOH \STX(\f\DC2\SO\n\ACKoutput\CAN\STX \STX(\r\DC2\DC1\n\tsigscript\CAN\ETX \STX(\f\DC2\DLE\n\bsequence\CAN\EOT \STX(\r\DC2\SI\n\awitness\CAN\ENQ \ETX(\f\DC2\r\n\ENQvalue\CAN\ACK \SOH(\EOT\DC2\DLE\n\bpkscript\CAN\a \SOH(\f\DC2\SI\n\aaddress\CAN\b \SOH(\t\"&\n\aSpender\DC2\f\n\EOTtxid\CAN\NUL \STX(\f\DC2\r\n\ENQinput\CAN\SOH \STX(\r\"e\n\ACKOutput\DC2\DLE\n\bpkscript\CAN\NUL \STX(\f\DC2\r\n\ENQvalue\CAN\SOH \STX(\EOT\DC2\SI\n\aaddress\CAN\STX \SOH(\t\DC2)\n\aspender\CAN\ETX \SOH(\v2\CAN.ProtocolBuffers.Spender\"\145\STX\n\vTransaction\DC2\f\n\EOTtxid\CAN\NUL \STX(\f\DC2\f\n\EOTsize\CAN\SOH \STX(\r\DC2\SI\n\aversion\CAN\STX \STX(\r\DC2\DLE\n\blocktime\CAN\ETX \STX(\r\DC2(\n\ENQblock\CAN\EOT \STX(\v2\EM.ProtocolBuffers.BlockRef\DC2\SI\n\adeleted\CAN\ENQ \STX(\b\DC2\v\n\ETXfee\CAN\ACK \STX(\EOT\DC2\f\n\EOTtime\CAN\a \STX(\EOT\DC2\v\n\ETXrbf\CAN\b \STX(\b\DC2&\n\ACKinputs\CAN\t \ETX(\v2\SYN.ProtocolBuffers.Input\DC2(\n\aoutputs\CAN\n \ETX(\v2\ETB.ProtocolBuffers.Output\DC2\SO\n\ACKweight\CAN\v \SOH(\r\"D\n\SITransactionList\DC21\n\vtransaction\CAN\NUL \ETX(\v2\FS.ProtocolBuffers.Transaction\"\CAN\n\bTxIdList\DC2\f\n\EOTtxid\CAN\NUL \ETX(\f\"Y\n\ENQEvent\DC2)\n\EOTtype\CAN\NUL \STX(\SO2\ESC.ProtocolBuffers.Event.Type\DC2\n\n\STXid\CAN\SOH \STX(\f\"\EM\n\EOTType\DC2\ACK\n\STXTX\DLE\NUL\DC2\t\n\ENQBLOCK\DLE\SOH\"2\n\tEventList\DC2%\n\ENQevent\CAN\NUL \ETX(\v2\SYN.ProtocolBuffers.Event\"\\\n\EOTPeer\DC2\DC1\n\tuseragent\CAN\NUL \STX(\t\DC2\SI\n\aaddress\CAN\SOH \STX(\t\DC2\SI\n\aversion\CAN\STX \STX(\r\DC2\DLE\n\bservices\CAN\ETX \STX(\EOT\DC2\r\n\ENQrelay\CAN\EOT \STX(\b\"/\n\bPeerList\DC2#\n\EOTpeer\CAN\NUL \ETX(\v2\NAK.ProtocolBuffers.Peer\"\176\SOH\n\vHealthCheck\DC2\n\n\STXok\CAN\NUL \STX(\b\DC2\SO\n\ACKsynced\CAN\SOH \STX(\b\DC2\SI\n\aversion\CAN\STX \STX(\t\DC2\v\n\ETXnet\CAN\ETX \STX(\t\DC2\r\n\ENQpeers\CAN\EOT \SOH(\r\DC2\DC4\n\fheaders_hash\CAN\ENQ \SOH(\f\DC2\SYN\n\SOheaders_height\CAN\ACK \SOH(\r\DC2\DC3\n\vblocks_hash\CAN\a \SOH(\f\DC2\NAK\n\rblocks_height\CAN\b \SOH(\r\"\US\n\rTxAfterHeight\DC2\SO\n\ACKresult\CAN\NUL \SOH(\b")
+ src/Network/Haskoin/Store/ProtocolBuffers/Balance.hs view
@@ -0,0 +1,128 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.Balance (Balance(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'++data Balance = Balance{address :: !(P'.Utf8), confirmed :: !(P'.Word64), unconfirmed :: !(P'.Word64), utxo :: !(P'.Word64),+ received :: !(P'.Word64), txs :: !(P'.Word64)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable Balance where+ mergeAppend (Balance x'1 x'2 x'3 x'4 x'5 x'6) (Balance y'1 y'2 y'3 y'4 y'5 y'6)+ = Balance (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)+ (P'.mergeAppend x'5 y'5)+ (P'.mergeAppend x'6 y'6)++instance P'.Default Balance where+ defaultValue = Balance P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue++instance P'.Wire Balance where+ wireSize ft' self'@(Balance x'1 x'2 x'3 x'4 x'5 x'6)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size+ = (P'.wireSizeReq 1 9 x'1 + P'.wireSizeReq 1 4 x'2 + P'.wireSizeReq 1 4 x'3 + P'.wireSizeReq 1 4 x'4 ++ P'.wireSizeReq 1 4 x'5+ + P'.wireSizeReq 1 4 x'6)+ wirePutWithSize ft' self'@(Balance x'1 x'2 x'3 x'4 x'5 x'6)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields+ = P'.sequencePutWithSize+ [P'.wirePutReqWithSize 2 9 x'1, P'.wirePutReqWithSize 8 4 x'2, P'.wirePutReqWithSize 16 4 x'3,+ P'.wirePutReqWithSize 24 4 x'4, P'.wirePutReqWithSize 32 4 x'5, P'.wirePutReqWithSize 40 4 x'6]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{address = new'Field}) (P'.wireGet 9)+ 8 -> Prelude'.fmap (\ !new'Field -> old'Self{confirmed = new'Field}) (P'.wireGet 4)+ 16 -> Prelude'.fmap (\ !new'Field -> old'Self{unconfirmed = new'Field}) (P'.wireGet 4)+ 24 -> Prelude'.fmap (\ !new'Field -> old'Self{utxo = new'Field}) (P'.wireGet 4)+ 32 -> Prelude'.fmap (\ !new'Field -> old'Self{received = new'Field}) (P'.wireGet 4)+ 40 -> Prelude'.fmap (\ !new'Field -> old'Self{txs = new'Field}) (P'.wireGet 4)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> Balance) Balance where+ getVal m' f' = f' m'++instance P'.GPB Balance++instance P'.ReflectDescriptor Balance where+ getMessageInfo _+ = P'.GetMessageInfo (P'.fromDistinctAscList [2, 8, 16, 24, 32, 40]) (P'.fromDistinctAscList [2, 8, 16, 24, 32, 40])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Balance\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Balance\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Balance.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Balance.address\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Balance\"], baseName' = FName \"address\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Balance.confirmed\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Balance\"], baseName' = FName \"confirmed\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Balance.unconfirmed\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Balance\"], baseName' = FName \"unconfirmed\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Balance.utxo\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Balance\"], baseName' = FName \"utxo\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Balance.received\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Balance\"], baseName' = FName \"received\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 32}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Balance.txs\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Balance\"], baseName' = FName \"txs\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 40}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType Balance where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg Balance where+ textPut msg+ = do+ P'.tellT "address" (address msg)+ P'.tellT "confirmed" (confirmed msg)+ P'.tellT "unconfirmed" (unconfirmed msg)+ P'.tellT "utxo" (utxo msg)+ P'.tellT "received" (received msg)+ P'.tellT "txs" (txs msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'address, parse'confirmed, parse'unconfirmed, parse'utxo, parse'received, parse'txs])+ P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'address+ = P'.try+ (do+ v <- P'.getT "address"+ Prelude'.return (\ o -> o{address = v}))+ parse'confirmed+ = P'.try+ (do+ v <- P'.getT "confirmed"+ Prelude'.return (\ o -> o{confirmed = v}))+ parse'unconfirmed+ = P'.try+ (do+ v <- P'.getT "unconfirmed"+ Prelude'.return (\ o -> o{unconfirmed = v}))+ parse'utxo+ = P'.try+ (do+ v <- P'.getT "utxo"+ Prelude'.return (\ o -> o{utxo = v}))+ parse'received+ = P'.try+ (do+ v <- P'.getT "received"+ Prelude'.return (\ o -> o{received = v}))+ parse'txs+ = P'.try+ (do+ v <- P'.getT "txs"+ Prelude'.return (\ o -> o{txs = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/BalanceList.hs view
@@ -0,0 +1,82 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.BalanceList (BalanceList(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.Balance as ProtocolBuffers (Balance)++data BalanceList = BalanceList{balance :: !(P'.Seq ProtocolBuffers.Balance)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable BalanceList where+ mergeAppend (BalanceList x'1) (BalanceList y'1) = BalanceList (P'.mergeAppend x'1 y'1)++instance P'.Default BalanceList where+ defaultValue = BalanceList P'.defaultValue++instance P'.Wire BalanceList where+ wireSize ft' self'@(BalanceList x'1)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeRep 1 11 x'1)+ wirePutWithSize ft' self'@(BalanceList x'1)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutRepWithSize 2 11 x'1]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{balance = P'.append (balance old'Self) new'Field}) (P'.wireGet 11)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> BalanceList) BalanceList where+ getVal m' f' = f' m'++instance P'.GPB BalanceList++instance P'.ReflectDescriptor BalanceList where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList []) (P'.fromDistinctAscList [2])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BalanceList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BalanceList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BalanceList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BalanceList.balance\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BalanceList\"], baseName' = FName \"balance\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Balance\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Balance\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType BalanceList where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg BalanceList where+ textPut msg+ = do+ P'.tellT "balance" (balance msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'balance]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'balance+ = P'.try+ (do+ v <- P'.getT "balance"+ Prelude'.return (\ o -> o{balance = P'.append (balance o) v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/BlockData.hs view
@@ -0,0 +1,228 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.BlockData (BlockData(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'++data BlockData = BlockData{hash :: !(P'.ByteString), size :: !(P'.Word32), height :: !(P'.Word32), mainchain :: !(P'.Bool),+ previous :: !(P'.ByteString), time :: !(P'.Word32), version :: !(P'.Word32), bits :: !(P'.Word32),+ nonce :: !(P'.Word32), tx :: !(P'.Seq P'.ByteString), merkle :: !(P'.ByteString), fees :: !(P'.Word64),+ outputs :: !(P'.Word64), subsidy :: !(P'.Word64), weight :: !(P'.Word32)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable BlockData where+ mergeAppend (BlockData x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9 x'10 x'11 x'12 x'13 x'14 x'15)+ (BlockData y'1 y'2 y'3 y'4 y'5 y'6 y'7 y'8 y'9 y'10 y'11 y'12 y'13 y'14 y'15)+ = BlockData (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)+ (P'.mergeAppend x'5 y'5)+ (P'.mergeAppend x'6 y'6)+ (P'.mergeAppend x'7 y'7)+ (P'.mergeAppend x'8 y'8)+ (P'.mergeAppend x'9 y'9)+ (P'.mergeAppend x'10 y'10)+ (P'.mergeAppend x'11 y'11)+ (P'.mergeAppend x'12 y'12)+ (P'.mergeAppend x'13 y'13)+ (P'.mergeAppend x'14 y'14)+ (P'.mergeAppend x'15 y'15)++instance P'.Default BlockData where+ defaultValue+ = BlockData P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue+ P'.defaultValue+ P'.defaultValue+ P'.defaultValue+ P'.defaultValue+ P'.defaultValue+ P'.defaultValue+ P'.defaultValue+ P'.defaultValue++instance P'.Wire BlockData where+ wireSize ft' self'@(BlockData x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9 x'10 x'11 x'12 x'13 x'14 x'15)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size+ = (P'.wireSizeReq 1 12 x'1 + P'.wireSizeReq 1 13 x'2 + P'.wireSizeReq 1 13 x'3 + P'.wireSizeReq 1 8 x'4 ++ P'.wireSizeReq 1 12 x'5+ + P'.wireSizeReq 1 13 x'6+ + P'.wireSizeReq 1 13 x'7+ + P'.wireSizeReq 1 13 x'8+ + P'.wireSizeReq 1 13 x'9+ + P'.wireSizeRep 1 12 x'10+ + P'.wireSizeReq 1 12 x'11+ + P'.wireSizeReq 1 4 x'12+ + P'.wireSizeReq 1 4 x'13+ + P'.wireSizeReq 1 4 x'14+ + P'.wireSizeReq 1 13 x'15)+ wirePutWithSize ft' self'@(BlockData x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9 x'10 x'11 x'12 x'13 x'14 x'15)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields+ = P'.sequencePutWithSize+ [P'.wirePutReqWithSize 2 12 x'1, P'.wirePutReqWithSize 8 13 x'2, P'.wirePutReqWithSize 16 13 x'3,+ P'.wirePutReqWithSize 24 8 x'4, P'.wirePutReqWithSize 34 12 x'5, P'.wirePutReqWithSize 40 13 x'6,+ P'.wirePutReqWithSize 48 13 x'7, P'.wirePutReqWithSize 56 13 x'8, P'.wirePutReqWithSize 64 13 x'9,+ P'.wirePutRepWithSize 74 12 x'10, P'.wirePutReqWithSize 82 12 x'11, P'.wirePutReqWithSize 88 4 x'12,+ P'.wirePutReqWithSize 96 4 x'13, P'.wirePutReqWithSize 104 4 x'14, P'.wirePutReqWithSize 112 13 x'15]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{hash = new'Field}) (P'.wireGet 12)+ 8 -> Prelude'.fmap (\ !new'Field -> old'Self{size = new'Field}) (P'.wireGet 13)+ 16 -> Prelude'.fmap (\ !new'Field -> old'Self{height = new'Field}) (P'.wireGet 13)+ 24 -> Prelude'.fmap (\ !new'Field -> old'Self{mainchain = new'Field}) (P'.wireGet 8)+ 34 -> Prelude'.fmap (\ !new'Field -> old'Self{previous = new'Field}) (P'.wireGet 12)+ 40 -> Prelude'.fmap (\ !new'Field -> old'Self{time = new'Field}) (P'.wireGet 13)+ 48 -> Prelude'.fmap (\ !new'Field -> old'Self{version = new'Field}) (P'.wireGet 13)+ 56 -> Prelude'.fmap (\ !new'Field -> old'Self{bits = new'Field}) (P'.wireGet 13)+ 64 -> Prelude'.fmap (\ !new'Field -> old'Self{nonce = new'Field}) (P'.wireGet 13)+ 74 -> Prelude'.fmap (\ !new'Field -> old'Self{tx = P'.append (tx old'Self) new'Field}) (P'.wireGet 12)+ 82 -> Prelude'.fmap (\ !new'Field -> old'Self{merkle = new'Field}) (P'.wireGet 12)+ 88 -> Prelude'.fmap (\ !new'Field -> old'Self{fees = new'Field}) (P'.wireGet 4)+ 96 -> Prelude'.fmap (\ !new'Field -> old'Self{outputs = new'Field}) (P'.wireGet 4)+ 104 -> Prelude'.fmap (\ !new'Field -> old'Self{subsidy = new'Field}) (P'.wireGet 4)+ 112 -> Prelude'.fmap (\ !new'Field -> old'Self{weight = new'Field}) (P'.wireGet 13)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> BlockData) BlockData where+ getVal m' f' = f' m'++instance P'.GPB BlockData++instance P'.ReflectDescriptor BlockData where+ getMessageInfo _+ = P'.GetMessageInfo (P'.fromDistinctAscList [2, 8, 16, 24, 34, 40, 48, 56, 64, 82, 88, 96, 104, 112])+ (P'.fromDistinctAscList [2, 8, 16, 24, 34, 40, 48, 56, 64, 74, 82, 88, 96, 104, 112])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockData\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockData\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockData.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.hash\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"hash\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.size\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"size\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.height\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"height\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.mainchain\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"mainchain\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.previous\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"previous\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 34}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.time\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"time\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 40}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.version\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"version\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 48}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.bits\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"bits\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 56}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.nonce\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"nonce\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 64}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.tx\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"tx\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 9}, wireTag = WireTag {getWireTag = 74}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.merkle\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"merkle\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 10}, wireTag = WireTag {getWireTag = 82}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.fees\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"fees\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 11}, wireTag = WireTag {getWireTag = 88}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.outputs\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"outputs\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 12}, wireTag = WireTag {getWireTag = 96}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.subsidy\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"subsidy\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 13}, wireTag = WireTag {getWireTag = 104}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockData.weight\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockData\"], baseName' = FName \"weight\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 14}, wireTag = WireTag {getWireTag = 112}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType BlockData where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg BlockData where+ textPut msg+ = do+ P'.tellT "hash" (hash msg)+ P'.tellT "size" (size msg)+ P'.tellT "height" (height msg)+ P'.tellT "mainchain" (mainchain msg)+ P'.tellT "previous" (previous msg)+ P'.tellT "time" (time msg)+ P'.tellT "version" (version msg)+ P'.tellT "bits" (bits msg)+ P'.tellT "nonce" (nonce msg)+ P'.tellT "tx" (tx msg)+ P'.tellT "merkle" (merkle msg)+ P'.tellT "fees" (fees msg)+ P'.tellT "outputs" (outputs msg)+ P'.tellT "subsidy" (subsidy msg)+ P'.tellT "weight" (weight msg)+ textGet+ = do+ mods <- P'.sepEndBy+ (P'.choice+ [parse'hash, parse'size, parse'height, parse'mainchain, parse'previous, parse'time, parse'version, parse'bits,+ parse'nonce, parse'tx, parse'merkle, parse'fees, parse'outputs, parse'subsidy, parse'weight])+ P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'hash+ = P'.try+ (do+ v <- P'.getT "hash"+ Prelude'.return (\ o -> o{hash = v}))+ parse'size+ = P'.try+ (do+ v <- P'.getT "size"+ Prelude'.return (\ o -> o{size = v}))+ parse'height+ = P'.try+ (do+ v <- P'.getT "height"+ Prelude'.return (\ o -> o{height = v}))+ parse'mainchain+ = P'.try+ (do+ v <- P'.getT "mainchain"+ Prelude'.return (\ o -> o{mainchain = v}))+ parse'previous+ = P'.try+ (do+ v <- P'.getT "previous"+ Prelude'.return (\ o -> o{previous = v}))+ parse'time+ = P'.try+ (do+ v <- P'.getT "time"+ Prelude'.return (\ o -> o{time = v}))+ parse'version+ = P'.try+ (do+ v <- P'.getT "version"+ Prelude'.return (\ o -> o{version = v}))+ parse'bits+ = P'.try+ (do+ v <- P'.getT "bits"+ Prelude'.return (\ o -> o{bits = v}))+ parse'nonce+ = P'.try+ (do+ v <- P'.getT "nonce"+ Prelude'.return (\ o -> o{nonce = v}))+ parse'tx+ = P'.try+ (do+ v <- P'.getT "tx"+ Prelude'.return (\ o -> o{tx = P'.append (tx o) v}))+ parse'merkle+ = P'.try+ (do+ v <- P'.getT "merkle"+ Prelude'.return (\ o -> o{merkle = v}))+ parse'fees+ = P'.try+ (do+ v <- P'.getT "fees"+ Prelude'.return (\ o -> o{fees = v}))+ parse'outputs+ = P'.try+ (do+ v <- P'.getT "outputs"+ Prelude'.return (\ o -> o{outputs = v}))+ parse'subsidy+ = P'.try+ (do+ v <- P'.getT "subsidy"+ Prelude'.return (\ o -> o{subsidy = v}))+ parse'weight+ = P'.try+ (do+ v <- P'.getT "weight"+ Prelude'.return (\ o -> o{weight = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/BlockDataList.hs view
@@ -0,0 +1,82 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.BlockDataList (BlockDataList(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockData as ProtocolBuffers (BlockData)++data BlockDataList = BlockDataList{blockdata :: !(P'.Seq ProtocolBuffers.BlockData)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable BlockDataList where+ mergeAppend (BlockDataList x'1) (BlockDataList y'1) = BlockDataList (P'.mergeAppend x'1 y'1)++instance P'.Default BlockDataList where+ defaultValue = BlockDataList P'.defaultValue++instance P'.Wire BlockDataList where+ wireSize ft' self'@(BlockDataList x'1)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeRep 1 11 x'1)+ wirePutWithSize ft' self'@(BlockDataList x'1)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutRepWithSize 2 11 x'1]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{blockdata = P'.append (blockdata old'Self) new'Field}) (P'.wireGet 11)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> BlockDataList) BlockDataList where+ getVal m' f' = f' m'++instance P'.GPB BlockDataList++instance P'.ReflectDescriptor BlockDataList where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList []) (P'.fromDistinctAscList [2])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockDataList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockDataList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockDataList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockDataList.blockdata\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockDataList\"], baseName' = FName \"blockdata\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockData\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockData\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType BlockDataList where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg BlockDataList where+ textPut msg+ = do+ P'.tellT "blockdata" (blockdata msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'blockdata]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'blockdata+ = P'.try+ (do+ v <- P'.getT "blockdata"+ Prelude'.return (\ o -> o{blockdata = P'.append (blockdata o) v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/BlockRef.hs view
@@ -0,0 +1,110 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.BlockRef (BlockRef(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockRef.Block_ref as ProtocolBuffers.BlockRef (Block_ref)+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockRef.Block_ref as ProtocolBuffers.BlockRef.Block_ref+ (Block_ref(..), get'block, get'mempool)++data BlockRef = BlockRef{block_ref :: P'.Maybe (ProtocolBuffers.BlockRef.Block_ref)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable BlockRef where+ mergeAppend (BlockRef x'1) (BlockRef y'1) = BlockRef (P'.mergeAppend x'1 y'1)++instance P'.Default BlockRef where+ defaultValue = BlockRef P'.defaultValue++instance P'.Wire BlockRef where+ wireSize ft' self'@(BlockRef x'1)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size+ = (P'.wireSizeOpt 1 11 (ProtocolBuffers.BlockRef.Block_ref.get'block Prelude'.=<< x'1) ++ P'.wireSizeOpt 1 11 (ProtocolBuffers.BlockRef.Block_ref.get'mempool Prelude'.=<< x'1))+ wirePutWithSize ft' self'@(BlockRef x'1)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields+ = P'.sequencePutWithSize+ [P'.wirePutOptWithSize 2 11 (ProtocolBuffers.BlockRef.Block_ref.get'block Prelude'.=<< x'1),+ P'.wirePutOptWithSize 10 11 (ProtocolBuffers.BlockRef.Block_ref.get'mempool Prelude'.=<< x'1)]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap+ (\ !new'Field ->+ old'Self{block_ref =+ P'.mergeAppend (block_ref old'Self)+ (Prelude'.Just (ProtocolBuffers.BlockRef.Block_ref.Block new'Field))})+ (P'.wireGet 11)+ 10 -> Prelude'.fmap+ (\ !new'Field ->+ old'Self{block_ref =+ P'.mergeAppend (block_ref old'Self)+ (Prelude'.Just (ProtocolBuffers.BlockRef.Block_ref.Mempool new'Field))})+ (P'.wireGet 11)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> BlockRef) BlockRef where+ getVal m' f' = f' m'++instance P'.GPB BlockRef++instance P'.ReflectDescriptor BlockRef where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList []) (P'.fromDistinctAscList [])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockRef\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockRef.hs\"], isGroup = False, fields = fromList [], descOneofs = fromList [OneofInfo {oneofName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.block_ref\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName = MName \"Block_ref\"}, oneofFName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockRef.block_ref\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName' = FName \"block_ref\", baseNamePrefix' = \"\"}, oneofFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockRef\",\"Block_ref.hs\"], oneofFields = fromList [(ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.block_ref.block\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block_ref\"], baseName = MName \"Block\"},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockRef.block_ref.block\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block_ref\"], baseName' = FName \"block\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.Block\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName = MName \"Block\"}), hsRawDefault = Nothing, hsDefault = Nothing}),(ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.block_ref.mempool\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block_ref\"], baseName = MName \"Mempool\"},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockRef.block_ref.mempool\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block_ref\"], baseName' = FName \"mempool\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.Mempool\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName = MName \"Mempool\"}), hsRawDefault = Nothing, hsDefault = Nothing})], oneofMakeLenses = False}], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType BlockRef where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg BlockRef where+ textPut msg+ = do+ case (block_ref msg) of+ Prelude'.Just (ProtocolBuffers.BlockRef.Block_ref.Block block) -> P'.tellT "block" block+ Prelude'.Just (ProtocolBuffers.BlockRef.Block_ref.Mempool mempool) -> P'.tellT "mempool" mempool+ Prelude'.Nothing -> Prelude'.return ()+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'block_ref]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'block_ref = P'.try (P'.choice [parse'block, parse'mempool])+ where+ parse'block+ = P'.try+ (do+ v <- P'.getT "block"+ Prelude'.return (\ s -> s{block_ref = Prelude'.Just (ProtocolBuffers.BlockRef.Block_ref.Block v)}))+ parse'mempool+ = P'.try+ (do+ v <- P'.getT "mempool"+ Prelude'.return (\ s -> s{block_ref = Prelude'.Just (ProtocolBuffers.BlockRef.Block_ref.Mempool v)}))
+ src/Network/Haskoin/Store/ProtocolBuffers/BlockRef/Block.hs view
@@ -0,0 +1,88 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.BlockRef.Block (Block(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'++data Block = Block{height :: !(P'.Word32), position :: !(P'.Word32)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable Block where+ mergeAppend (Block x'1 x'2) (Block y'1 y'2) = Block (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2)++instance P'.Default Block where+ defaultValue = Block P'.defaultValue P'.defaultValue++instance P'.Wire Block where+ wireSize ft' self'@(Block x'1 x'2)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeReq 1 13 x'1 + P'.wireSizeReq 1 13 x'2)+ wirePutWithSize ft' self'@(Block x'1 x'2)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutReqWithSize 0 13 x'1, P'.wirePutReqWithSize 8 13 x'2]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 0 -> Prelude'.fmap (\ !new'Field -> old'Self{height = new'Field}) (P'.wireGet 13)+ 8 -> Prelude'.fmap (\ !new'Field -> old'Self{position = new'Field}) (P'.wireGet 13)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> Block) Block where+ getVal m' f' = f' m'++instance P'.GPB Block++instance P'.ReflectDescriptor Block where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList [0, 8]) (P'.fromDistinctAscList [0, 8])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.Block\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName = MName \"Block\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockRef\",\"Block.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockRef.Block.height\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block\"], baseName' = FName \"height\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 0}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockRef.Block.position\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Block\"], baseName' = FName \"position\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType Block where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg Block where+ textPut msg+ = do+ P'.tellT "height" (height msg)+ P'.tellT "position" (position msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'height, parse'position]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'height+ = P'.try+ (do+ v <- P'.getT "height"+ Prelude'.return (\ o -> o{height = v}))+ parse'position+ = P'.try+ (do+ v <- P'.getT "position"+ Prelude'.return (\ o -> o{position = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/BlockRef/Block_ref.hs view
@@ -0,0 +1,28 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.BlockRef.Block_ref where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockRef.Block as ProtocolBuffers.BlockRef (Block)+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockRef.Mempool as ProtocolBuffers.BlockRef (Mempool)++data Block_ref = Block{block :: (ProtocolBuffers.BlockRef.Block)}+ | Mempool{mempool :: (ProtocolBuffers.BlockRef.Mempool)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)+get'block x+ = case x of+ Block block -> Prelude'.Just block+ _ -> Prelude'.Nothing+get'mempool x+ = case x of+ Mempool mempool -> Prelude'.Just mempool+ _ -> Prelude'.Nothing++instance P'.Default Block_ref where+ defaultValue = Block P'.defaultValue++instance P'.Mergeable Block_ref
+ src/Network/Haskoin/Store/ProtocolBuffers/BlockRef/Mempool.hs view
@@ -0,0 +1,81 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.BlockRef.Mempool (Mempool(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'++data Mempool = Mempool{mempool :: !(P'.Word64)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable Mempool where+ mergeAppend (Mempool x'1) (Mempool y'1) = Mempool (P'.mergeAppend x'1 y'1)++instance P'.Default Mempool where+ defaultValue = Mempool P'.defaultValue++instance P'.Wire Mempool where+ wireSize ft' self'@(Mempool x'1)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeReq 1 4 x'1)+ wirePutWithSize ft' self'@(Mempool x'1)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutReqWithSize 0 4 x'1]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 0 -> Prelude'.fmap (\ !new'Field -> old'Self{mempool = new'Field}) (P'.wireGet 4)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> Mempool) Mempool where+ getVal m' f' = f' m'++instance P'.GPB Mempool++instance P'.ReflectDescriptor Mempool where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList [0]) (P'.fromDistinctAscList [0])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef.Mempool\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"BlockRef\"], baseName = MName \"Mempool\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockRef\",\"Mempool.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockRef.Mempool.mempool\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockRef\",MName \"Mempool\"], baseName' = FName \"mempool\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 0}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType Mempool where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg Mempool where+ textPut msg+ = do+ P'.tellT "mempool" (mempool msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'mempool]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'mempool+ = P'.try+ (do+ v <- P'.getT "mempool"+ Prelude'.return (\ o -> o{mempool = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/BlockTx.hs view
@@ -0,0 +1,89 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.BlockTx (BlockTx(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockRef as ProtocolBuffers (BlockRef)++data BlockTx = BlockTx{block :: !(ProtocolBuffers.BlockRef), txid :: !(P'.ByteString)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable BlockTx where+ mergeAppend (BlockTx x'1 x'2) (BlockTx y'1 y'2) = BlockTx (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2)++instance P'.Default BlockTx where+ defaultValue = BlockTx P'.defaultValue P'.defaultValue++instance P'.Wire BlockTx where+ wireSize ft' self'@(BlockTx x'1 x'2)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeReq 1 11 x'1 + P'.wireSizeReq 1 12 x'2)+ wirePutWithSize ft' self'@(BlockTx x'1 x'2)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutReqWithSize 2 11 x'1, P'.wirePutReqWithSize 10 12 x'2]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{block = P'.mergeAppend (block old'Self) (new'Field)}) (P'.wireGet 11)+ 10 -> Prelude'.fmap (\ !new'Field -> old'Self{txid = new'Field}) (P'.wireGet 12)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> BlockTx) BlockTx where+ getVal m' f' = f' m'++instance P'.GPB BlockTx++instance P'.ReflectDescriptor BlockTx where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList [2, 10]) (P'.fromDistinctAscList [2, 10])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockTx\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockTx\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockTx.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockTx.block\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockTx\"], baseName' = FName \"block\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockRef\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockTx.txid\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockTx\"], baseName' = FName \"txid\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType BlockTx where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg BlockTx where+ textPut msg+ = do+ P'.tellT "block" (block msg)+ P'.tellT "txid" (txid msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'block, parse'txid]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'block+ = P'.try+ (do+ v <- P'.getT "block"+ Prelude'.return (\ o -> o{block = v}))+ parse'txid+ = P'.try+ (do+ v <- P'.getT "txid"+ Prelude'.return (\ o -> o{txid = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/BlockTxList.hs view
@@ -0,0 +1,82 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.BlockTxList (BlockTxList(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockTx as ProtocolBuffers (BlockTx)++data BlockTxList = BlockTxList{blocktx :: !(P'.Seq ProtocolBuffers.BlockTx)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable BlockTxList where+ mergeAppend (BlockTxList x'1) (BlockTxList y'1) = BlockTxList (P'.mergeAppend x'1 y'1)++instance P'.Default BlockTxList where+ defaultValue = BlockTxList P'.defaultValue++instance P'.Wire BlockTxList where+ wireSize ft' self'@(BlockTxList x'1)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeRep 1 11 x'1)+ wirePutWithSize ft' self'@(BlockTxList x'1)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutRepWithSize 2 11 x'1]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{blocktx = P'.append (blocktx old'Self) new'Field}) (P'.wireGet 11)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> BlockTxList) BlockTxList where+ getVal m' f' = f' m'++instance P'.GPB BlockTxList++instance P'.ReflectDescriptor BlockTxList where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList []) (P'.fromDistinctAscList [2])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.BlockTxList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockTxList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"BlockTxList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.BlockTxList.blocktx\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"BlockTxList\"], baseName' = FName \"blocktx\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockTx\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockTx\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType BlockTxList where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg BlockTxList where+ textPut msg+ = do+ P'.tellT "blocktx" (blocktx msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'blocktx]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'blocktx+ = P'.try+ (do+ v <- P'.getT "blocktx"+ Prelude'.return (\ o -> o{blocktx = P'.append (blocktx o) v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/Event.hs view
@@ -0,0 +1,89 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.Event (Event(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.Event.Type as ProtocolBuffers.Event (Type)++data Event = Event{type' :: !(ProtocolBuffers.Event.Type), id :: !(P'.ByteString)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable Event where+ mergeAppend (Event x'1 x'2) (Event y'1 y'2) = Event (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2)++instance P'.Default Event where+ defaultValue = Event P'.defaultValue P'.defaultValue++instance P'.Wire Event where+ wireSize ft' self'@(Event x'1 x'2)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeReq 1 14 x'1 + P'.wireSizeReq 1 12 x'2)+ wirePutWithSize ft' self'@(Event x'1 x'2)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutReqWithSize 0 14 x'1, P'.wirePutReqWithSize 10 12 x'2]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 0 -> Prelude'.fmap (\ !new'Field -> old'Self{type' = new'Field}) (P'.wireGet 14)+ 10 -> Prelude'.fmap (\ !new'Field -> old'Self{id = new'Field}) (P'.wireGet 12)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> Event) Event where+ getVal m' f' = f' m'++instance P'.GPB Event++instance P'.ReflectDescriptor Event where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList [0, 10]) (P'.fromDistinctAscList [0, 10])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Event\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Event\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Event.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Event.type\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Event\"], baseName' = FName \"type'\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 0}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Event.Type\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\",MName \"Event\"], baseName = MName \"Type\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Event.id\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Event\"], baseName' = FName \"id\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType Event where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg Event where+ textPut msg+ = do+ P'.tellT "type" (type' msg)+ P'.tellT "id" (id msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'type', parse'id]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'type'+ = P'.try+ (do+ v <- P'.getT "type"+ Prelude'.return (\ o -> o{type' = v}))+ parse'id+ = P'.try+ (do+ v <- P'.getT "id"+ Prelude'.return (\ o -> o{id = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/Event/Type.hs view
@@ -0,0 +1,65 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.Event.Type (Type(..)) where+import Prelude ((+), (/), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'++data Type = TX+ | BLOCK+ deriving (Prelude'.Read, Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable Type++instance Prelude'.Bounded Type where+ minBound = TX+ maxBound = BLOCK++instance P'.Default Type where+ defaultValue = TX++toMaybe'Enum :: Prelude'.Int -> P'.Maybe Type+toMaybe'Enum 0 = Prelude'.Just TX+toMaybe'Enum 1 = Prelude'.Just BLOCK+toMaybe'Enum _ = Prelude'.Nothing++instance Prelude'.Enum Type where+ fromEnum TX = 0+ fromEnum BLOCK = 1+ toEnum+ = P'.fromMaybe+ (Prelude'.error "hprotoc generated code: toEnum failure for type Network.Haskoin.Store.ProtocolBuffers.Event.Type")+ . toMaybe'Enum+ succ TX = BLOCK+ succ _ = Prelude'.error "hprotoc generated code: succ failure for type Network.Haskoin.Store.ProtocolBuffers.Event.Type"+ pred BLOCK = TX+ pred _ = Prelude'.error "hprotoc generated code: pred failure for type Network.Haskoin.Store.ProtocolBuffers.Event.Type"++instance P'.Wire Type where+ wireSize ft' enum = P'.wireSize ft' (Prelude'.fromEnum enum)+ wirePut ft' enum = P'.wirePut ft' (Prelude'.fromEnum enum)+ wireGet 14 = P'.wireGetEnum toMaybe'Enum+ wireGet ft' = P'.wireGetErr ft'+ wireGetPacked 14 = P'.wireGetPackedEnum toMaybe'Enum+ wireGetPacked ft' = P'.wireGetErr ft'++instance P'.GPB Type++instance P'.MessageAPI msg' (msg' -> Type) Type where+ getVal m' f' = f' m'++instance P'.ReflectEnum Type where+ reflectEnum = [(0, "TX", TX), (1, "BLOCK", BLOCK)]+ reflectEnumInfo _+ = P'.EnumInfo+ (P'.makePNF (P'.pack ".ProtocolBuffers.Event.Type") ["Network", "Haskoin", "Store"] ["ProtocolBuffers", "Event"] "Type")+ ["Network", "Haskoin", "Store", "ProtocolBuffers", "Event", "Type.hs"]+ [(0, "TX"), (1, "BLOCK")]+ Prelude'.False++instance P'.TextType Type where+ tellT = P'.tellShow+ getT = P'.getRead
+ src/Network/Haskoin/Store/ProtocolBuffers/EventList.hs view
@@ -0,0 +1,82 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.EventList (EventList(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.Event as ProtocolBuffers (Event)++data EventList = EventList{event :: !(P'.Seq ProtocolBuffers.Event)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable EventList where+ mergeAppend (EventList x'1) (EventList y'1) = EventList (P'.mergeAppend x'1 y'1)++instance P'.Default EventList where+ defaultValue = EventList P'.defaultValue++instance P'.Wire EventList where+ wireSize ft' self'@(EventList x'1)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeRep 1 11 x'1)+ wirePutWithSize ft' self'@(EventList x'1)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutRepWithSize 2 11 x'1]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{event = P'.append (event old'Self) new'Field}) (P'.wireGet 11)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> EventList) EventList where+ getVal m' f' = f' m'++instance P'.GPB EventList++instance P'.ReflectDescriptor EventList where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList []) (P'.fromDistinctAscList [2])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.EventList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"EventList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"EventList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.EventList.event\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"EventList\"], baseName' = FName \"event\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Event\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Event\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType EventList where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg EventList where+ textPut msg+ = do+ P'.tellT "event" (event msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'event]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'event+ = P'.try+ (do+ v <- P'.getT "event"+ Prelude'.return (\ o -> o{event = P'.append (event o) v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/HealthCheck.hs view
@@ -0,0 +1,164 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.HealthCheck (HealthCheck(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'++data HealthCheck = HealthCheck{ok :: !(P'.Bool), synced :: !(P'.Bool), version :: !(P'.Utf8), net :: !(P'.Utf8),+ peers :: !(P'.Maybe P'.Word32), headers_hash :: !(P'.Maybe P'.ByteString),+ headers_height :: !(P'.Maybe P'.Word32), blocks_hash :: !(P'.Maybe P'.ByteString),+ blocks_height :: !(P'.Maybe P'.Word32)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable HealthCheck where+ mergeAppend (HealthCheck x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9) (HealthCheck y'1 y'2 y'3 y'4 y'5 y'6 y'7 y'8 y'9)+ = HealthCheck (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)+ (P'.mergeAppend x'5 y'5)+ (P'.mergeAppend x'6 y'6)+ (P'.mergeAppend x'7 y'7)+ (P'.mergeAppend x'8 y'8)+ (P'.mergeAppend x'9 y'9)++instance P'.Default HealthCheck where+ defaultValue+ = HealthCheck P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue+ P'.defaultValue+ P'.defaultValue++instance P'.Wire HealthCheck where+ wireSize ft' self'@(HealthCheck x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size+ = (P'.wireSizeReq 1 8 x'1 + P'.wireSizeReq 1 8 x'2 + P'.wireSizeReq 1 9 x'3 + P'.wireSizeReq 1 9 x'4 ++ P'.wireSizeOpt 1 13 x'5+ + P'.wireSizeOpt 1 12 x'6+ + P'.wireSizeOpt 1 13 x'7+ + P'.wireSizeOpt 1 12 x'8+ + P'.wireSizeOpt 1 13 x'9)+ wirePutWithSize ft' self'@(HealthCheck x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields+ = P'.sequencePutWithSize+ [P'.wirePutReqWithSize 0 8 x'1, P'.wirePutReqWithSize 8 8 x'2, P'.wirePutReqWithSize 18 9 x'3,+ P'.wirePutReqWithSize 26 9 x'4, P'.wirePutOptWithSize 32 13 x'5, P'.wirePutOptWithSize 42 12 x'6,+ P'.wirePutOptWithSize 48 13 x'7, P'.wirePutOptWithSize 58 12 x'8, P'.wirePutOptWithSize 64 13 x'9]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 0 -> Prelude'.fmap (\ !new'Field -> old'Self{ok = new'Field}) (P'.wireGet 8)+ 8 -> Prelude'.fmap (\ !new'Field -> old'Self{synced = new'Field}) (P'.wireGet 8)+ 18 -> Prelude'.fmap (\ !new'Field -> old'Self{version = new'Field}) (P'.wireGet 9)+ 26 -> Prelude'.fmap (\ !new'Field -> old'Self{net = new'Field}) (P'.wireGet 9)+ 32 -> Prelude'.fmap (\ !new'Field -> old'Self{peers = Prelude'.Just new'Field}) (P'.wireGet 13)+ 42 -> Prelude'.fmap (\ !new'Field -> old'Self{headers_hash = Prelude'.Just new'Field}) (P'.wireGet 12)+ 48 -> Prelude'.fmap (\ !new'Field -> old'Self{headers_height = Prelude'.Just new'Field}) (P'.wireGet 13)+ 58 -> Prelude'.fmap (\ !new'Field -> old'Self{blocks_hash = Prelude'.Just new'Field}) (P'.wireGet 12)+ 64 -> Prelude'.fmap (\ !new'Field -> old'Self{blocks_height = Prelude'.Just new'Field}) (P'.wireGet 13)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> HealthCheck) HealthCheck where+ getVal m' f' = f' m'++instance P'.GPB HealthCheck++instance P'.ReflectDescriptor HealthCheck where+ getMessageInfo _+ = P'.GetMessageInfo (P'.fromDistinctAscList [0, 8, 18, 26]) (P'.fromDistinctAscList [0, 8, 18, 26, 32, 42, 48, 58, 64])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.HealthCheck\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"HealthCheck\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"HealthCheck.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.ok\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"ok\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 0}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.synced\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"synced\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.version\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"version\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.net\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"net\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.peers\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"peers\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 32}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.headers_hash\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"headers_hash\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 42}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.headers_height\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"headers_height\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 48}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.blocks_hash\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"blocks_hash\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 58}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.HealthCheck.blocks_height\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"HealthCheck\"], baseName' = FName \"blocks_height\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 64}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType HealthCheck where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg HealthCheck where+ textPut msg+ = do+ P'.tellT "ok" (ok msg)+ P'.tellT "synced" (synced msg)+ P'.tellT "version" (version msg)+ P'.tellT "net" (net msg)+ P'.tellT "peers" (peers msg)+ P'.tellT "headers_hash" (headers_hash msg)+ P'.tellT "headers_height" (headers_height msg)+ P'.tellT "blocks_hash" (blocks_hash msg)+ P'.tellT "blocks_height" (blocks_height msg)+ textGet+ = do+ mods <- P'.sepEndBy+ (P'.choice+ [parse'ok, parse'synced, parse'version, parse'net, parse'peers, parse'headers_hash, parse'headers_height,+ parse'blocks_hash, parse'blocks_height])+ P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'ok+ = P'.try+ (do+ v <- P'.getT "ok"+ Prelude'.return (\ o -> o{ok = v}))+ parse'synced+ = P'.try+ (do+ v <- P'.getT "synced"+ Prelude'.return (\ o -> o{synced = v}))+ parse'version+ = P'.try+ (do+ v <- P'.getT "version"+ Prelude'.return (\ o -> o{version = v}))+ parse'net+ = P'.try+ (do+ v <- P'.getT "net"+ Prelude'.return (\ o -> o{net = v}))+ parse'peers+ = P'.try+ (do+ v <- P'.getT "peers"+ Prelude'.return (\ o -> o{peers = v}))+ parse'headers_hash+ = P'.try+ (do+ v <- P'.getT "headers_hash"+ Prelude'.return (\ o -> o{headers_hash = v}))+ parse'headers_height+ = P'.try+ (do+ v <- P'.getT "headers_height"+ Prelude'.return (\ o -> o{headers_height = v}))+ parse'blocks_hash+ = P'.try+ (do+ v <- P'.getT "blocks_hash"+ Prelude'.return (\ o -> o{blocks_hash = v}))+ parse'blocks_height+ = P'.try+ (do+ v <- P'.getT "blocks_height"+ Prelude'.return (\ o -> o{blocks_height = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/Input.hs view
@@ -0,0 +1,163 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.Input (Input(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'++data Input = Input{coinbase :: !(P'.Bool), txid :: !(P'.ByteString), output :: !(P'.Word32), sigscript :: !(P'.ByteString),+ sequence :: !(P'.Word32), witness :: !(P'.Seq P'.ByteString), value :: !(P'.Maybe P'.Word64),+ pkscript :: !(P'.Maybe P'.ByteString), address :: !(P'.Maybe P'.Utf8)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable Input where+ mergeAppend (Input x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9) (Input y'1 y'2 y'3 y'4 y'5 y'6 y'7 y'8 y'9)+ = Input (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)+ (P'.mergeAppend x'5 y'5)+ (P'.mergeAppend x'6 y'6)+ (P'.mergeAppend x'7 y'7)+ (P'.mergeAppend x'8 y'8)+ (P'.mergeAppend x'9 y'9)++instance P'.Default Input where+ defaultValue+ = Input P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue+ P'.defaultValue+ P'.defaultValue++instance P'.Wire Input where+ wireSize ft' self'@(Input x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size+ = (P'.wireSizeReq 1 8 x'1 + P'.wireSizeReq 1 12 x'2 + P'.wireSizeReq 1 13 x'3 + P'.wireSizeReq 1 12 x'4 ++ P'.wireSizeReq 1 13 x'5+ + P'.wireSizeRep 1 12 x'6+ + P'.wireSizeOpt 1 4 x'7+ + P'.wireSizeOpt 1 12 x'8+ + P'.wireSizeOpt 1 9 x'9)+ wirePutWithSize ft' self'@(Input x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields+ = P'.sequencePutWithSize+ [P'.wirePutReqWithSize 0 8 x'1, P'.wirePutReqWithSize 10 12 x'2, P'.wirePutReqWithSize 16 13 x'3,+ P'.wirePutReqWithSize 26 12 x'4, P'.wirePutReqWithSize 32 13 x'5, P'.wirePutRepWithSize 42 12 x'6,+ P'.wirePutOptWithSize 48 4 x'7, P'.wirePutOptWithSize 58 12 x'8, P'.wirePutOptWithSize 66 9 x'9]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 0 -> Prelude'.fmap (\ !new'Field -> old'Self{coinbase = new'Field}) (P'.wireGet 8)+ 10 -> Prelude'.fmap (\ !new'Field -> old'Self{txid = new'Field}) (P'.wireGet 12)+ 16 -> Prelude'.fmap (\ !new'Field -> old'Self{output = new'Field}) (P'.wireGet 13)+ 26 -> Prelude'.fmap (\ !new'Field -> old'Self{sigscript = new'Field}) (P'.wireGet 12)+ 32 -> Prelude'.fmap (\ !new'Field -> old'Self{sequence = new'Field}) (P'.wireGet 13)+ 42 -> Prelude'.fmap (\ !new'Field -> old'Self{witness = P'.append (witness old'Self) new'Field}) (P'.wireGet 12)+ 48 -> Prelude'.fmap (\ !new'Field -> old'Self{value = Prelude'.Just new'Field}) (P'.wireGet 4)+ 58 -> Prelude'.fmap (\ !new'Field -> old'Self{pkscript = Prelude'.Just new'Field}) (P'.wireGet 12)+ 66 -> Prelude'.fmap (\ !new'Field -> old'Self{address = Prelude'.Just new'Field}) (P'.wireGet 9)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> Input) Input where+ getVal m' f' = f' m'++instance P'.GPB Input++instance P'.ReflectDescriptor Input where+ getMessageInfo _+ = P'.GetMessageInfo (P'.fromDistinctAscList [0, 10, 16, 26, 32]) (P'.fromDistinctAscList [0, 10, 16, 26, 32, 42, 48, 58, 66])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Input\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Input\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Input.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.coinbase\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"coinbase\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 0}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.txid\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"txid\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.output\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"output\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.sigscript\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"sigscript\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.sequence\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"sequence\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 32}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.witness\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"witness\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 42}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.value\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"value\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 48}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.pkscript\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"pkscript\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 58}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Input.address\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Input\"], baseName' = FName \"address\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 66}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType Input where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg Input where+ textPut msg+ = do+ P'.tellT "coinbase" (coinbase msg)+ P'.tellT "txid" (txid msg)+ P'.tellT "output" (output msg)+ P'.tellT "sigscript" (sigscript msg)+ P'.tellT "sequence" (sequence msg)+ P'.tellT "witness" (witness msg)+ P'.tellT "value" (value msg)+ P'.tellT "pkscript" (pkscript msg)+ P'.tellT "address" (address msg)+ textGet+ = do+ mods <- P'.sepEndBy+ (P'.choice+ [parse'coinbase, parse'txid, parse'output, parse'sigscript, parse'sequence, parse'witness, parse'value,+ parse'pkscript, parse'address])+ P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'coinbase+ = P'.try+ (do+ v <- P'.getT "coinbase"+ Prelude'.return (\ o -> o{coinbase = v}))+ parse'txid+ = P'.try+ (do+ v <- P'.getT "txid"+ Prelude'.return (\ o -> o{txid = v}))+ parse'output+ = P'.try+ (do+ v <- P'.getT "output"+ Prelude'.return (\ o -> o{output = v}))+ parse'sigscript+ = P'.try+ (do+ v <- P'.getT "sigscript"+ Prelude'.return (\ o -> o{sigscript = v}))+ parse'sequence+ = P'.try+ (do+ v <- P'.getT "sequence"+ Prelude'.return (\ o -> o{sequence = v}))+ parse'witness+ = P'.try+ (do+ v <- P'.getT "witness"+ Prelude'.return (\ o -> o{witness = P'.append (witness o) v}))+ parse'value+ = P'.try+ (do+ v <- P'.getT "value"+ Prelude'.return (\ o -> o{value = v}))+ parse'pkscript+ = P'.try+ (do+ v <- P'.getT "pkscript"+ Prelude'.return (\ o -> o{pkscript = v}))+ parse'address+ = P'.try+ (do+ v <- P'.getT "address"+ Prelude'.return (\ o -> o{address = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/Output.hs view
@@ -0,0 +1,109 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.Output (Output(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.Spender as ProtocolBuffers (Spender)++data Output = Output{pkscript :: !(P'.ByteString), value :: !(P'.Word64), address :: !(P'.Maybe P'.Utf8),+ spender :: !(P'.Maybe ProtocolBuffers.Spender)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable Output where+ mergeAppend (Output x'1 x'2 x'3 x'4) (Output y'1 y'2 y'3 y'4)+ = Output (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)++instance P'.Default Output where+ defaultValue = Output P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue++instance P'.Wire Output where+ wireSize ft' self'@(Output x'1 x'2 x'3 x'4)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeReq 1 12 x'1 + P'.wireSizeReq 1 4 x'2 + P'.wireSizeOpt 1 9 x'3 + P'.wireSizeOpt 1 11 x'4)+ wirePutWithSize ft' self'@(Output x'1 x'2 x'3 x'4)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields+ = P'.sequencePutWithSize+ [P'.wirePutReqWithSize 2 12 x'1, P'.wirePutReqWithSize 8 4 x'2, P'.wirePutOptWithSize 18 9 x'3,+ P'.wirePutOptWithSize 26 11 x'4]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{pkscript = new'Field}) (P'.wireGet 12)+ 8 -> Prelude'.fmap (\ !new'Field -> old'Self{value = new'Field}) (P'.wireGet 4)+ 18 -> Prelude'.fmap (\ !new'Field -> old'Self{address = Prelude'.Just new'Field}) (P'.wireGet 9)+ 26 -> Prelude'.fmap (\ !new'Field -> old'Self{spender = P'.mergeAppend (spender old'Self) (Prelude'.Just new'Field)})+ (P'.wireGet 11)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> Output) Output where+ getVal m' f' = f' m'++instance P'.GPB Output++instance P'.ReflectDescriptor Output where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList [2, 8]) (P'.fromDistinctAscList [2, 8, 18, 26])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Output\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Output\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Output.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Output.pkscript\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Output\"], baseName' = FName \"pkscript\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Output.value\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Output\"], baseName' = FName \"value\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Output.address\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Output\"], baseName' = FName \"address\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Output.spender\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Output\"], baseName' = FName \"spender\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Spender\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Spender\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType Output where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg Output where+ textPut msg+ = do+ P'.tellT "pkscript" (pkscript msg)+ P'.tellT "value" (value msg)+ P'.tellT "address" (address msg)+ P'.tellT "spender" (spender msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'pkscript, parse'value, parse'address, parse'spender]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'pkscript+ = P'.try+ (do+ v <- P'.getT "pkscript"+ Prelude'.return (\ o -> o{pkscript = v}))+ parse'value+ = P'.try+ (do+ v <- P'.getT "value"+ Prelude'.return (\ o -> o{value = v}))+ parse'address+ = P'.try+ (do+ v <- P'.getT "address"+ Prelude'.return (\ o -> o{address = v}))+ parse'spender+ = P'.try+ (do+ v <- P'.getT "spender"+ Prelude'.return (\ o -> o{spender = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/Peer.hs view
@@ -0,0 +1,117 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.Peer (Peer(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'++data Peer = Peer{useragent :: !(P'.Utf8), address :: !(P'.Utf8), version :: !(P'.Word32), services :: !(P'.Word64),+ relay :: !(P'.Bool)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable Peer where+ mergeAppend (Peer x'1 x'2 x'3 x'4 x'5) (Peer y'1 y'2 y'3 y'4 y'5)+ = Peer (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)+ (P'.mergeAppend x'5 y'5)++instance P'.Default Peer where+ defaultValue = Peer P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue++instance P'.Wire Peer where+ wireSize ft' self'@(Peer x'1 x'2 x'3 x'4 x'5)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size+ = (P'.wireSizeReq 1 9 x'1 + P'.wireSizeReq 1 9 x'2 + P'.wireSizeReq 1 13 x'3 + P'.wireSizeReq 1 4 x'4 ++ P'.wireSizeReq 1 8 x'5)+ wirePutWithSize ft' self'@(Peer x'1 x'2 x'3 x'4 x'5)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields+ = P'.sequencePutWithSize+ [P'.wirePutReqWithSize 2 9 x'1, P'.wirePutReqWithSize 10 9 x'2, P'.wirePutReqWithSize 16 13 x'3,+ P'.wirePutReqWithSize 24 4 x'4, P'.wirePutReqWithSize 32 8 x'5]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{useragent = new'Field}) (P'.wireGet 9)+ 10 -> Prelude'.fmap (\ !new'Field -> old'Self{address = new'Field}) (P'.wireGet 9)+ 16 -> Prelude'.fmap (\ !new'Field -> old'Self{version = new'Field}) (P'.wireGet 13)+ 24 -> Prelude'.fmap (\ !new'Field -> old'Self{services = new'Field}) (P'.wireGet 4)+ 32 -> Prelude'.fmap (\ !new'Field -> old'Self{relay = new'Field}) (P'.wireGet 8)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> Peer) Peer where+ getVal m' f' = f' m'++instance P'.GPB Peer++instance P'.ReflectDescriptor Peer where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList [2, 10, 16, 24, 32]) (P'.fromDistinctAscList [2, 10, 16, 24, 32])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Peer\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Peer\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Peer.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Peer.useragent\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Peer\"], baseName' = FName \"useragent\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Peer.address\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Peer\"], baseName' = FName \"address\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Peer.version\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Peer\"], baseName' = FName \"version\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Peer.services\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Peer\"], baseName' = FName \"services\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Peer.relay\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Peer\"], baseName' = FName \"relay\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 32}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType Peer where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg Peer where+ textPut msg+ = do+ P'.tellT "useragent" (useragent msg)+ P'.tellT "address" (address msg)+ P'.tellT "version" (version msg)+ P'.tellT "services" (services msg)+ P'.tellT "relay" (relay msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'useragent, parse'address, parse'version, parse'services, parse'relay]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'useragent+ = P'.try+ (do+ v <- P'.getT "useragent"+ Prelude'.return (\ o -> o{useragent = v}))+ parse'address+ = P'.try+ (do+ v <- P'.getT "address"+ Prelude'.return (\ o -> o{address = v}))+ parse'version+ = P'.try+ (do+ v <- P'.getT "version"+ Prelude'.return (\ o -> o{version = v}))+ parse'services+ = P'.try+ (do+ v <- P'.getT "services"+ Prelude'.return (\ o -> o{services = v}))+ parse'relay+ = P'.try+ (do+ v <- P'.getT "relay"+ Prelude'.return (\ o -> o{relay = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/PeerList.hs view
@@ -0,0 +1,82 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.PeerList (PeerList(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.Peer as ProtocolBuffers (Peer)++data PeerList = PeerList{peer :: !(P'.Seq ProtocolBuffers.Peer)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable PeerList where+ mergeAppend (PeerList x'1) (PeerList y'1) = PeerList (P'.mergeAppend x'1 y'1)++instance P'.Default PeerList where+ defaultValue = PeerList P'.defaultValue++instance P'.Wire PeerList where+ wireSize ft' self'@(PeerList x'1)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeRep 1 11 x'1)+ wirePutWithSize ft' self'@(PeerList x'1)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutRepWithSize 2 11 x'1]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{peer = P'.append (peer old'Self) new'Field}) (P'.wireGet 11)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> PeerList) PeerList where+ getVal m' f' = f' m'++instance P'.GPB PeerList++instance P'.ReflectDescriptor PeerList where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList []) (P'.fromDistinctAscList [2])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.PeerList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"PeerList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"PeerList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.PeerList.peer\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"PeerList\"], baseName' = FName \"peer\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Peer\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Peer\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType PeerList where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg PeerList where+ textPut msg+ = do+ P'.tellT "peer" (peer msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'peer]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'peer+ = P'.try+ (do+ v <- P'.getT "peer"+ Prelude'.return (\ o -> o{peer = P'.append (peer o) v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/Spender.hs view
@@ -0,0 +1,88 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.Spender (Spender(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'++data Spender = Spender{txid :: !(P'.ByteString), input :: !(P'.Word32)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable Spender where+ mergeAppend (Spender x'1 x'2) (Spender y'1 y'2) = Spender (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2)++instance P'.Default Spender where+ defaultValue = Spender P'.defaultValue P'.defaultValue++instance P'.Wire Spender where+ wireSize ft' self'@(Spender x'1 x'2)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeReq 1 12 x'1 + P'.wireSizeReq 1 13 x'2)+ wirePutWithSize ft' self'@(Spender x'1 x'2)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutReqWithSize 2 12 x'1, P'.wirePutReqWithSize 8 13 x'2]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{txid = new'Field}) (P'.wireGet 12)+ 8 -> Prelude'.fmap (\ !new'Field -> old'Self{input = new'Field}) (P'.wireGet 13)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> Spender) Spender where+ getVal m' f' = f' m'++instance P'.GPB Spender++instance P'.ReflectDescriptor Spender where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList [2, 8]) (P'.fromDistinctAscList [2, 8])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Spender\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Spender\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Spender.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Spender.txid\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Spender\"], baseName' = FName \"txid\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Spender.input\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Spender\"], baseName' = FName \"input\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType Spender where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg Spender where+ textPut msg+ = do+ P'.tellT "txid" (txid msg)+ P'.tellT "input" (input msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'txid, parse'input]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'txid+ = P'.try+ (do+ v <- P'.getT "txid"+ Prelude'.return (\ o -> o{txid = v}))+ parse'input+ = P'.try+ (do+ v <- P'.getT "input"+ Prelude'.return (\ o -> o{input = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/Transaction.hs view
@@ -0,0 +1,200 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.Transaction (Transaction(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockRef as ProtocolBuffers (BlockRef)+import qualified Network.Haskoin.Store.ProtocolBuffers.Input as ProtocolBuffers (Input)+import qualified Network.Haskoin.Store.ProtocolBuffers.Output as ProtocolBuffers (Output)++data Transaction = Transaction{txid :: !(P'.ByteString), size :: !(P'.Word32), version :: !(P'.Word32), locktime :: !(P'.Word32),+ block :: !(ProtocolBuffers.BlockRef), deleted :: !(P'.Bool), fee :: !(P'.Word64),+ time :: !(P'.Word64), rbf :: !(P'.Bool), inputs :: !(P'.Seq ProtocolBuffers.Input),+ outputs :: !(P'.Seq ProtocolBuffers.Output), weight :: !(P'.Maybe P'.Word32)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable Transaction where+ mergeAppend (Transaction x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9 x'10 x'11 x'12)+ (Transaction y'1 y'2 y'3 y'4 y'5 y'6 y'7 y'8 y'9 y'10 y'11 y'12)+ = Transaction (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)+ (P'.mergeAppend x'5 y'5)+ (P'.mergeAppend x'6 y'6)+ (P'.mergeAppend x'7 y'7)+ (P'.mergeAppend x'8 y'8)+ (P'.mergeAppend x'9 y'9)+ (P'.mergeAppend x'10 y'10)+ (P'.mergeAppend x'11 y'11)+ (P'.mergeAppend x'12 y'12)++instance P'.Default Transaction where+ defaultValue+ = Transaction P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue+ P'.defaultValue+ P'.defaultValue+ P'.defaultValue+ P'.defaultValue+ P'.defaultValue++instance P'.Wire Transaction where+ wireSize ft' self'@(Transaction x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9 x'10 x'11 x'12)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size+ = (P'.wireSizeReq 1 12 x'1 + P'.wireSizeReq 1 13 x'2 + P'.wireSizeReq 1 13 x'3 + P'.wireSizeReq 1 13 x'4 ++ P'.wireSizeReq 1 11 x'5+ + P'.wireSizeReq 1 8 x'6+ + P'.wireSizeReq 1 4 x'7+ + P'.wireSizeReq 1 4 x'8+ + P'.wireSizeReq 1 8 x'9+ + P'.wireSizeRep 1 11 x'10+ + P'.wireSizeRep 1 11 x'11+ + P'.wireSizeOpt 1 13 x'12)+ wirePutWithSize ft' self'@(Transaction x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9 x'10 x'11 x'12)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields+ = P'.sequencePutWithSize+ [P'.wirePutReqWithSize 2 12 x'1, P'.wirePutReqWithSize 8 13 x'2, P'.wirePutReqWithSize 16 13 x'3,+ P'.wirePutReqWithSize 24 13 x'4, P'.wirePutReqWithSize 34 11 x'5, P'.wirePutReqWithSize 40 8 x'6,+ P'.wirePutReqWithSize 48 4 x'7, P'.wirePutReqWithSize 56 4 x'8, P'.wirePutReqWithSize 64 8 x'9,+ P'.wirePutRepWithSize 74 11 x'10, P'.wirePutRepWithSize 82 11 x'11, P'.wirePutOptWithSize 88 13 x'12]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{txid = new'Field}) (P'.wireGet 12)+ 8 -> Prelude'.fmap (\ !new'Field -> old'Self{size = new'Field}) (P'.wireGet 13)+ 16 -> Prelude'.fmap (\ !new'Field -> old'Self{version = new'Field}) (P'.wireGet 13)+ 24 -> Prelude'.fmap (\ !new'Field -> old'Self{locktime = new'Field}) (P'.wireGet 13)+ 34 -> Prelude'.fmap (\ !new'Field -> old'Self{block = P'.mergeAppend (block old'Self) (new'Field)}) (P'.wireGet 11)+ 40 -> Prelude'.fmap (\ !new'Field -> old'Self{deleted = new'Field}) (P'.wireGet 8)+ 48 -> Prelude'.fmap (\ !new'Field -> old'Self{fee = new'Field}) (P'.wireGet 4)+ 56 -> Prelude'.fmap (\ !new'Field -> old'Self{time = new'Field}) (P'.wireGet 4)+ 64 -> Prelude'.fmap (\ !new'Field -> old'Self{rbf = new'Field}) (P'.wireGet 8)+ 74 -> Prelude'.fmap (\ !new'Field -> old'Self{inputs = P'.append (inputs old'Self) new'Field}) (P'.wireGet 11)+ 82 -> Prelude'.fmap (\ !new'Field -> old'Self{outputs = P'.append (outputs old'Self) new'Field}) (P'.wireGet 11)+ 88 -> Prelude'.fmap (\ !new'Field -> old'Self{weight = Prelude'.Just new'Field}) (P'.wireGet 13)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> Transaction) Transaction where+ getVal m' f' = f' m'++instance P'.GPB Transaction++instance P'.ReflectDescriptor Transaction where+ getMessageInfo _+ = P'.GetMessageInfo (P'.fromDistinctAscList [2, 8, 16, 24, 34, 40, 48, 56, 64])+ (P'.fromDistinctAscList [2, 8, 16, 24, 34, 40, 48, 56, 64, 74, 82, 88])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Transaction\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Transaction\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Transaction.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.txid\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"txid\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.size\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"size\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.version\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"version\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.locktime\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"locktime\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.block\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"block\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 34}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockRef\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.deleted\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"deleted\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 40}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.fee\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"fee\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 48}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.time\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"time\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 56}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.rbf\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"rbf\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 64}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.inputs\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"inputs\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 9}, wireTag = WireTag {getWireTag = 74}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Input\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Input\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.outputs\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"outputs\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 10}, wireTag = WireTag {getWireTag = 82}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Output\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Output\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Transaction.weight\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Transaction\"], baseName' = FName \"weight\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 11}, wireTag = WireTag {getWireTag = 88}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType Transaction where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg Transaction where+ textPut msg+ = do+ P'.tellT "txid" (txid msg)+ P'.tellT "size" (size msg)+ P'.tellT "version" (version msg)+ P'.tellT "locktime" (locktime msg)+ P'.tellT "block" (block msg)+ P'.tellT "deleted" (deleted msg)+ P'.tellT "fee" (fee msg)+ P'.tellT "time" (time msg)+ P'.tellT "rbf" (rbf msg)+ P'.tellT "inputs" (inputs msg)+ P'.tellT "outputs" (outputs msg)+ P'.tellT "weight" (weight msg)+ textGet+ = do+ mods <- P'.sepEndBy+ (P'.choice+ [parse'txid, parse'size, parse'version, parse'locktime, parse'block, parse'deleted, parse'fee, parse'time,+ parse'rbf, parse'inputs, parse'outputs, parse'weight])+ P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'txid+ = P'.try+ (do+ v <- P'.getT "txid"+ Prelude'.return (\ o -> o{txid = v}))+ parse'size+ = P'.try+ (do+ v <- P'.getT "size"+ Prelude'.return (\ o -> o{size = v}))+ parse'version+ = P'.try+ (do+ v <- P'.getT "version"+ Prelude'.return (\ o -> o{version = v}))+ parse'locktime+ = P'.try+ (do+ v <- P'.getT "locktime"+ Prelude'.return (\ o -> o{locktime = v}))+ parse'block+ = P'.try+ (do+ v <- P'.getT "block"+ Prelude'.return (\ o -> o{block = v}))+ parse'deleted+ = P'.try+ (do+ v <- P'.getT "deleted"+ Prelude'.return (\ o -> o{deleted = v}))+ parse'fee+ = P'.try+ (do+ v <- P'.getT "fee"+ Prelude'.return (\ o -> o{fee = v}))+ parse'time+ = P'.try+ (do+ v <- P'.getT "time"+ Prelude'.return (\ o -> o{time = v}))+ parse'rbf+ = P'.try+ (do+ v <- P'.getT "rbf"+ Prelude'.return (\ o -> o{rbf = v}))+ parse'inputs+ = P'.try+ (do+ v <- P'.getT "inputs"+ Prelude'.return (\ o -> o{inputs = P'.append (inputs o) v}))+ parse'outputs+ = P'.try+ (do+ v <- P'.getT "outputs"+ Prelude'.return (\ o -> o{outputs = P'.append (outputs o) v}))+ parse'weight+ = P'.try+ (do+ v <- P'.getT "weight"+ Prelude'.return (\ o -> o{weight = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/TransactionList.hs view
@@ -0,0 +1,82 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.TransactionList (TransactionList(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.Transaction as ProtocolBuffers (Transaction)++data TransactionList = TransactionList{transaction :: !(P'.Seq ProtocolBuffers.Transaction)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable TransactionList where+ mergeAppend (TransactionList x'1) (TransactionList y'1) = TransactionList (P'.mergeAppend x'1 y'1)++instance P'.Default TransactionList where+ defaultValue = TransactionList P'.defaultValue++instance P'.Wire TransactionList where+ wireSize ft' self'@(TransactionList x'1)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeRep 1 11 x'1)+ wirePutWithSize ft' self'@(TransactionList x'1)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutRepWithSize 2 11 x'1]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{transaction = P'.append (transaction old'Self) new'Field}) (P'.wireGet 11)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> TransactionList) TransactionList where+ getVal m' f' = f' m'++instance P'.GPB TransactionList++instance P'.ReflectDescriptor TransactionList where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList []) (P'.fromDistinctAscList [2])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.TransactionList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"TransactionList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"TransactionList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.TransactionList.transaction\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"TransactionList\"], baseName' = FName \"transaction\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Transaction\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Transaction\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType TransactionList where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg TransactionList where+ textPut msg+ = do+ P'.tellT "transaction" (transaction msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'transaction]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'transaction+ = P'.try+ (do+ v <- P'.getT "transaction"+ Prelude'.return (\ o -> o{transaction = P'.append (transaction o) v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/TxAfterHeight.hs view
@@ -0,0 +1,81 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.TxAfterHeight (TxAfterHeight(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'++data TxAfterHeight = TxAfterHeight{result :: !(P'.Maybe P'.Bool)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable TxAfterHeight where+ mergeAppend (TxAfterHeight x'1) (TxAfterHeight y'1) = TxAfterHeight (P'.mergeAppend x'1 y'1)++instance P'.Default TxAfterHeight where+ defaultValue = TxAfterHeight P'.defaultValue++instance P'.Wire TxAfterHeight where+ wireSize ft' self'@(TxAfterHeight x'1)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeOpt 1 8 x'1)+ wirePutWithSize ft' self'@(TxAfterHeight x'1)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutOptWithSize 0 8 x'1]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 0 -> Prelude'.fmap (\ !new'Field -> old'Self{result = Prelude'.Just new'Field}) (P'.wireGet 8)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> TxAfterHeight) TxAfterHeight where+ getVal m' f' = f' m'++instance P'.GPB TxAfterHeight++instance P'.ReflectDescriptor TxAfterHeight where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList []) (P'.fromDistinctAscList [0])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.TxAfterHeight\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"TxAfterHeight\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"TxAfterHeight.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.TxAfterHeight.result\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"TxAfterHeight\"], baseName' = FName \"result\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 0}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType TxAfterHeight where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg TxAfterHeight where+ textPut msg+ = do+ P'.tellT "result" (result msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'result]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'result+ = P'.try+ (do+ v <- P'.getT "result"+ Prelude'.return (\ o -> o{result = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/TxIdList.hs view
@@ -0,0 +1,81 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.TxIdList (TxIdList(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'++data TxIdList = TxIdList{txid :: !(P'.Seq P'.ByteString)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable TxIdList where+ mergeAppend (TxIdList x'1) (TxIdList y'1) = TxIdList (P'.mergeAppend x'1 y'1)++instance P'.Default TxIdList where+ defaultValue = TxIdList P'.defaultValue++instance P'.Wire TxIdList where+ wireSize ft' self'@(TxIdList x'1)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeRep 1 12 x'1)+ wirePutWithSize ft' self'@(TxIdList x'1)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutRepWithSize 2 12 x'1]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{txid = P'.append (txid old'Self) new'Field}) (P'.wireGet 12)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> TxIdList) TxIdList where+ getVal m' f' = f' m'++instance P'.GPB TxIdList++instance P'.ReflectDescriptor TxIdList where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList []) (P'.fromDistinctAscList [2])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.TxIdList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"TxIdList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"TxIdList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.TxIdList.txid\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"TxIdList\"], baseName' = FName \"txid\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType TxIdList where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg TxIdList where+ textPut msg+ = do+ P'.tellT "txid" (txid msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'txid]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'txid+ = P'.try+ (do+ v <- P'.getT "txid"+ Prelude'.return (\ o -> o{txid = P'.append (txid o) v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/Unspent.hs view
@@ -0,0 +1,127 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.Unspent (Unspent(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.BlockRef as ProtocolBuffers (BlockRef)++data Unspent = Unspent{txid :: !(P'.ByteString), index :: !(P'.Word32), pkscript :: !(P'.ByteString), value :: !(P'.Word64),+ block :: !(ProtocolBuffers.BlockRef), address :: !(P'.Maybe P'.Utf8)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable Unspent where+ mergeAppend (Unspent x'1 x'2 x'3 x'4 x'5 x'6) (Unspent y'1 y'2 y'3 y'4 y'5 y'6)+ = Unspent (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)+ (P'.mergeAppend x'5 y'5)+ (P'.mergeAppend x'6 y'6)++instance P'.Default Unspent where+ defaultValue = Unspent P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue++instance P'.Wire Unspent where+ wireSize ft' self'@(Unspent x'1 x'2 x'3 x'4 x'5 x'6)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size+ = (P'.wireSizeReq 1 12 x'1 + P'.wireSizeReq 1 13 x'2 + P'.wireSizeReq 1 12 x'3 + P'.wireSizeReq 1 4 x'4 ++ P'.wireSizeReq 1 11 x'5+ + P'.wireSizeOpt 1 9 x'6)+ wirePutWithSize ft' self'@(Unspent x'1 x'2 x'3 x'4 x'5 x'6)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields+ = P'.sequencePutWithSize+ [P'.wirePutReqWithSize 2 12 x'1, P'.wirePutReqWithSize 8 13 x'2, P'.wirePutReqWithSize 18 12 x'3,+ P'.wirePutReqWithSize 24 4 x'4, P'.wirePutReqWithSize 34 11 x'5, P'.wirePutOptWithSize 42 9 x'6]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{txid = new'Field}) (P'.wireGet 12)+ 8 -> Prelude'.fmap (\ !new'Field -> old'Self{index = new'Field}) (P'.wireGet 13)+ 18 -> Prelude'.fmap (\ !new'Field -> old'Self{pkscript = new'Field}) (P'.wireGet 12)+ 24 -> Prelude'.fmap (\ !new'Field -> old'Self{value = new'Field}) (P'.wireGet 4)+ 34 -> Prelude'.fmap (\ !new'Field -> old'Self{block = P'.mergeAppend (block old'Self) (new'Field)}) (P'.wireGet 11)+ 42 -> Prelude'.fmap (\ !new'Field -> old'Self{address = Prelude'.Just new'Field}) (P'.wireGet 9)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> Unspent) Unspent where+ getVal m' f' = f' m'++instance P'.GPB Unspent++instance P'.ReflectDescriptor Unspent where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList [2, 8, 18, 24, 34]) (P'.fromDistinctAscList [2, 8, 18, 24, 34, 42])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.Unspent\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Unspent\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"Unspent.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Unspent.txid\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Unspent\"], baseName' = FName \"txid\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Unspent.index\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Unspent\"], baseName' = FName \"index\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Unspent.pkscript\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Unspent\"], baseName' = FName \"pkscript\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Unspent.value\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Unspent\"], baseName' = FName \"value\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Unspent.block\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Unspent\"], baseName' = FName \"block\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 34}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.BlockRef\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"BlockRef\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.Unspent.address\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"Unspent\"], baseName' = FName \"address\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 42}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType Unspent where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg Unspent where+ textPut msg+ = do+ P'.tellT "txid" (txid msg)+ P'.tellT "index" (index msg)+ P'.tellT "pkscript" (pkscript msg)+ P'.tellT "value" (value msg)+ P'.tellT "block" (block msg)+ P'.tellT "address" (address msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'txid, parse'index, parse'pkscript, parse'value, parse'block, parse'address]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'txid+ = P'.try+ (do+ v <- P'.getT "txid"+ Prelude'.return (\ o -> o{txid = v}))+ parse'index+ = P'.try+ (do+ v <- P'.getT "index"+ Prelude'.return (\ o -> o{index = v}))+ parse'pkscript+ = P'.try+ (do+ v <- P'.getT "pkscript"+ Prelude'.return (\ o -> o{pkscript = v}))+ parse'value+ = P'.try+ (do+ v <- P'.getT "value"+ Prelude'.return (\ o -> o{value = v}))+ parse'block+ = P'.try+ (do+ v <- P'.getT "block"+ Prelude'.return (\ o -> o{block = v}))+ parse'address+ = P'.try+ (do+ v <- P'.getT "address"+ Prelude'.return (\ o -> o{address = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/UnspentList.hs view
@@ -0,0 +1,82 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.UnspentList (UnspentList(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.Unspent as ProtocolBuffers (Unspent)++data UnspentList = UnspentList{unspent :: !(P'.Seq ProtocolBuffers.Unspent)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable UnspentList where+ mergeAppend (UnspentList x'1) (UnspentList y'1) = UnspentList (P'.mergeAppend x'1 y'1)++instance P'.Default UnspentList where+ defaultValue = UnspentList P'.defaultValue++instance P'.Wire UnspentList where+ wireSize ft' self'@(UnspentList x'1)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeRep 1 11 x'1)+ wirePutWithSize ft' self'@(UnspentList x'1)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutRepWithSize 2 11 x'1]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{unspent = P'.append (unspent old'Self) new'Field}) (P'.wireGet 11)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> UnspentList) UnspentList where+ getVal m' f' = f' m'++instance P'.GPB UnspentList++instance P'.ReflectDescriptor UnspentList where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList []) (P'.fromDistinctAscList [2])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.UnspentList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"UnspentList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"UnspentList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.UnspentList.unspent\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"UnspentList\"], baseName' = FName \"unspent\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Unspent\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Unspent\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType UnspentList where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg UnspentList where+ textPut msg+ = do+ P'.tellT "unspent" (unspent msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'unspent]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'unspent+ = P'.try+ (do+ v <- P'.getT "unspent"+ Prelude'.return (\ o -> o{unspent = P'.append (unspent o) v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/XPubBalance.hs view
@@ -0,0 +1,90 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.XPubBalance (XPubBalance(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.Balance as ProtocolBuffers (Balance)++data XPubBalance = XPubBalance{path :: !(P'.Seq P'.Word32), balance :: !(ProtocolBuffers.Balance)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable XPubBalance where+ mergeAppend (XPubBalance x'1 x'2) (XPubBalance y'1 y'2) = XPubBalance (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2)++instance P'.Default XPubBalance where+ defaultValue = XPubBalance P'.defaultValue P'.defaultValue++instance P'.Wire XPubBalance where+ wireSize ft' self'@(XPubBalance x'1 x'2)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizePacked 1 13 x'1 + P'.wireSizeReq 1 11 x'2)+ wirePutWithSize ft' self'@(XPubBalance x'1 x'2)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutPackedWithSize 2 13 x'1, P'.wirePutReqWithSize 10 11 x'2]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 0 -> Prelude'.fmap (\ !new'Field -> old'Self{path = P'.append (path old'Self) new'Field}) (P'.wireGet 13)+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{path = P'.mergeAppend (path old'Self) new'Field}) (P'.wireGetPacked 13)+ 10 -> Prelude'.fmap (\ !new'Field -> old'Self{balance = P'.mergeAppend (balance old'Self) (new'Field)}) (P'.wireGet 11)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> XPubBalance) XPubBalance where+ getVal m' f' = f' m'++instance P'.GPB XPubBalance++instance P'.ReflectDescriptor XPubBalance where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList [10]) (P'.fromDistinctAscList [0, 2, 10])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.XPubBalance\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"XPubBalance\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"XPubBalance.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.XPubBalance.path\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"XPubBalance\"], baseName' = FName \"path\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Just (WireTag {getWireTag = 0},WireTag {getWireTag = 2}), wireTagLength = 1, isPacked = True, isRequired = False, canRepeat = True, mightPack = True, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.XPubBalance.balance\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"XPubBalance\"], baseName' = FName \"balance\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Balance\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Balance\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType XPubBalance where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg XPubBalance where+ textPut msg+ = do+ P'.tellT "path" (path msg)+ P'.tellT "balance" (balance msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'path, parse'balance]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'path+ = P'.try+ (do+ v <- P'.getT "path"+ Prelude'.return (\ o -> o{path = P'.append (path o) v}))+ parse'balance+ = P'.try+ (do+ v <- P'.getT "balance"+ Prelude'.return (\ o -> o{balance = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/XPubBalanceList.hs view
@@ -0,0 +1,82 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.XPubBalanceList (XPubBalanceList(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.XPubBalance as ProtocolBuffers (XPubBalance)++data XPubBalanceList = XPubBalanceList{xpubbalance :: !(P'.Seq ProtocolBuffers.XPubBalance)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable XPubBalanceList where+ mergeAppend (XPubBalanceList x'1) (XPubBalanceList y'1) = XPubBalanceList (P'.mergeAppend x'1 y'1)++instance P'.Default XPubBalanceList where+ defaultValue = XPubBalanceList P'.defaultValue++instance P'.Wire XPubBalanceList where+ wireSize ft' self'@(XPubBalanceList x'1)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeRep 1 11 x'1)+ wirePutWithSize ft' self'@(XPubBalanceList x'1)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutRepWithSize 2 11 x'1]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{xpubbalance = P'.append (xpubbalance old'Self) new'Field}) (P'.wireGet 11)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> XPubBalanceList) XPubBalanceList where+ getVal m' f' = f' m'++instance P'.GPB XPubBalanceList++instance P'.ReflectDescriptor XPubBalanceList where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList []) (P'.fromDistinctAscList [2])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.XPubBalanceList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"XPubBalanceList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"XPubBalanceList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.XPubBalanceList.xpubbalance\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"XPubBalanceList\"], baseName' = FName \"xpubbalance\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.XPubBalance\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"XPubBalance\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType XPubBalanceList where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg XPubBalanceList where+ textPut msg+ = do+ P'.tellT "xpubbalance" (xpubbalance msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'xpubbalance]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'xpubbalance+ = P'.try+ (do+ v <- P'.getT "xpubbalance"+ Prelude'.return (\ o -> o{xpubbalance = P'.append (xpubbalance o) v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/XPubUnspent.hs view
@@ -0,0 +1,90 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.XPubUnspent (XPubUnspent(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.Unspent as ProtocolBuffers (Unspent)++data XPubUnspent = XPubUnspent{path :: !(P'.Seq P'.Word32), unspent :: !(ProtocolBuffers.Unspent)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable XPubUnspent where+ mergeAppend (XPubUnspent x'1 x'2) (XPubUnspent y'1 y'2) = XPubUnspent (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2)++instance P'.Default XPubUnspent where+ defaultValue = XPubUnspent P'.defaultValue P'.defaultValue++instance P'.Wire XPubUnspent where+ wireSize ft' self'@(XPubUnspent x'1 x'2)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizePacked 1 13 x'1 + P'.wireSizeReq 1 11 x'2)+ wirePutWithSize ft' self'@(XPubUnspent x'1 x'2)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutPackedWithSize 2 13 x'1, P'.wirePutReqWithSize 10 11 x'2]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 0 -> Prelude'.fmap (\ !new'Field -> old'Self{path = P'.append (path old'Self) new'Field}) (P'.wireGet 13)+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{path = P'.mergeAppend (path old'Self) new'Field}) (P'.wireGetPacked 13)+ 10 -> Prelude'.fmap (\ !new'Field -> old'Self{unspent = P'.mergeAppend (unspent old'Self) (new'Field)}) (P'.wireGet 11)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> XPubUnspent) XPubUnspent where+ getVal m' f' = f' m'++instance P'.GPB XPubUnspent++instance P'.ReflectDescriptor XPubUnspent where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList [10]) (P'.fromDistinctAscList [0, 2, 10])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.XPubUnspent\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"XPubUnspent\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"XPubUnspent.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.XPubUnspent.path\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"XPubUnspent\"], baseName' = FName \"path\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Just (WireTag {getWireTag = 0},WireTag {getWireTag = 2}), wireTagLength = 1, isPacked = True, isRequired = False, canRepeat = True, mightPack = True, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.XPubUnspent.unspent\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"XPubUnspent\"], baseName' = FName \"unspent\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.Unspent\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"Unspent\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType XPubUnspent where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg XPubUnspent where+ textPut msg+ = do+ P'.tellT "path" (path msg)+ P'.tellT "unspent" (unspent msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'path, parse'unspent]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'path+ = P'.try+ (do+ v <- P'.getT "path"+ Prelude'.return (\ o -> o{path = P'.append (path o) v}))+ parse'unspent+ = P'.try+ (do+ v <- P'.getT "unspent"+ Prelude'.return (\ o -> o{unspent = v}))
+ src/Network/Haskoin/Store/ProtocolBuffers/XPubUnspentList.hs view
@@ -0,0 +1,82 @@+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}+{-# OPTIONS_GHC -w #-}+module Network.Haskoin.Store.ProtocolBuffers.XPubUnspentList (XPubUnspentList(..)) where+import Prelude ((+), (/), (++), (.))+import qualified Prelude as Prelude'+import qualified Data.Typeable as Prelude'+import qualified GHC.Generics as Prelude'+import qualified Data.Data as Prelude'+import qualified Text.ProtocolBuffers.Header as P'+import qualified Network.Haskoin.Store.ProtocolBuffers.XPubUnspent as ProtocolBuffers (XPubUnspent)++data XPubUnspentList = XPubUnspentList{xpubunspent :: !(P'.Seq ProtocolBuffers.XPubUnspent)}+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)++instance P'.Mergeable XPubUnspentList where+ mergeAppend (XPubUnspentList x'1) (XPubUnspentList y'1) = XPubUnspentList (P'.mergeAppend x'1 y'1)++instance P'.Default XPubUnspentList where+ defaultValue = XPubUnspentList P'.defaultValue++instance P'.Wire XPubUnspentList where+ wireSize ft' self'@(XPubUnspentList x'1)+ = case ft' of+ 10 -> calc'Size+ 11 -> P'.prependMessageSize calc'Size+ _ -> P'.wireSizeErr ft' self'+ where+ calc'Size = (P'.wireSizeRep 1 11 x'1)+ wirePutWithSize ft' self'@(XPubUnspentList x'1)+ = case ft' of+ 10 -> put'Fields+ 11 -> put'FieldsSized+ _ -> P'.wirePutErr ft' self'+ where+ put'Fields = P'.sequencePutWithSize [P'.wirePutRepWithSize 2 11 x'1]+ put'FieldsSized+ = let size' = Prelude'.fst (P'.runPutM put'Fields)+ put'Size+ = do+ P'.putSize size'+ Prelude'.return (P'.size'WireSize size')+ in P'.sequencePutWithSize [put'Size, put'Fields]+ wireGet ft'+ = case ft' of+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)+ _ -> P'.wireGetErr ft'+ where+ update'Self wire'Tag old'Self+ = case wire'Tag of+ 2 -> Prelude'.fmap (\ !new'Field -> old'Self{xpubunspent = P'.append (xpubunspent old'Self) new'Field}) (P'.wireGet 11)+ _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self++instance P'.MessageAPI msg' (msg' -> XPubUnspentList) XPubUnspentList where+ getVal m' f' = f' m'++instance P'.GPB XPubUnspentList++instance P'.ReflectDescriptor XPubUnspentList where+ getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList []) (P'.fromDistinctAscList [2])+ reflectDescriptorInfo _+ = Prelude'.read+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".ProtocolBuffers.XPubUnspentList\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"XPubUnspentList\"}, descFilePath = [\"Network\",\"Haskoin\",\"Store\",\"ProtocolBuffers\",\"XPubUnspentList.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".ProtocolBuffers.XPubUnspentList.xpubunspent\", haskellPrefix' = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule' = [MName \"ProtocolBuffers\",MName \"XPubUnspentList\"], baseName' = FName \"xpubunspent\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 0}, wireTag = WireTag {getWireTag = 2}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = True, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".ProtocolBuffers.XPubUnspent\", haskellPrefix = [MName \"Network\",MName \"Haskoin\",MName \"Store\"], parentModule = [MName \"ProtocolBuffers\"], baseName = MName \"XPubUnspent\"}), hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"++instance P'.TextType XPubUnspentList where+ tellT = P'.tellSubMessage+ getT = P'.getSubMessage++instance P'.TextMsg XPubUnspentList where+ textPut msg+ = do+ P'.tellT "xpubunspent" (xpubunspent msg)+ textGet+ = do+ mods <- P'.sepEndBy (P'.choice [parse'xpubunspent]) P'.spaces+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)+ where+ parse'xpubunspent+ = P'.try+ (do+ v <- P'.getT "xpubunspent"+ Prelude'.return (\ o -> o{xpubunspent = P'.append (xpubunspent o) v}))