From ddaabcc5cd08d04be1d0e9020fb051cdee7ac32c Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Mon, 11 Mar 2024 15:48:27 -0500 Subject: [PATCH] Add test to check that Sapling receivers are unique --- test/Spec.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/Spec.hs b/test/Spec.hs index 0762410..6e815b3 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -476,6 +476,8 @@ main = do property $ prop_SaplingSpendingKey s it "Sapling receivers are valid" $ \s -> property $ prop_SaplingReceiver s + it "Sapling receivers are not the same" $ \s -> + property $ prop_SaplingRecRepeated s it "Orchard spending keys are valid" $ \s -> property $ prop_OrchardSpendingKey s it "Orchard receivers are valid" $ \s -> @@ -618,6 +620,11 @@ prop_SaplingReceiver s (NonNegative i) (NonNegative j) = genSaplingPaymentAddress (fromMaybe "" $ genSaplingSpendingKey s j) i =/= Nothing +prop_SaplingRecRepeated :: Seed -> NonNegative Int -> Property +prop_SaplingRecRepeated s (NonNegative i) = + genSaplingPaymentAddress (fromMaybe "" $ genSaplingSpendingKey s 1) i =/= + genSaplingPaymentAddress (fromMaybe "" $ genSaplingSpendingKey s 1) (i + 1) + -- | Generators genOrcArgs :: Gen (CoinType, Int, Int) genOrcArgs = do