Skip to content

Commit

Permalink
Typing nit in asert_daa.py
Browse files Browse the repository at this point in the history
Technically EC sometimes stores the ts as a float or an int (I'm unclear
on when it does either) -- so type annocation should reflect that
sometimes the ts can be int or float.  For the actual calculation it
doesn't matter so much.
  • Loading branch information
cculianu committed Aug 11, 2020
1 parent be0a535 commit 08a7c68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/asert_daa.py
Expand Up @@ -23,7 +23,7 @@
import os

from collections import namedtuple
from typing import Optional
from typing import Optional, Union

from .util import print_error

Expand Down Expand Up @@ -111,7 +111,7 @@ def target_to_hex(target: int) -> str:
h = hex(target)[2:]
return '0' * (64 - len(h)) + h

def next_bits_aserti3_2d(self, anchor_bits: int, time_diff: float, height_diff: int) -> int:
def next_bits_aserti3_2d(self, anchor_bits: int, time_diff: Union[float, int], height_diff: int) -> int:
""" Integer ASERTI algorithm, based on Jonathan Toomim's
`next_bits_aserti` implementation in mining.py (see
https://github.com/jtoomim/difficulty) """
Expand Down

0 comments on commit 08a7c68

Please sign in to comment.