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

Commit f45923f

Browse files
committed
Fix some of the comments to be specific to this special subclass, not Tryte
1 parent ad27006 commit f45923f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

iota/filters.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def _apply(self, value):
147147

148148
class AddressNoChecksum(Trytes):
149149
"""
150-
Validates a sequence as a sequence of trytes.
150+
Validates a sequence as an Address then chops off the checksum if it exists
151151
"""
152152

153153
def _apply(self, value):
@@ -163,6 +163,7 @@ def _apply(self, value):
163163

164164
# If the incoming value already is an Address then we just make sure it has no checksum
165165
if isinstance(value, Address):
166+
# Make sure it has a valid checksum if one exists
166167
if value.checksum and not value.is_checksum_valid():
167168
return self._invalid_value(
168169
value = value,
@@ -182,10 +183,11 @@ def _apply(self, value):
182183
except ValueError:
183184
return self._invalid_value(value, self.CODE_NOT_TRYTES, exc_info=True)
184185

185-
# Now coerce to the expected type and verify that there are no
186+
# Now coerce to an Address and verify that there are no
186187
# type-specific errors.
187188
try:
188189
addy = Address(value)
190+
# Make sure it has a valid checksum if one exists
189191
if addy.checksum and not addy.is_checksum_valid():
190192
return self._invalid_value(
191193
value = addy,
@@ -206,4 +208,4 @@ def _apply(self, value):
206208
template_vars = {
207209
'result_type': self.result_type.__name__,
208210
},
209-
)
211+
)

0 commit comments

Comments
 (0)