mirror of
https://github.com/monero-project/monero
synced 2025-10-07 17:22:52 +02:00
functional_tests: fix piecemeal export in cold_signing
The `while` loop condition was incorrect, which could lead to incomplete imports. Also, setting `start` to an *undone* output speeds up the test by 16s on my machine.
This commit is contained in:
@@ -102,10 +102,8 @@ class ColdSigningTest():
|
|||||||
res = self.hot_wallet.incoming_transfers()
|
res = self.hot_wallet.incoming_transfers()
|
||||||
num_outputs = len(res.transfers)
|
num_outputs = len(res.transfers)
|
||||||
done = [False] * num_outputs
|
done = [False] * num_outputs
|
||||||
while len([x for x in done if not done[x]]) > 0:
|
while len([x for x in done if not x]) > 0:
|
||||||
start = int(random.random() * num_outputs)
|
start = random.choice([i for i in range(len(done)) if not done[i]]) # start at a random undone output
|
||||||
if start == num_outputs:
|
|
||||||
num_outputs -= 1
|
|
||||||
count = 1 + int(random.random() * 5)
|
count = 1 + int(random.random() * 5)
|
||||||
res = self.hot_wallet.export_outputs(all = True, start = start, count = count)
|
res = self.hot_wallet.export_outputs(all = True, start = start, count = count)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user