Generate JS for trydecryptnotes, make number of addresses a variable
This commit is contained in:
@@ -2454,8 +2454,7 @@ Value zc_benchmark(const json_spirit::Array& params, bool fHelp)
|
||||
|
||||
JSDescription samplejoinsplit;
|
||||
|
||||
if (benchmarktype == "verifyjoinsplit" ||
|
||||
benchmarktype == "trydecryptnotes") {
|
||||
if (benchmarktype == "verifyjoinsplit") {
|
||||
CDataStream ss(ParseHexV(params[2].get_str(), "js"), SER_NETWORK, PROTOCOL_VERSION);
|
||||
ss >> samplejoinsplit;
|
||||
}
|
||||
@@ -2482,7 +2481,8 @@ Value zc_benchmark(const json_spirit::Array& params, bool fHelp)
|
||||
} else if (benchmarktype == "validatelargetx") {
|
||||
sample_times.push_back(benchmark_large_tx());
|
||||
} else if (benchmarktype == "trydecryptnotes") {
|
||||
sample_times.push_back(benchmark_try_decrypt_notes(samplejoinsplit));
|
||||
int nAddrs = params[2].get_int();
|
||||
sample_times.push_back(benchmark_try_decrypt_notes(nAddrs));
|
||||
} else if (benchmarktype == "incnotewitnesses") {
|
||||
int nTxs = params[2].get_int();
|
||||
sample_times.push_back(benchmark_increment_note_witnesses(nTxs));
|
||||
|
||||
@@ -224,19 +224,16 @@ double benchmark_large_tx()
|
||||
return timer_stop(tv_start);
|
||||
}
|
||||
|
||||
double benchmark_try_decrypt_notes(const JSDescription &joinsplit)
|
||||
double benchmark_try_decrypt_notes(size_t nAddrs)
|
||||
{
|
||||
const size_t NUM_ADDRS = 10;
|
||||
|
||||
CWallet wallet;
|
||||
for (int i = 0; i < NUM_ADDRS; i++) {
|
||||
for (int i = 0; i < nAddrs; i++) {
|
||||
auto sk = libzcash::SpendingKey::random();
|
||||
wallet.AddSpendingKey(sk);
|
||||
}
|
||||
|
||||
CMutableTransaction mtx;
|
||||
mtx.vjoinsplit.push_back(joinsplit);
|
||||
CTransaction tx(mtx);
|
||||
auto sk = libzcash::SpendingKey::random();
|
||||
auto tx = GetValidReceive(*pzcashParams, sk, 10, true);
|
||||
|
||||
struct timeval tv_start;
|
||||
timer_start(tv_start);
|
||||
|
||||
@@ -12,7 +12,7 @@ extern std::vector<double> benchmark_solve_equihash_threaded(int nThreads);
|
||||
extern double benchmark_verify_joinsplit(const JSDescription &joinsplit);
|
||||
extern double benchmark_verify_equihash();
|
||||
extern double benchmark_large_tx();
|
||||
extern double benchmark_try_decrypt_notes(const JSDescription &joinsplit);
|
||||
extern double benchmark_try_decrypt_notes(size_t nAddrs);
|
||||
extern double benchmark_increment_note_witnesses(size_t nTxs);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user