Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_import_rescan.py
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | |||||
# track of expected balances and transactions. | # track of expected balances and transactions. | ||||
ImportNode = collections.namedtuple("ImportNode", "prune rescan") | ImportNode = collections.namedtuple("ImportNode", "prune rescan") | ||||
IMPORT_NODES = [ImportNode(*fields) | IMPORT_NODES = [ImportNode(*fields) | ||||
for fields in itertools.product((False, True), repeat=2)] | for fields in itertools.product((False, True), repeat=2)] | ||||
# Rescans start at the earliest block up to 2 hours before the key timestamp. | # Rescans start at the earliest block up to 2 hours before the key timestamp. | ||||
TIMESTAMP_WINDOW = 2 * 60 * 60 | TIMESTAMP_WINDOW = 2 * 60 * 60 | ||||
AMOUNT_DUST = 0.00000546 | AMOUNT_DUST = 5.46 | ||||
def get_rand_amount(): | def get_rand_amount(): | ||||
r = random.uniform(AMOUNT_DUST, 1) | r = random.uniform(AMOUNT_DUST, 1000000) | ||||
return Decimal(str(round(r, 8))) | return Decimal(str(round(r, 2))) | ||||
class ImportRescanTest(BitcoinTestFramework): | class ImportRescanTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.num_nodes = 2 + len(IMPORT_NODES) | self.num_nodes = 2 + len(IMPORT_NODES) | ||||
self.supports_cli = False | self.supports_cli = False | ||||
def skip_test_if_missing_module(self): | def skip_test_if_missing_module(self): | ||||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |