remove unused checksum, add typing
This commit is contained in:
parent
d9460dcd9e
commit
510d88fff1
3 changed files with 4 additions and 7 deletions
|
@ -22,9 +22,6 @@ CURRENCIES = {
|
|||
'LBC': {'type': 'crypto'},
|
||||
'USD': {'type': 'fiat'},
|
||||
}
|
||||
HEADERS_FILE_SHA256_CHECKSUM = (
|
||||
590383, '71ff515ab728467a35a1484ca8c29ad2bfae3ea77753f9d3dfc64743121e7129'
|
||||
)
|
||||
|
||||
|
||||
class Setting(typing.Generic[T]):
|
||||
|
|
|
@ -165,4 +165,4 @@ class ComponentManager:
|
|||
raise NameError(component_name)
|
||||
|
||||
def has_component(self, component_name):
|
||||
return any(component.component_name == component_name for component in self.components)
|
||||
return any(component for component in self.components if component_name == component.component_name)
|
||||
|
|
|
@ -119,7 +119,7 @@ class HeadersComponent(Component):
|
|||
def _round_progress(self, local_height, remote_height):
|
||||
return min(max(math.ceil(float(local_height) / float(remote_height) * 100), 0), 100)
|
||||
|
||||
async def get_status(self):
|
||||
async def get_status(self) -> dict:
|
||||
progress = None
|
||||
if self.is_downloading_headers:
|
||||
progress = self._headers_progress_percent
|
||||
|
@ -161,7 +161,7 @@ class HeadersComponent(Component):
|
|||
self.headers.bytes_size, final_size_after_download
|
||||
)
|
||||
|
||||
def local_header_file_size(self):
|
||||
def local_header_file_size(self) -> int:
|
||||
if os.path.isfile(self.headers_file):
|
||||
return os.stat(self.headers_file).st_size
|
||||
return 0
|
||||
|
@ -175,7 +175,7 @@ class HeadersComponent(Component):
|
|||
except OSError:
|
||||
log.exception("Failed to download headers using https.")
|
||||
|
||||
async def should_download_headers_from_s3(self):
|
||||
async def should_download_headers_from_s3(self) -> bool:
|
||||
if self.conf.blockchain_name != "lbrycrd_main":
|
||||
return False
|
||||
s3_headers_depth = self.conf.s3_headers_depth
|
||||
|
|
Loading…
Reference in a new issue