Functions to handle commitment tree nodes for Sapling and Orchard #100

Merged
pitmutt merged 50 commits from rav001 into milestone2 2024-11-15 18:48:36 +00:00
Showing only changes of commit 70927645e7 - Show all commits

View file

@ -722,6 +722,14 @@ instance FromJSON OrchardAction where
a <- obj .: "spendAuthSig" a <- obj .: "spendAuthSig"
pure $ OrchardAction n r c ephKey encText outText cval a pure $ OrchardAction n r c ephKey encText outText cval a
data MerklePath = MerklePath
{ mp_position :: !Int64
, mp_path :: ![HexString]
} deriving stock (Eq, Prelude.Show, GHC.Generic)
deriving anyclass (SOP.Generic, SOP.HasDatatypeInfo)
deriving anyclass (Data.Structured.Show)
deriving (BorshSize, ToBorsh, FromBorsh) via AsStruct MerklePath
-- | Type for a Orchard note commitment tree -- | Type for a Orchard note commitment tree
newtype OrchardCommitmentTree = OrchardCommitmentTree newtype OrchardCommitmentTree = OrchardCommitmentTree
{ orchTree :: HexString { orchTree :: HexString