aboutsummaryrefslogtreecommitdiff
path: root/tests/functional_tests/make_test_signature.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional_tests/make_test_signature.cc')
-rw-r--r--tests/functional_tests/make_test_signature.cc24
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/functional_tests/make_test_signature.cc b/tests/functional_tests/make_test_signature.cc
index 789523de5..f31816841 100644
--- a/tests/functional_tests/make_test_signature.cc
+++ b/tests/functional_tests/make_test_signature.cc
@@ -27,15 +27,16 @@
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdio.h>
+#include "misc_language.h"
#include "string_tools.h"
#include "rpc/rpc_payment_signature.h"
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 +56,23 @@ 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);
+ epee::misc_utils::sleep_no_w(1);
+ printf("%s\n", signature.c_str());
+ }
return 0;
CATCH_ENTRY_L0("main()", 1);
}