diff --git a/bip380/miniscript/property.py b/bip380/miniscript/property.py index 31e52b0..29e4418 100644 --- a/bip380/miniscript/property.py +++ b/bip380/miniscript/property.py @@ -49,14 +49,8 @@ def has_any(self, properties): def check_valid(self): """Raises a MiniscriptPropertyError if the types/properties conflict""" # Can only be of a single type. - num_types = 0 - for typ in self.types: - if getattr(self, typ): - if num_types == 1: - raise MiniscriptPropertyError( - "A Miniscript fragment can only be of a single type" - ) - num_types += 1 + if len(self.type()) > 1: + raise MiniscriptPropertyError("A Miniscript fragment can only be of a single type") # Check for conflicts in type & properties. checks = [