diff --git a/bittensor/subtensor.py b/bittensor/subtensor.py index cf48c219f2..d85983193e 100644 --- a/bittensor/subtensor.py +++ b/bittensor/subtensor.py @@ -92,18 +92,18 @@ T = TypeVar("T") - ####### -# Monkey patch in caching the get_decoder_class method +# Monkey patch in caching the convert_type_string method ####### -if hasattr(RuntimeConfiguration, "get_decoder_class"): - original_get_decoder_class = RuntimeConfiguration.get_decoder_class +if hasattr(RuntimeConfiguration, "convert_type_string"): + original_convert_type_string = RuntimeConfiguration.convert_type_string @functools.lru_cache(maxsize=None) - def cached_get_decoder_class(self, type_string): - return original_get_decoder_class(self, type_string) + def convert_type_string(cls, name): + return original_convert_type_string(cls, name) + + RuntimeConfiguration.convert_type_string = convert_type_string - RuntimeConfiguration.get_decoder_class = cached_get_decoder_class #######