def get_backend(cls): from eth_keys.backends import get_backend if cls._backend is None: return get_backend() else: return cls._backend
def backend(self): from eth_keys.backends import get_backend if self._backend is None: return get_backend() else: return self._backend
def get_backend(cls): # type: () -> BaseECCBackend from eth_keys.backends import get_backend if cls._backend is None: return get_backend() else: return cls._backend
def backend(self): # type: () -> BaseECCBackend from eth_keys.backends import get_backend if self._backend is None: return get_backend() else: return self._backend
def __init__(self, backend=None): if backend is None: pass elif isinstance(backend, BaseECCBackend): pass elif isinstance(backend, type) and issubclass(backend, BaseECCBackend): backend = backend() elif is_string(backend): backend = get_backend(backend) else: raise ValueError( "Unsupported format for ECC backend. Must be an instance or " "subclass of `eth_keys.backends.BaseECCBackend` or a string of " "the dot-separated import path for the desired backend class") self.backend = backend
def get_backend(cls, *args: Any, **kwargs: Any) -> 'BaseECCBackend': from eth_keys.backends import get_backend return get_backend(*args, **kwargs)
def backend(self): if self._backend is None: return get_backend() else: return self._backend