Skip to content

Commit

Permalink
Upgrade to GHC>=9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed Dec 4, 2023
1 parent 199daf6 commit 01f7787
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
16 changes: 15 additions & 1 deletion server/modules/fast-bech32/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
# 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

- 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

Expand Down
8 changes: 4 additions & 4 deletions server/modules/fast-bech32/fast-bech32.cabal

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions server/modules/fast-bech32/package.yaml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"
Expand All @@ -17,7 +17,7 @@ extra-source-files:
- CHANGELOG.md

dependencies:
- base >= 4.7 && < 5
- base >= 4.17 && < 5

default-extensions: *default-extensions

Expand Down
4 changes: 2 additions & 2 deletions server/modules/fast-bech32/src/Data/ByteString/Bech32.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 #-}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ module Data.ByteString.Bech32Spec

import Prelude

import Data.Base16.Types
( extractBase16 )
import Data.ByteString
( ByteString )
import Data.ByteString.Base16
Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit 01f7787

Please sign in to comment.