Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Commit b5263df

Browse files
committed
Thanks to the test cases I understand a bit more how the super and _apply work. All tests now pass.
1 parent 7cc797b commit b5263df

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

iota/filters.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,20 +161,14 @@ def __init__(self):
161161
def _apply(self, value):
162162
super(AddressNoChecksum, self)._apply(value)
163163

164+
if self._has_errors:
165+
return None
166+
167+
# Possible it's still just a TryteString
164168
if not isinstance(value, Address):
165-
try:
166-
value = Address(value)
167-
except ValueError:
168-
return self._invalid_value(
169-
value = value,
170-
reason = self.CODE_WRONG_FORMAT,
171-
exc_info = True,
172-
173-
template_vars = {
174-
'result_type': self.result_type.__name__,
175-
},
176-
)
169+
value = Address(value)
177170

171+
# Bail out if we have a bad checksum
178172
if value.checksum and not value.is_checksum_valid():
179173
return self._invalid_value(
180174
value = value,

0 commit comments

Comments
 (0)