// Helper function to combine two Miniscript Infos of same key types
// Used to combine Infos from different scriptContexts
Helper function to combine two Miniscript Infos of same key types
Used to combine Infos from different scriptContexts
Helper function to combine two Miniscript Infos of same key types Used to combine Infos from different scriptContexts
fn combine(a: Option<Self>, b: Option<Self>) -> Option<Self> {
		match (a, b) {
			(None, None) => None,
			(None, Some(b)) => Some(b),
			(Some(a), None) => Some(a),
			(Some(a), Some(b)) => {
				debug_assert!(a.key_type == b.key_type);
				Some(Self {
					key_type: a.key_type,
					valid_script_contexts: ScriptContexts::or(
						a.valid_script_contexts,
						b.valid_script_contexts,
					),
					script_size: a.script_size,
					max_satisfaction_witness_elements: a
						.max_satisfaction_witness_elements
						.or(b.max_satisfaction_witness_elements),
					max_satisfaction_size_segwit: a
						.max_satisfaction_size_segwit
						.or(b.max_satisfaction_size_segwit),
					max_satisfaction_size_non_segwit: a
						.max_satisfaction_size_non_segwit
						.or(b.max_satisfaction_size_non_segwit),
					script: a.script,
					policy: a.policy.or(b.policy),
					requires_sig: a.requires_sig,
					non_malleable: ScriptContexts::or(a.non_malleable,b.non_malleable),
					within_resource_limits: ScriptContexts::or(a.within_resource_limits,b.within_resource_limits),
					has_mixed_timelocks: a.has_mixed_timelocks,
					has_repeated_keys: b.has_repeated_keys,
					sane_miniscript: ScriptContexts::or(a.sane_miniscript,b.sane_miniscript),
				})
			}
		}
	}
fn combine ( a : Option < Self > , b : Option < Self > ) -> Option < Self > { match ( a , b ) { ( None , None ) => None , ( None , Some ( b ) ) => Some ( b ) , ( Some ( a ) , None ) => Some ( a ) , ( Some ( a ) , Some ( b ) ) => { debug_assert ! ( a key_type b key_type ) ; Some ( Self { key_type : a . key_type , valid_script_contexts : ScriptContexts :: or ( a . valid_script_contexts , b . valid_script_contexts , ) , script_size : a . script_size , max_satisfaction_witness_elements : a . max_satisfaction_witness_elements . or ( b . max_satisfaction_witness_elements ) , max_satisfaction_size_segwit : a . max_satisfaction_size_segwit . or ( b . max_satisfaction_size_segwit ) , max_satisfaction_size_non_segwit : a . max_satisfaction_size_non_segwit . or ( b . max_satisfaction_size_non_segwit ) , script : a . script , policy : a . policy . or ( b . policy ) , requires_sig : a . requires_sig , non_malleable : ScriptContexts :: or ( a . non_malleable , b . non_malleable ) , within_resource_limits : ScriptContexts :: or ( a . within_resource_limits , b . within_resource_limits ) , has_mixed_timelocks : a . has_mixed_timelocks , has_repeated_keys : b . has_repeated_keys , sane_miniscript : ScriptContexts :: or ( a . sane_miniscript , b . sane_miniscript ) , } ) } } }
Helper function to combine two Miniscript Infos of same key types
Used to combine Infos from different scriptContexts
Helper function to combine two Miniscript Infos of same key types Used to combine Infos from different scriptContexts
a
Option<Self>
b
Option<Self>