Skip to content

Commit 362a3fb

Browse files
committed
Add proptest for try_preserving_privacy
Pin the invariant that non-empty candidates never yield `Empty`.
1 parent efc5b92 commit 362a3fb

4 files changed

Lines changed: 185 additions & 13 deletions

File tree

‎Cargo-minimal.lock‎

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,21 @@ dependencies = [
489489
"unicode-normalization",
490490
]
491491

492+
[[package]]
493+
name = "bit-set"
494+
version = "0.8.0"
495+
source = "registry+https://github.com/rust-lang/crates.io-index"
496+
checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3"
497+
dependencies = [
498+
"bit-vec",
499+
]
500+
501+
[[package]]
502+
name = "bit-vec"
503+
version = "0.8.0"
504+
source = "registry+https://github.com/rust-lang/crates.io-index"
505+
checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7"
506+
492507
[[package]]
493508
name = "bitcoin"
494509
version = "0.30.3"
@@ -2785,6 +2800,7 @@ dependencies = [
27852800
"once_cell",
27862801
"payjoin-test-utils",
27872802
"percent-encoding-rfc3986",
2803+
"proptest",
27882804
"reqwest",
27892805
"rustls 0.23.40",
27902806
"serde",
@@ -3138,6 +3154,25 @@ dependencies = [
31383154
"unicode-ident",
31393155
]
31403156

3157+
[[package]]
3158+
name = "proptest"
3159+
version = "1.11.0"
3160+
source = "registry+https://github.com/rust-lang/crates.io-index"
3161+
checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744"
3162+
dependencies = [
3163+
"bit-set",
3164+
"bit-vec",
3165+
"bitflags 2.11.1",
3166+
"num-traits",
3167+
"rand 0.9.4",
3168+
"rand_chacha 0.9.0",
3169+
"rand_xorshift",
3170+
"regex-syntax",
3171+
"rusty-fork",
3172+
"tempfile",
3173+
"unarray",
3174+
]
3175+
31413176
[[package]]
31423177
name = "prost"
31433178
version = "0.14.3"
@@ -3161,6 +3196,12 @@ dependencies = [
31613196
"syn 2.0.117",
31623197
]
31633198

3199+
[[package]]
3200+
name = "quick-error"
3201+
version = "1.2.3"
3202+
source = "registry+https://github.com/rust-lang/crates.io-index"
3203+
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
3204+
31643205
[[package]]
31653206
name = "quinn"
31663207
version = "0.11.9"
@@ -3335,6 +3376,15 @@ version = "0.10.1"
33353376
source = "registry+https://github.com/rust-lang/crates.io-index"
33363377
checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"
33373378

3379+
[[package]]
3380+
name = "rand_xorshift"
3381+
version = "0.4.0"
3382+
source = "registry+https://github.com/rust-lang/crates.io-index"
3383+
checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a"
3384+
dependencies = [
3385+
"rand_core 0.9.5",
3386+
]
3387+
33383388
[[package]]
33393389
name = "rcgen"
33403390
version = "0.12.1"
@@ -3651,6 +3701,18 @@ version = "1.0.22"
36513701
source = "registry+https://github.com/rust-lang/crates.io-index"
36523702
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
36533703

3704+
[[package]]
3705+
name = "rusty-fork"
3706+
version = "0.3.1"
3707+
source = "registry+https://github.com/rust-lang/crates.io-index"
3708+
checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2"
3709+
dependencies = [
3710+
"fnv",
3711+
"quick-error",
3712+
"tempfile",
3713+
"wait-timeout",
3714+
]
3715+
36543716
[[package]]
36553717
name = "ryu"
36563718
version = "1.0.23"
@@ -4701,6 +4763,12 @@ version = "0.1.7"
47014763
source = "registry+https://github.com/rust-lang/crates.io-index"
47024764
checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"
47034765

4766+
[[package]]
4767+
name = "unarray"
4768+
version = "0.1.4"
4769+
source = "registry+https://github.com/rust-lang/crates.io-index"
4770+
checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94"
4771+
47044772
[[package]]
47054773
name = "unicode-ident"
47064774
version = "1.0.24"
@@ -5036,6 +5104,15 @@ version = "0.9.5"
50365104
source = "registry+https://github.com/rust-lang/crates.io-index"
50375105
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
50385106

5107+
[[package]]
5108+
name = "wait-timeout"
5109+
version = "0.2.1"
5110+
source = "registry+https://github.com/rust-lang/crates.io-index"
5111+
checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11"
5112+
dependencies = [
5113+
"libc",
5114+
]
5115+
50395116
[[package]]
50405117
name = "want"
50415118
version = "0.3.1"

‎Cargo-recent.lock‎

Lines changed: 90 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,21 @@ dependencies = [
489489
"unicode-normalization",
490490
]
491491

492+
[[package]]
493+
name = "bit-set"
494+
version = "0.8.0"
495+
source = "registry+https://github.com/rust-lang/crates.io-index"
496+
checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3"
497+
dependencies = [
498+
"bit-vec",
499+
]
500+
501+
[[package]]
502+
name = "bit-vec"
503+
version = "0.8.0"
504+
source = "registry+https://github.com/rust-lang/crates.io-index"
505+
checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7"
506+
492507
[[package]]
493508
name = "bitcoin"
494509
version = "0.30.2"
@@ -672,11 +687,11 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
672687

673688
[[package]]
674689
name = "bitflags"
675-
version = "2.6.0"
690+
version = "2.13.0"
676691
source = "registry+https://github.com/rust-lang/crates.io-index"
677-
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
692+
checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8"
678693
dependencies = [
679-
"serde",
694+
"serde_core",
680695
]
681696

682697
[[package]]
@@ -2301,7 +2316,7 @@ version = "0.1.3"
23012316
source = "registry+https://github.com/rust-lang/crates.io-index"
23022317
checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
23032318
dependencies = [
2304-
"bitflags 2.6.0",
2319+
"bitflags 2.13.0",
23052320
"libc",
23062321
"redox_syscall 0.5.3",
23072322
]
@@ -2498,7 +2513,7 @@ version = "0.30.1"
24982513
source = "registry+https://github.com/rust-lang/crates.io-index"
24992514
checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6"
25002515
dependencies = [
2501-
"bitflags 2.6.0",
2516+
"bitflags 2.13.0",
25022517
"cfg-if",
25032518
"cfg_aliases",
25042519
"libc",
@@ -2761,6 +2776,7 @@ dependencies = [
27612776
"once_cell",
27622777
"payjoin-test-utils",
27632778
"percent-encoding-rfc3986",
2779+
"proptest",
27642780
"reqwest",
27652781
"rustls 0.23.31",
27662782
"serde",
@@ -3106,6 +3122,25 @@ dependencies = [
31063122
"unicode-ident",
31073123
]
31083124

3125+
[[package]]
3126+
name = "proptest"
3127+
version = "1.11.0"
3128+
source = "registry+https://github.com/rust-lang/crates.io-index"
3129+
checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744"
3130+
dependencies = [
3131+
"bit-set",
3132+
"bit-vec",
3133+
"bitflags 2.13.0",
3134+
"num-traits",
3135+
"rand 0.9.1",
3136+
"rand_chacha 0.9.0",
3137+
"rand_xorshift",
3138+
"regex-syntax",
3139+
"rusty-fork",
3140+
"tempfile",
3141+
"unarray",
3142+
]
3143+
31093144
[[package]]
31103145
name = "prost"
31113146
version = "0.14.3"
@@ -3129,6 +3164,12 @@ dependencies = [
31293164
"syn 2.0.106",
31303165
]
31313166

3167+
[[package]]
3168+
name = "quick-error"
3169+
version = "1.2.3"
3170+
source = "registry+https://github.com/rust-lang/crates.io-index"
3171+
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
3172+
31323173
[[package]]
31333174
name = "quinn"
31343175
version = "0.11.8"
@@ -3280,6 +3321,15 @@ dependencies = [
32803321
"getrandom 0.3.3",
32813322
]
32823323

3324+
[[package]]
3325+
name = "rand_xorshift"
3326+
version = "0.4.0"
3327+
source = "registry+https://github.com/rust-lang/crates.io-index"
3328+
checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a"
3329+
dependencies = [
3330+
"rand_core 0.9.3",
3331+
]
3332+
32833333
[[package]]
32843334
name = "rcgen"
32853335
version = "0.12.1"
@@ -3321,7 +3371,7 @@ version = "0.5.3"
33213371
source = "registry+https://github.com/rust-lang/crates.io-index"
33223372
checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4"
33233373
dependencies = [
3324-
"bitflags 2.6.0",
3374+
"bitflags 2.13.0",
33253375
]
33263376

33273377
[[package]]
@@ -3452,7 +3502,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
34523502
checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94"
34533503
dependencies = [
34543504
"base64 0.21.7",
3455-
"bitflags 2.6.0",
3505+
"bitflags 2.13.0",
34563506
"serde",
34573507
"serde_derive",
34583508
]
@@ -3463,7 +3513,7 @@ version = "0.29.0"
34633513
source = "registry+https://github.com/rust-lang/crates.io-index"
34643514
checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2"
34653515
dependencies = [
3466-
"bitflags 2.6.0",
3516+
"bitflags 2.13.0",
34673517
"fallible-iterator",
34683518
"fallible-streaming-iterator",
34693519
"hashlink 0.8.4",
@@ -3503,7 +3553,7 @@ version = "0.38.36"
35033553
source = "registry+https://github.com/rust-lang/crates.io-index"
35043554
checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36"
35053555
dependencies = [
3506-
"bitflags 2.6.0",
3556+
"bitflags 2.13.0",
35073557
"errno",
35083558
"libc",
35093559
"linux-raw-sys 0.4.14",
@@ -3516,7 +3566,7 @@ version = "1.0.7"
35163566
source = "registry+https://github.com/rust-lang/crates.io-index"
35173567
checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266"
35183568
dependencies = [
3519-
"bitflags 2.6.0",
3569+
"bitflags 2.13.0",
35203570
"errno",
35213571
"libc",
35223572
"linux-raw-sys 0.9.4",
@@ -3599,6 +3649,18 @@ version = "1.0.22"
35993649
source = "registry+https://github.com/rust-lang/crates.io-index"
36003650
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
36013651

3652+
[[package]]
3653+
name = "rusty-fork"
3654+
version = "0.3.1"
3655+
source = "registry+https://github.com/rust-lang/crates.io-index"
3656+
checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2"
3657+
dependencies = [
3658+
"fnv",
3659+
"quick-error",
3660+
"tempfile",
3661+
"wait-timeout",
3662+
]
3663+
36023664
[[package]]
36033665
name = "ryu"
36043666
version = "1.0.18"
@@ -3731,7 +3793,7 @@ version = "3.3.0"
37313793
source = "registry+https://github.com/rust-lang/crates.io-index"
37323794
checksum = "80fb1d92c5028aa318b4b8bd7302a5bfcf48be96a37fc6fc790f806b0004ee0c"
37333795
dependencies = [
3734-
"bitflags 2.6.0",
3796+
"bitflags 2.13.0",
37353797
"core-foundation",
37363798
"core-foundation-sys",
37373799
"libc",
@@ -4497,7 +4559,7 @@ version = "0.6.8"
44974559
source = "registry+https://github.com/rust-lang/crates.io-index"
44984560
checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8"
44994561
dependencies = [
4500-
"bitflags 2.6.0",
4562+
"bitflags 2.13.0",
45014563
"bytes",
45024564
"futures-util",
45034565
"http",
@@ -4643,6 +4705,12 @@ version = "0.1.6"
46434705
source = "registry+https://github.com/rust-lang/crates.io-index"
46444706
checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"
46454707

4708+
[[package]]
4709+
name = "unarray"
4710+
version = "0.1.4"
4711+
source = "registry+https://github.com/rust-lang/crates.io-index"
4712+
checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94"
4713+
46464714
[[package]]
46474715
name = "unicode-ident"
46484716
version = "1.0.12"
@@ -4972,6 +5040,15 @@ version = "0.9.5"
49725040
source = "registry+https://github.com/rust-lang/crates.io-index"
49735041
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
49745042

5043+
[[package]]
5044+
name = "wait-timeout"
5045+
version = "0.2.1"
5046+
source = "registry+https://github.com/rust-lang/crates.io-index"
5047+
checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11"
5048+
dependencies = [
5049+
"libc",
5050+
]
5051+
49755052
[[package]]
49765053
name = "want"
49775054
version = "0.3.1"
@@ -5423,7 +5500,7 @@ version = "0.39.0"
54235500
source = "registry+https://github.com/rust-lang/crates.io-index"
54245501
checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1"
54255502
dependencies = [
5426-
"bitflags 2.6.0",
5503+
"bitflags 2.13.0",
54275504
]
54285505

54295506
[[package]]

‎payjoin/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ ignored = ["bitcoin-units"]
6464
[dev-dependencies]
6565
once_cell = "1.21.3"
6666
payjoin-test-utils = { path = "../payjoin-test-utils", features = ["v2"] }
67+
proptest = "1"
6768
tokio = { version = "1.47.1", features = ["full"] }
6869
tracing = "0.1.41"
6970

0 commit comments

Comments
 (0)