Merge pull request 'Add block hash to BlockResponse' (#93) from rav001 into milestone2

Reviewed-on: https://git.vergara.tech///Vergara_Tech/zcash-haskell/pulls/93
This commit is contained in:
pitmutt 2024-09-23 15:19:31 +00:00 committed by Vergara Technologies LLC
commit 63a97b880c
Signed by: Vergara Technologies LLC
GPG key ID: 99DB473BB4715618

View file

@ -256,7 +256,8 @@ instance FromJSON RpcError where
-- ** `zcashd`
-- | Type to represent response from the `zcashd` RPC `getblock` method
data BlockResponse = BlockResponse
{ bl_confirmations :: !Integer -- ^ Block confirmations
{ bl_hash :: !HexString
, bl_confirmations :: !Integer -- ^ Block confirmations
, bl_height :: !Integer -- ^ Block height
, bl_time :: !Integer -- ^ Block time
, bl_txs :: ![HexString] -- ^ List of transaction IDs in the block
@ -269,7 +270,8 @@ instance FromJSON BlockResponse where
h <- obj .: "height"
t <- obj .:? "time"
txs <- obj .: "tx"
pure $ BlockResponse c h (fromMaybe 0 t) txs
hash <- obj .: "hash"
pure $ BlockResponse hash c h (fromMaybe 0 t) txs
-- | Type to represent response from the `zcashd` RPC `getrawtransaction`
data RawTxResponse = RawTxResponse