aboutsummaryrefslogtreecommitdiff
path: root/tests/functional_tests/rpc_payment.py
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-01-27 16:31:43 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-03-26 11:33:58 +0000
commitf5a11f05feca2016d0802f01b48f602c70408e51 (patch)
treea7e1fcb2bcaf87abfd27518e86232a0c87b748bb /tests/functional_tests/rpc_payment.py
parentfunctional_tests: update cookie at 10 seconds interval (diff)
downloadmonero-f5a11f05feca2016d0802f01b48f602c70408e51.tar.xz
functional_tests: speed up signature generation
Executing a new binary for each signature can get really slow
Diffstat (limited to 'tests/functional_tests/rpc_payment.py')
-rwxr-xr-xtests/functional_tests/rpc_payment.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/functional_tests/rpc_payment.py b/tests/functional_tests/rpc_payment.py
index 90c5e1211..3bf995f0c 100755
--- a/tests/functional_tests/rpc_payment.py
+++ b/tests/functional_tests/rpc_payment.py
@@ -44,6 +44,7 @@ class RPCPaymentTest():
self.make_test_signature = os.environ['MAKE_TEST_SIGNATURE']
assert len(self.make_test_signature) > 0
self.secret_key, self.public_key = self.get_keys()
+ self.signatures = []
self.reset()
self.test_access_tracking()
self.test_access_mining()
@@ -57,8 +58,17 @@ class RPCPaymentTest():
assert len(fields) == 2
return fields
+ def refill_signatures(self):
+ signatures = subprocess.check_output([self.make_test_signature, self.secret_key, '256']).decode('utf-8')
+ for line in signatures.split():
+ self.signatures.append(line.rstrip())
+
def get_signature(self):
- return subprocess.check_output([self.make_test_signature, self.secret_key]).decode('utf-8').rstrip()
+ if len(self.signatures) == 0:
+ self.refill_signatures()
+ s = self.signatures[0]
+ self.signatures = self.signatures[1:]
+ return s
def reset(self):
print('Resetting blockchain')