coinchooser: (trivial) add some type hints
This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from math import floor, log10
|
from math import floor, log10
|
||||||
from typing import NamedTuple, List, Callable, Sequence, Union, Dict, Tuple
|
from typing import NamedTuple, List, Callable, Sequence, Union, Dict, Tuple, Mapping, Type
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
|
||||||
from .bitcoin import sha256, COIN, is_address
|
from .bitcoin import sha256, COIN, is_address
|
||||||
@@ -478,7 +478,7 @@ class CoinChooserPrivacy(CoinChooserRandom):
|
|||||||
|
|
||||||
COIN_CHOOSERS = {
|
COIN_CHOOSERS = {
|
||||||
'Privacy': CoinChooserPrivacy,
|
'Privacy': CoinChooserPrivacy,
|
||||||
}
|
} # type: Mapping[str, Type[CoinChooserBase]]
|
||||||
|
|
||||||
def get_name(config):
|
def get_name(config):
|
||||||
kind = config.get('coin_chooser')
|
kind = config.get('coin_chooser')
|
||||||
@@ -486,7 +486,7 @@ def get_name(config):
|
|||||||
kind = 'Privacy'
|
kind = 'Privacy'
|
||||||
return kind
|
return kind
|
||||||
|
|
||||||
def get_coin_chooser(config):
|
def get_coin_chooser(config) -> CoinChooserBase:
|
||||||
klass = COIN_CHOOSERS[get_name(config)]
|
klass = COIN_CHOOSERS[get_name(config)]
|
||||||
# note: we enable enable_output_value_rounding by default as
|
# note: we enable enable_output_value_rounding by default as
|
||||||
# - for sacrificing a few satoshis
|
# - for sacrificing a few satoshis
|
||||||
|
|||||||
Reference in New Issue
Block a user