forked from Kixunil/bip21
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The following test does not actually utilize required parameters, it just checks that non-required parameters are omitted if not required, so it should probably be renamed, and a new test should be introduced that actually checks that parameters with req- prefix are mandatory and that they can be parsed correctly when required.
Lines 423 to 433 in 9362fab
| #[test] | |
| fn required_understood() { | |
| let input = "bitcoin:1andreas3batLhQa2FawWjeyjCqyBzypd?somethingyoudontunderstand=50&somethingelseyoudontget=999"; | |
| let uri = input.parse::<Uri<'_, _>>().unwrap().require_network(bitcoin::Network::Bitcoin).unwrap(); | |
| assert_eq!(uri.address.to_string(), "1andreas3batLhQa2FawWjeyjCqyBzypd"); | |
| assert!(uri.amount.is_none()); | |
| assert!(uri.label.is_none()); | |
| assert!(uri.message.is_none()); | |
| assert_eq!(uri.to_string(), "bitcoin:1andreas3batLhQa2FawWjeyjCqyBzypd"); | |
| } |
See payjoin/rust-payjoin#433 for related discussion
shinghim
Metadata
Metadata
Assignees
Labels
No labels