cardano-community / koios-go-client

Go Client library for Koios API
https://pkg.go.dev/github.com/cardano-community/koios-go-client/v3
Apache License 2.0
10 stars 4 forks source link

fix: decompress resonse when appropriate, fixes #46 #47

Closed safanaj closed 8 months ago

safanaj commented 8 months ago

Description

decode compressed response

Motivation and context

the deflate case is not really needed as the API is using gzip, it is there for completeness

Which issue it fixes?

Closes: #46

How has this been tested?

Manually

codecov[bot] commented 8 months ago

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (680d504) 57.51% compared to head (9110de2) 11.67%.

Files Patch % Lines
response.go 0.00% 13 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #47 +/- ## =========================================== - Coverage 57.51% 11.67% -45.84% =========================================== Files 14 14 Lines 1384 1396 +12 =========================================== - Hits 796 163 -633 - Misses 500 1227 +727 + Partials 88 6 -82 ``` | [Flag](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | Coverage Δ | | |---|---|---| | [AccountAddresses](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [AccountAssets](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [AccountHistory](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [AccountInfo](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [AccountInfoCached](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [AccountRewards](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [AccountUpdates](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [Accounts](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [AddressAssets](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [AddressInfo](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [AddressTxs](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [AssetAddresses](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [AssetHistory](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [AssetInfo](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [AssetPolicyInfo](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [AssetSummary](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [AssetTxs](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [Assets](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [BlockInfo](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [BlockTxs](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [Blocks](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [CredentialTxs](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [DatumInfo](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [EpochBlockProtocols](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [EpochInfo](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [EpochParams](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [NativeScriptList](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [NetworkGenesis](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [NetworkTip](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [NetworkTotals](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [PlutusScriptList](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [PoolBlocks](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [PoolDelegators](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [PoolDelegatorsHistory](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [PoolHistory](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [PoolInfo](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [PoolMetadata](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [PoolRelays](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [PoolSnapshot](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [PoolUpdates](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [Pools](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [ScriptRedeemers](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [TxInfo](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [TxMetaLabels](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [TxMetadata](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [TxStatus](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [TxUTxO](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [account](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [address](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [assets](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [blocks](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [epoch](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [guild](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [linux](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `11.67% <0.00%> (-0.11%)` | :arrow_down: | | [local](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `11.67% <0.00%> (-0.11%)` | :arrow_down: | | [macos](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `11.67% <0.00%> (-0.11%)` | :arrow_down: | | [mainnet](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [network](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [pool](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [preprod](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [preview](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [scripts](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [transactions](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `?` | | | [windows](https://app.codecov.io/gh/cardano-community/koios-go-client/pull/47/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community) | `11.67% <0.00%> (-0.11%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cardano-community#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mkungla commented 8 months ago

thanks fixed and updated cli