diff --git a/CHANGELOG.md b/CHANGELOG.md index ea99a3a..64cfe16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ 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.5.3.1] + +### Added + +- Functions for Bech32 encoding +- Function to encode a Sapling address + ## [0.5.3.0] ### Added diff --git a/src/ZcashHaskell/Orchard.hs b/src/ZcashHaskell/Orchard.hs index 4cb6f7d..438602f 100644 --- a/src/ZcashHaskell/Orchard.hs +++ b/src/ZcashHaskell/Orchard.hs @@ -33,7 +33,7 @@ import qualified Data.Text.Encoding as E import Data.Word import Foreign.Rust.Marshall.Variable import ZcashHaskell.Types -import ZcashHaskell.Utils (encodeBech32m, encodeBech32, f4Jumble) +import ZcashHaskell.Utils (encodeBech32, encodeBech32m, f4Jumble) -- | Derives an Orchard spending key for the given seed and account ID genOrchardSpendingKey :: @@ -154,20 +154,20 @@ decryptOrchardAction key encAction = withPureBorshVarBuffer $ rustWrapperOrchardNoteDecode (o_key key) encAction -chrToByteString :: [Char] -> C.ByteString -chrToByteString = C.pack - getSaplingFromUA :: BS.ByteString -> Maybe T.Text -getSaplingFromUA uadd = do +getSaplingFromUA uadd = do let a = isValidUnifiedAddress uadd - case a of + case a of Nothing -> Nothing Just a -> do - let sraw = s_rec a - case sraw of - Nothing -> Nothing - Just sraw -> do - let net = ua_net a - case net of - MainNet -> Just $ encodeBech32 (chrToByteString sapPaymentAddressHrp) ( getBytes sraw ) - TestNet -> Just $ encodeBech32 (chrToByteString sapTestPaymentAddressHrp) ( getBytes sraw ) \ No newline at end of file + let sraw = s_rec a + case sraw of + Nothing -> Nothing + Just sraw -> do + let net = ua_net a + case net of + MainNet -> + Just $ encodeBech32 (C.pack sapPaymentAddressHrp) (getBytes sraw) + TestNet -> + Just $ + encodeBech32 (C.pack sapTestPaymentAddressHrp) (getBytes sraw) diff --git a/zcash-haskell.cabal b/zcash-haskell.cabal index aa3c73f..6afc133 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.5.3.0 +version: 0.5.3.1 synopsis: Utilities to interact with the Zcash blockchain description: Please see the README on the repo at category: Blockchain