feat: add toJSON
for BlockResponse
This commit is contained in:
parent
003293cc3f
commit
5a08c80285
4 changed files with 44 additions and 12 deletions
21
CHANGELOG.md
21
CHANGELOG.md
|
@ -5,6 +5,27 @@ 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.1.1]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- `ToJSON` instance for `BlockResponse`
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Updated libraries:
|
||||||
|
- conduit
|
||||||
|
- data-fix
|
||||||
|
- happy
|
||||||
|
- happy-lib
|
||||||
|
- http-conduit
|
||||||
|
- iproute
|
||||||
|
- mono-traversable
|
||||||
|
- network
|
||||||
|
- secp256k1-haskell
|
||||||
|
- strict
|
||||||
|
- typed-process
|
||||||
|
|
||||||
## [0.7.1.0]
|
## [0.7.1.0]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -54,7 +54,7 @@ constraints: any.Cabal ==3.10.3.0,
|
||||||
any.colour ==2.3.6,
|
any.colour ==2.3.6,
|
||||||
any.comonad ==5.0.8,
|
any.comonad ==5.0.8,
|
||||||
comonad +containers +distributive +indexed-traversable,
|
comonad +containers +distributive +indexed-traversable,
|
||||||
any.conduit ==1.3.5,
|
any.conduit ==1.3.6,
|
||||||
any.conduit-extra ==1.3.6,
|
any.conduit-extra ==1.3.6,
|
||||||
any.containers ==0.6.7,
|
any.containers ==0.6.7,
|
||||||
any.contravariant ==1.5.5,
|
any.contravariant ==1.5.5,
|
||||||
|
@ -74,7 +74,7 @@ constraints: any.Cabal ==3.10.3.0,
|
||||||
any.data-default-instances-containers ==0.0.1,
|
any.data-default-instances-containers ==0.0.1,
|
||||||
any.data-default-instances-dlist ==0.0.1,
|
any.data-default-instances-dlist ==0.0.1,
|
||||||
any.data-default-instances-old-locale ==0.0.1,
|
any.data-default-instances-old-locale ==0.0.1,
|
||||||
any.data-fix ==0.3.3,
|
any.data-fix ==0.3.4,
|
||||||
any.deepseq ==1.4.8.1,
|
any.deepseq ==1.4.8.1,
|
||||||
any.directory ==1.3.8.4,
|
any.directory ==1.3.8.4,
|
||||||
any.distributive ==0.6.2.1,
|
any.distributive ==0.6.2.1,
|
||||||
|
@ -93,7 +93,8 @@ constraints: any.Cabal ==3.10.3.0,
|
||||||
any.ghc-boot-th ==9.6.5,
|
any.ghc-boot-th ==9.6.5,
|
||||||
any.ghc-prim ==0.10.0,
|
any.ghc-prim ==0.10.0,
|
||||||
any.half ==0.3.1,
|
any.half ==0.3.1,
|
||||||
any.happy ==1.20.1.1,
|
any.happy ==2.0.2,
|
||||||
|
any.happy-lib ==2.0.2,
|
||||||
any.hashable ==1.4.7.0,
|
any.hashable ==1.4.7.0,
|
||||||
hashable -arch-native +integer-gmp -random-initial-seed,
|
hashable -arch-native +integer-gmp -random-initial-seed,
|
||||||
any.haskell-lexer ==1.1.1,
|
any.haskell-lexer ==1.1.1,
|
||||||
|
@ -109,7 +110,7 @@ constraints: any.Cabal ==3.10.3.0,
|
||||||
any.http-client ==0.7.17,
|
any.http-client ==0.7.17,
|
||||||
http-client +network-uri,
|
http-client +network-uri,
|
||||||
any.http-client-tls ==0.3.6.3,
|
any.http-client-tls ==0.3.6.3,
|
||||||
any.http-conduit ==2.3.8.3,
|
any.http-conduit ==2.3.9,
|
||||||
http-conduit +aeson,
|
http-conduit +aeson,
|
||||||
any.http-types ==0.12.4,
|
any.http-types ==0.12.4,
|
||||||
any.indexed-traversable ==0.1.4,
|
any.indexed-traversable ==0.1.4,
|
||||||
|
@ -118,16 +119,16 @@ constraints: any.Cabal ==3.10.3.0,
|
||||||
any.integer-gmp ==1.1,
|
any.integer-gmp ==1.1,
|
||||||
any.integer-logarithms ==1.0.3.1,
|
any.integer-logarithms ==1.0.3.1,
|
||||||
integer-logarithms -check-bounds +integer-gmp,
|
integer-logarithms -check-bounds +integer-gmp,
|
||||||
any.iproute ==1.7.12,
|
any.iproute ==1.7.14,
|
||||||
any.language-c ==0.9.3,
|
any.language-c ==0.9.3,
|
||||||
language-c -allwarnings +iecfpextension +usebytestrings,
|
language-c -allwarnings +iecfpextension +usebytestrings,
|
||||||
any.memory ==0.18.0,
|
any.memory ==0.18.0,
|
||||||
memory +support_bytestring +support_deepseq,
|
memory +support_bytestring +support_deepseq,
|
||||||
any.mime-types ==0.1.2.0,
|
any.mime-types ==0.1.2.0,
|
||||||
any.mono-traversable ==1.0.17.0,
|
any.mono-traversable ==1.0.20.0,
|
||||||
any.mtl ==2.3.1,
|
any.mtl ==2.3.1,
|
||||||
any.murmur3 ==1.0.5,
|
any.murmur3 ==1.0.5,
|
||||||
any.network ==3.2.1.0,
|
any.network ==3.2.4.0,
|
||||||
network -devel,
|
network -devel,
|
||||||
any.network-uri ==2.6.4.2,
|
any.network-uri ==2.6.4.2,
|
||||||
any.old-locale ==1.0.0.7,
|
any.old-locale ==1.0.0.7,
|
||||||
|
@ -150,7 +151,7 @@ constraints: any.Cabal ==3.10.3.0,
|
||||||
any.safe ==0.3.21,
|
any.safe ==0.3.21,
|
||||||
any.scientific ==0.3.8.0,
|
any.scientific ==0.3.8.0,
|
||||||
scientific -integer-simple,
|
scientific -integer-simple,
|
||||||
any.secp256k1-haskell ==1.2.0,
|
any.secp256k1-haskell ==1.4.0,
|
||||||
any.semialign ==1.3.1,
|
any.semialign ==1.3.1,
|
||||||
semialign +semigroupoids,
|
semialign +semigroupoids,
|
||||||
any.semigroupoids ==6.0.1,
|
any.semigroupoids ==6.0.1,
|
||||||
|
@ -165,7 +166,7 @@ constraints: any.Cabal ==3.10.3.0,
|
||||||
any.stm ==2.5.1.0,
|
any.stm ==2.5.1.0,
|
||||||
any.streaming-commons ==0.2.2.6,
|
any.streaming-commons ==0.2.2.6,
|
||||||
streaming-commons -use-bytestring-builder,
|
streaming-commons -use-bytestring-builder,
|
||||||
any.strict ==0.5,
|
any.strict ==0.5.1,
|
||||||
any.string-conversions ==0.4.0.1,
|
any.string-conversions ==0.4.0.1,
|
||||||
any.tagged ==0.8.8,
|
any.tagged ==0.8.8,
|
||||||
tagged +deepseq +transformers,
|
tagged +deepseq +transformers,
|
||||||
|
@ -185,7 +186,7 @@ constraints: any.Cabal ==3.10.3.0,
|
||||||
any.transformers ==0.6.1.0,
|
any.transformers ==0.6.1.0,
|
||||||
any.transformers-compat ==0.7.2,
|
any.transformers-compat ==0.7.2,
|
||||||
transformers-compat -five +five-three -four +generic-deriving +mtl -three -two,
|
transformers-compat -five +five-three -four +generic-deriving +mtl -three -two,
|
||||||
any.typed-process ==0.2.11.1,
|
any.typed-process ==0.2.12.0,
|
||||||
any.unix ==2.8.4.0,
|
any.unix ==2.8.4.0,
|
||||||
any.unix-time ==0.4.15,
|
any.unix-time ==0.4.15,
|
||||||
any.unliftio-core ==0.2.1.0,
|
any.unliftio-core ==0.2.1.0,
|
||||||
|
@ -204,4 +205,4 @@ constraints: any.Cabal ==3.10.3.0,
|
||||||
any.witherable ==0.5,
|
any.witherable ==0.5,
|
||||||
any.zlib ==0.7.1.0,
|
any.zlib ==0.7.1.0,
|
||||||
zlib -bundled-c-zlib +non-blocking-ffi +pkg-config
|
zlib -bundled-c-zlib +non-blocking-ffi +pkg-config
|
||||||
index-state: hackage.haskell.org 2024-07-01T20:28:56Z
|
index-state: hackage.haskell.org 2024-10-11T12:55:31Z
|
||||||
|
|
|
@ -273,6 +273,16 @@ instance FromJSON BlockResponse where
|
||||||
hash <- obj .: "hash"
|
hash <- obj .: "hash"
|
||||||
pure $ BlockResponse hash c h (fromMaybe 0 t) txs
|
pure $ BlockResponse hash c h (fromMaybe 0 t) txs
|
||||||
|
|
||||||
|
instance ToJSON BlockResponse where
|
||||||
|
toJSON (BlockResponse h c ht t txs) =
|
||||||
|
object
|
||||||
|
[ "hash" .= h
|
||||||
|
, "confirmations" .= c
|
||||||
|
, "height" .= ht
|
||||||
|
, "time" .= t
|
||||||
|
, "tx" .= txs
|
||||||
|
]
|
||||||
|
|
||||||
-- | Type to represent response from the `zcashd` RPC `getrawtransaction`
|
-- | Type to represent response from the `zcashd` RPC `getrawtransaction`
|
||||||
data RawTxResponse = RawTxResponse
|
data RawTxResponse = RawTxResponse
|
||||||
{ rt_id :: !HexString
|
{ rt_id :: !HexString
|
||||||
|
|
|
@ -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.1.0
|
version: 0.7.1.1
|
||||||
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
|
||||||
|
|
Loading…
Reference in a new issue