File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,10 @@ class AcceptsHexStrMixin(encoding.BaseEncoder):
161
161
def __init__ (self , subencoder ):
162
162
self .subencoder = subencoder
163
163
164
+ @property
165
+ def is_dynamic (self ):
166
+ return self .subencoder .is_dynamic
167
+
164
168
@classmethod
165
169
def from_type_str (cls , abi_type , registry ):
166
170
subencoder_cls = cls .get_subencoder_class ()
@@ -183,8 +187,7 @@ def encode(self, value):
183
187
return self .subencoder .encode (normalized_value )
184
188
185
189
def validate_and_normalize (self , value ):
186
- # call this raw value
187
- original_value = value
190
+ raw_value = value
188
191
if is_text (value ):
189
192
try :
190
193
value = decode_hex (value )
@@ -194,13 +197,13 @@ def validate_and_normalize(self, value):
194
197
msg = f'{ value } is an invalid hex string' ,
195
198
)
196
199
else :
197
- if original_value [:2 ] != '0x' :
200
+ if raw_value [:2 ] != '0x' :
198
201
if self .is_strict :
199
202
self .invalidate_value (
200
- original_value ,
203
+ raw_value ,
201
204
msg = 'hex string must be prefixed with 0x'
202
205
)
203
- elif original_value [:2 ] != '0x' :
206
+ elif raw_value [:2 ] != '0x' :
204
207
warnings .warn (
205
208
'in v6 it will be invalid to pass a hex string without the "0x" prefix' ,
206
209
category = DeprecationWarning
You can’t perform that action at this time.
0 commit comments