fn check(
        desc: Result<(Descriptor<DescriptorPublicKey>, KeyMap, ValidNetworks), DescriptorError>,
        is_witness: bool,
        is_fixed: bool,
        expected: &[&str],
    ) {
        let secp = Secp256k1::new();

        let (desc, _key_map, _networks) = desc.unwrap();
        assert_eq!(desc.is_witness(), is_witness);
        assert_eq!(!desc.is_deriveable(), is_fixed);
        for i in 0..expected.len() {
            let index = i as u32;
            let child_desc = if !desc.is_deriveable() {
                desc.as_derived_fixed(&secp)
            } else {
                desc.as_derived(index, &secp)
            };
            let address = child_desc.address(Regtest).unwrap();
            assert_eq!(address.to_string(), *expected.get(i).unwrap());
        }
    }
// verify template descriptor generates expected address(es)
verify template descriptor generates expected address(es)
verify template descriptor generates expected address ( es )
fn check(
        desc: Result<(Descriptor<DescriptorPublicKey>, KeyMap, ValidNetworks), DescriptorError>,
        is_witness: bool,
        is_fixed: bool,
        expected: &[&str],
    ) {
        let secp = Secp256k1::new();
        let (desc, _key_map, _networks) = desc.unwrap();
        assert_eq!(desc.is_witness(), is_witness);
        assert_eq!(!desc.is_deriveable(), is_fixed);
        for i in 0..expected.len() {
            let index = i as u32;
            let child_desc = if !desc.is_deriveable() {
                desc.as_derived_fixed(&secp)
            } else {
                desc.as_derived(index, &secp)
            };
            let address = child_desc.address(Regtest).unwrap();
            assert_eq!(address.to_string(), *expected.get(i).unwrap());
        }
    }
fn check ( desc : Result < ( Descriptor < DescriptorPublicKey > , KeyMap , ValidNetworks ) , DescriptorError > , is_witness : bool , is_fixed : bool , expected : & [ & str ] , ) { let secp = Secp256k1 :: new ( ) ; let ( desc , _key_map , _networks ) = desc . unwrap ( ) ; assert_eq ! ( desc is_witness ( ) is_witness ) ; assert_eq ! ( desc is_deriveable ( ) is_fixed ) ; for i in 0 .. expected . len ( ) { let index = i as u32 ; let child_desc = if ! desc . is_deriveable ( ) { desc . as_derived_fixed ( & secp ) } else { desc . as_derived ( index , & secp ) } ; let address = child_desc . address ( Regtest ) . unwrap ( ) ; assert_eq ! ( address to_string ( ) expected get ( i ) unwrap ( ) ) ; } }
verify template descriptor generates expected address(es)
verify template descriptor generates expected address ( es )
desc
Result<(Descriptor<DescriptorPublicKey>, KeyMap, ValidNetworks), DescriptorError>
is_witness
bool
is_fixed
bool
expected
&[&str]
desc
Result<(Descriptor<DescriptorPublicKey>, KeyMap, ValidNetworks), DescriptorError>
is_witness
bool
is_fixed
bool
expected
&[&str]