Support for Zebra 2.1.0 (#102)

This PR has the changes needed to support the new format of the response of `getblock` released on Zebra 2.1.0.

Reviewed-on: #102
Co-authored-by: Rene Vergara <rene@vergara.network>
Co-committed-by: Rene Vergara <rene@vergara.network>
This commit is contained in:
Rene Vergara 2024-12-14 12:51:06 +00:00 committed by Vergara Technologies LLC
parent d45bd7dcf3
commit 4289a9ded6
Signed by: Vergara Technologies LLC
GPG key ID: 99DB473BB4715618
3 changed files with 9 additions and 3 deletions

View file

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.7.6.0]
### Changed
- Removed workaround for missing `time` field in Zebra's `getblock` response.
## [0.7.5.0] ## [0.7.5.0]
### Added ### Added

View file

@ -268,10 +268,10 @@ instance FromJSON BlockResponse where
withObject "BlockResponse" $ \obj -> do withObject "BlockResponse" $ \obj -> do
c <- obj .: "confirmations" c <- obj .: "confirmations"
h <- obj .: "height" h <- obj .: "height"
t <- obj .:? "time" t <- obj .: "time"
txs <- obj .: "tx" txs <- obj .: "tx"
hash <- obj .: "hash" hash <- obj .: "hash"
pure $ BlockResponse hash c h (fromMaybe 0 t) txs pure $ BlockResponse hash c h t txs
instance ToJSON BlockResponse where instance ToJSON BlockResponse where
toJSON (BlockResponse h c ht t txs) = toJSON (BlockResponse h c ht t txs) =

View file

@ -5,7 +5,7 @@ cabal-version: 3.0
-- see: https://github.com/sol/hpack -- see: https://github.com/sol/hpack
name: zcash-haskell name: zcash-haskell
version: 0.7.5.0 version: 0.7.6.0
synopsis: Utilities to interact with the Zcash blockchain synopsis: Utilities to interact with the Zcash blockchain
description: Please see the README on the repo at <https://git.vergara.tech/Vergara_Tech/zcash-haskell#readme> description: Please see the README on the repo at <https://git.vergara.tech/Vergara_Tech/zcash-haskell#readme>
category: Blockchain category: Blockchain