diff --git a/src/HaskellZcash/Orchard.hs b/src/ZcashHaskell/Orchard.hs similarity index 94% rename from src/HaskellZcash/Orchard.hs rename to src/ZcashHaskell/Orchard.hs index 46032b7..4c759b2 100644 --- a/src/HaskellZcash/Orchard.hs +++ b/src/ZcashHaskell/Orchard.hs @@ -1,4 +1,4 @@ -module HaskellZcash.Orchard where +module ZcashHaskell.Orchard where import C.Zcash ( rustWrapperIsUA @@ -7,7 +7,7 @@ import C.Zcash ) import qualified Data.ByteString as BS import Foreign.Rust.Marshall.Variable -import HaskellZcash.Types +import ZcashHaskell.Types -- | Check if given bytestring is a valid encoded unified address isValidUnifiedAddress :: BS.ByteString -> Bool diff --git a/src/HaskellZcash/Sapling.hs b/src/ZcashHaskell/Sapling.hs similarity index 50% rename from src/HaskellZcash/Sapling.hs rename to src/ZcashHaskell/Sapling.hs index eede6ac..ed6a81d 100644 --- a/src/HaskellZcash/Sapling.hs +++ b/src/ZcashHaskell/Sapling.hs @@ -1,6 +1,10 @@ -module HaskellZcash.Sapling where +module ZcashHaskell.Sapling where -import C.Zcash (rustWrapperIsShielded, rustWrapperSaplingVkDecode) +import C.Zcash + ( rustWrapperIsShielded + , rustWrapperSaplingCheck + , rustWrapperSaplingVkDecode + ) import qualified Data.ByteString as BS -- | Check if given bytesting is a valid encoded shielded address @@ -10,3 +14,7 @@ isValidShieldedAddress = rustWrapperIsShielded -- | Check if given bytestring is a valid Sapling viewing key isValidSaplingViewingKey :: BS.ByteString -> Bool isValidSaplingViewingKey = rustWrapperSaplingVkDecode + +-- | Check if the given bytestring for the Sapling viewing key matches the second bytestring for the address +matchSaplingAddress :: BS.ByteString -> BS.ByteString -> Bool +matchSaplingAddress = rustWrapperSaplingCheck diff --git a/src/HaskellZcash/Types.hs b/src/ZcashHaskell/Types.hs similarity index 98% rename from src/HaskellZcash/Types.hs rename to src/ZcashHaskell/Types.hs index e3966f6..adbe573 100644 --- a/src/HaskellZcash/Types.hs +++ b/src/ZcashHaskell/Types.hs @@ -5,7 +5,7 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE UndecidableInstances #-} -module HaskellZcash.Types where +module ZcashHaskell.Types where import qualified Data.ByteString as BS import Codec.Borsh diff --git a/src/HaskellZcash/Utils.hs b/src/ZcashHaskell/Utils.hs similarity index 94% rename from src/HaskellZcash/Utils.hs rename to src/ZcashHaskell/Utils.hs index 0bc6766..8c28cc9 100644 --- a/src/HaskellZcash/Utils.hs +++ b/src/ZcashHaskell/Utils.hs @@ -1,4 +1,4 @@ -module HaskellZcash.Utils where +module ZcashHaskell.Utils where import C.Zcash ( rustWrapperBech32Decode @@ -8,7 +8,7 @@ import C.Zcash import qualified Data.ByteString as BS import Foreign.Rust.Marshall.Variable -import HaskellZcash.Types +import ZcashHaskell.Types -- | Helper function to turn a hex-encoded strings to bytestring decodeHexText :: String -> BS.ByteString