From 01f7787216e7ceb8e39c8c6807f7ae53fc14ab9e Mon Sep 17 00:00:00 2001 From: KtorZ Date: Mon, 4 Dec 2023 11:48:57 +0100 Subject: [PATCH] Upgrade to GHC>=9.6 --- server/modules/fast-bech32/CHANGELOG.md | 16 +++++++++++++++- server/modules/fast-bech32/fast-bech32.cabal | 8 ++++---- server/modules/fast-bech32/package.yaml | 4 ++-- .../fast-bech32/src/Data/ByteString/Bech32.hs | 4 ++-- .../test/unit/Data/ByteString/Bech32Spec.hs | 4 +++- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/server/modules/fast-bech32/CHANGELOG.md b/server/modules/fast-bech32/CHANGELOG.md index 1760fedffb..18a43fd7fa 100644 --- a/server/modules/fast-bech32/CHANGELOG.md +++ b/server/modules/fast-bech32/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [1.0.1] -- 2023-12-04 + +### Added + +- N/A + +### Changed + +- Support for GHC>=9.6 + +### Removed + +- N/A + ## [1.0.0] -- 2021-03-18 ### Added @@ -7,7 +21,7 @@ - Initial release, only covering the bech32 encoding - Provide benchmarks for comparing with the existing bech32 library as well as an optimized base32 library. -### Changed +### Changed N/A diff --git a/server/modules/fast-bech32/fast-bech32.cabal b/server/modules/fast-bech32/fast-bech32.cabal index f5fc76738e..9a3ddc3f2d 100644 --- a/server/modules/fast-bech32/fast-bech32.cabal +++ b/server/modules/fast-bech32/fast-bech32.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: fast-bech32 -version: 1.0.0 +version: 1.0.1 synopsis: Fast implementation of the Bech32 encoding format. description: Please see the README on GitHub at category: Codec @@ -71,7 +71,7 @@ library ViewPatterns ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wpartial-fields -Wredundant-constraints -Wunused-packages build-depends: - base >=4.7 && <5 + base >=4.17 && <5 , bytestring , relude , text @@ -128,7 +128,7 @@ test-suite unit hspec-discover:hspec-discover build-depends: QuickCheck - , base >=4.7 && <5 + , base >=4.17 && <5 , base16 , bech32 , bytestring @@ -182,7 +182,7 @@ benchmark encoding ViewPatterns ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wpartial-fields -Wredundant-constraints -Wunused-packages -threaded -rtsopts -with-rtsopts=-N build-depends: - base >=4.7 && <5 + base >=4.17 && <5 , bech32 , bytestring , criterion diff --git a/server/modules/fast-bech32/package.yaml b/server/modules/fast-bech32/package.yaml index 8697cf8c8b..22a98b0db6 100644 --- a/server/modules/fast-bech32/package.yaml +++ b/server/modules/fast-bech32/package.yaml @@ -1,7 +1,7 @@ _config: !include "../../.hpack.config.yaml" name: fast-bech32 -version: 1.0.0 +version: 1.0.1 github: "cardanosolutions/ogmios" license: MPL-2.0 author: "KtorZ " @@ -17,7 +17,7 @@ extra-source-files: - CHANGELOG.md dependencies: -- base >= 4.7 && < 5 +- base >= 4.17 && < 5 default-extensions: *default-extensions diff --git a/server/modules/fast-bech32/src/Data/ByteString/Bech32.hs b/server/modules/fast-bech32/src/Data/ByteString/Bech32.hs index 342a64501d..f01ea8d919 100644 --- a/server/modules/fast-bech32/src/Data/ByteString/Bech32.hs +++ b/server/modules/fast-bech32/src/Data/ByteString/Bech32.hs @@ -55,7 +55,7 @@ import Foreign.Ptr import Foreign.Storable ( peek, poke ) import GHC.Exts - ( Addr#, indexWord8OffAddr#, word2Int# ) + ( Addr#, indexWord8OffAddr#, word2Int#, word8ToWord#) import GHC.ForeignPtr ( mallocPlainForeignPtrBytes ) import GHC.Word @@ -268,5 +268,5 @@ peekWord5 !((.&. 7) -> !n) (Residue !r) !ptr -- | Fast array lookup of a word5 in an unboxed bytestring. lookupWord5 :: Addr# -> Word5 -> Word8 lookupWord5 table (coerce -> (W8# i)) = - W8# (indexWord8OffAddr# table (word2Int# i)) + W8# (indexWord8OffAddr# table (word2Int# (word8ToWord# i))) {-# INLINE lookupWord5 #-} diff --git a/server/modules/fast-bech32/test/unit/Data/ByteString/Bech32Spec.hs b/server/modules/fast-bech32/test/unit/Data/ByteString/Bech32Spec.hs index fe45372468..6cc72e1a10 100644 --- a/server/modules/fast-bech32/test/unit/Data/ByteString/Bech32Spec.hs +++ b/server/modules/fast-bech32/test/unit/Data/ByteString/Bech32Spec.hs @@ -8,6 +8,8 @@ module Data.ByteString.Bech32Spec import Prelude +import Data.Base16.Types + ( extractBase16 ) import Data.ByteString ( ByteString ) import Data.ByteString.Base16 @@ -48,7 +50,7 @@ prop_matchOracle (Bytes bytes) (HumanReadablePart hrp) = do newtype Bytes = Bytes { unBytes :: ByteString } instance Show Bytes where - show = T.unpack . encodeBase16 . unBytes + show = T.unpack . extractBase16 . encodeBase16 . unBytes genBytes :: Gen Bytes genBytes =