File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 33from .core .settings import __version__ , version_split , DEFAULTS , DEFAULT_NETWORK
44from .utils .btlogging import logging
55from .utils .easy_imports import *
6+ import scalecodec .types
67
78
89def __getattr__ (name ):
@@ -13,3 +14,21 @@ def __getattr__(name):
1314 )
1415 return version_split
1516 raise AttributeError (f"module { __name__ } has no attribute { name } " )
17+
18+
19+ # the following patches the `scalecodec.types.Option.process` that allows for decoding certain extrinsics (specifically
20+ # the ones used by crowdloan using Option<scale_info::227>. There is a PR up for this: https://github.com/JAMdotTech/py-scale-codec/pull/134
21+ # and this patch will be removed when this is applied/released.
22+
23+
24+ def patched_process (self ):
25+ option_byte = self .get_next_bytes (1 )
26+
27+ if self .sub_type and option_byte != b"\x00 " :
28+ self .value_object = self .process_type (self .sub_type , metadata = self .metadata )
29+ return self .value_object .value
30+
31+ return None
32+
33+
34+ scalecodec .types .Option .process = patched_process
You can’t perform that action at this time.
0 commit comments