RPC Server #103

Merged
pitmutt merged 129 commits from rav001 into milestone3 2024-11-21 15:30:22 +00:00
2 changed files with 13 additions and 28 deletions
Showing only changes of commit 165977eecf - Show all commits

View file

@ -24,7 +24,7 @@ import ZcashHaskell.Types
, TransparentAddress(..) , TransparentAddress(..)
, UnifiedAddress(..) , UnifiedAddress(..)
, ZcashNet(..) , ZcashNet(..)
, ValidAddress(..) , ValidAddress(..)
, ExchangeAddress(..) , ExchangeAddress(..)
) )
import Zenith.Types import Zenith.Types
@ -126,7 +126,7 @@ isRecipientValid a = do
Nothing -> False) Nothing -> False)
isUnifiedAddressValid :: T.Text -> Bool isUnifiedAddressValid :: T.Text -> Bool
isUnifiedAddressValid ua = isUnifiedAddressValid ua =
case isValidUnifiedAddress (E.encodeUtf8 ua) of case isValidUnifiedAddress (E.encodeUtf8 ua) of
Just _a1 -> True Just _a1 -> True
Nothing -> False Nothing -> False
@ -135,41 +135,26 @@ isSaplingAddressValid :: T.Text -> Bool
isSaplingAddressValid sa = isValidShieldedAddress (E.encodeUtf8 sa) isSaplingAddressValid sa = isValidShieldedAddress (E.encodeUtf8 sa)
isTransparentAddressValid :: T.Text -> Bool isTransparentAddressValid :: T.Text -> Bool
isTransparentAddressValid ta = isTransparentAddressValid ta =
case decodeTransparentAddress (E.encodeUtf8 ta) of case decodeTransparentAddress (E.encodeUtf8 ta) of
Just _a3 -> True Just _a3 -> True
Nothing -> False Nothing -> False
isExchangeAddressValid :: T.Text -> Bool isExchangeAddressValid :: T.Text -> Bool
isExchangeAddressValid xa = isExchangeAddressValid xa =
case decodeExchangeAddress (E.encodeUtf8 xa) of case decodeExchangeAddress (E.encodeUtf8 xa) of
Just _a4 -> True Just _a4 -> True
Nothing -> False Nothing -> False
isRecipientValidGUI :: PrivacyPolicy -> T.Text -> Bool isRecipientValidGUI :: PrivacyPolicy -> T.Text -> Bool
isRecipientValidGUI p a = do isRecipientValidGUI p a = do
let adr = (parseAddress a) let adr = parseAddress a
case adr of case p of
Just a -> Full -> True
case p of Medium -> True
Full -> case a of Low -> False
Unified ua -> True None -> False
Sapling sa -> True
_ -> False
Medium -> case a of
Unified ua -> True
Sapling sa -> True
_ -> False
Low -> case a of
Unified ua -> True
Sapling sa -> True
Transparent ta -> True
Exchange ea -> True
None -> case a of
Transparent ta -> True
Exchange ea -> True
_ -> False
isZecAddressValid :: T.Text -> Bool isZecAddressValid :: T.Text -> Bool
isZecAddressValid a = do isZecAddressValid a = do
case isValidUnifiedAddress (E.encodeUtf8 a) of case isValidUnifiedAddress (E.encodeUtf8 a) of

@ -1 +1 @@
Subproject commit 7965dc38c48da348f503a52ee10042fffc43f32c Subproject commit 12296026a0ebb9a5afe0904b251c5d31080eab18