Update UnifiedAddress to use named types for receivers

This commit is contained in:
Rene Vergara 2024-03-08 13:09:13 -06:00
parent db5a694e7d
commit 6e31d83963
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -279,19 +279,19 @@ instance FromJSON ShieldedOutput where
-- * Orchard -- * Orchard
-- | Type to represent a Unified Address -- | Type to represent a Unified Address
data UnifiedAddress = UnifiedAddress data UnifiedAddress = UnifiedAddress
{ ua_net :: ZcashNet { ua_net :: !ZcashNet
, o_rec :: BS.ByteString , o_rec :: !OrchardReceiver
, s_rec :: BS.ByteString , s_rec :: !SaplingReceiver
, t_rec :: Maybe TransparentAddress , t_rec :: !(Maybe TransparentAddress)
} deriving (Prelude.Show, Eq, Read) } deriving (Prelude.Show, Eq, Read)
-- | Helper type for marshalling UAs -- | Helper type for marshalling UAs
data RawUA = RawUA data RawUA = RawUA
{ raw_net :: Word8 { raw_net :: !Word8
, raw_o :: BS.ByteString , raw_o :: !BS.ByteString
, raw_s :: BS.ByteString , raw_s :: !BS.ByteString
, raw_t :: BS.ByteString , raw_t :: !BS.ByteString
, raw_to :: BS.ByteString , raw_to :: !BS.ByteString
} deriving stock (Eq, Prelude.Show, GHC.Generic) } deriving stock (Eq, Prelude.Show, GHC.Generic)
deriving anyclass (SOP.Generic, SOP.HasDatatypeInfo) deriving anyclass (SOP.Generic, SOP.HasDatatypeInfo)
deriving anyclass (Data.Structured.Show) deriving anyclass (Data.Structured.Show)