mirror of
https://github.com/monero-project/monero.git
synced 2025-08-07 14:52:18 -04:00
functional_tests: speed up signature generation
Executing a new binary for each signature can get really slow
This commit is contained in:
parent
e69acffdc8
commit
f5a11f05fe
2 changed files with 29 additions and 5 deletions
|
@ -33,9 +33,9 @@
|
|||
int main(int argc, const char **argv)
|
||||
{
|
||||
TRY_ENTRY();
|
||||
if (argc > 2)
|
||||
if (argc > 3)
|
||||
{
|
||||
fprintf(stderr, "usage: %s <secret_key>\n", argv[0]);
|
||||
fprintf(stderr, "usage: %s [<secret_key> [N]]\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -55,8 +55,22 @@ int main(int argc, const char **argv)
|
|||
fprintf(stderr, "invalid secret key\n");
|
||||
return 1;
|
||||
}
|
||||
std::string signature = cryptonote::make_rpc_payment_signature(skey);
|
||||
printf("%s\n", signature.c_str());
|
||||
uint32_t count = 1;
|
||||
if (argc == 3)
|
||||
{
|
||||
int i = atoi(argv[2]);
|
||||
if (i <= 0)
|
||||
{
|
||||
fprintf(stderr, "invalid count\n");
|
||||
return 1;
|
||||
}
|
||||
count = (uint32_t)i;
|
||||
}
|
||||
while (count--)
|
||||
{
|
||||
std::string signature = cryptonote::make_rpc_payment_signature(skey);
|
||||
printf("%s\n", signature.c_str());
|
||||
}
|
||||
return 0;
|
||||
CATCH_ENTRY_L0("main()", 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue