From 0bab23375f9458664a5fb3016a733776d3471205 Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Sat, 14 Dec 2024 06:22:19 -0600 Subject: [PATCH] feat: support for new Zebra `getblock` format --- CHANGELOG.md | 6 ++++++ src/ZcashHaskell/Types.hs | 4 ++-- zcash-haskell.cabal | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed642a7..973ccec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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/), 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] ### Added diff --git a/src/ZcashHaskell/Types.hs b/src/ZcashHaskell/Types.hs index 1c55a73..a02ed15 100644 --- a/src/ZcashHaskell/Types.hs +++ b/src/ZcashHaskell/Types.hs @@ -268,10 +268,10 @@ instance FromJSON BlockResponse where withObject "BlockResponse" $ \obj -> do c <- obj .: "confirmations" h <- obj .: "height" - t <- obj .:? "time" + t <- obj .: "time" txs <- obj .: "tx" hash <- obj .: "hash" - pure $ BlockResponse hash c h (fromMaybe 0 t) txs + pure $ BlockResponse hash c h t txs instance ToJSON BlockResponse where toJSON (BlockResponse h c ht t txs) = diff --git a/zcash-haskell.cabal b/zcash-haskell.cabal index c1d1d82..4cddd8a 100644 --- a/zcash-haskell.cabal +++ b/zcash-haskell.cabal @@ -5,7 +5,7 @@ cabal-version: 3.0 -- see: https://github.com/sol/hpack name: zcash-haskell -version: 0.7.5.0 +version: 0.7.6.0 synopsis: Utilities to interact with the Zcash blockchain description: Please see the README on the repo at category: Blockchain