* Creates key pairs and corresponding outputs for the benchmark transactions. * - For Schnorr signatures: Creates simple key path spendable outputs * - For Ecdsa signatures: Creates P2WPKH (native SegWit v0) outputs * - All outputs have value of 1 BTC */
| 81 | * - All outputs have value of 1 BTC |
| 82 | */ |
| 83 | std::pair<std::vector<CKey>, std::vector<CTxOut>> CreateKeysAndOutputs(const CKey& coinbaseKey, size_t num_schnorr, size_t num_ecdsa) |
| 84 | { |
| 85 | std::vector<CKey> keys{coinbaseKey}; |
| 86 | keys.reserve(num_schnorr + num_ecdsa + 1); |
| 87 | |
| 88 | std::vector<CTxOut> outputs; |
| 89 | outputs.reserve(num_schnorr + num_ecdsa); |
| 90 | |
| 91 | for (size_t i{0}; i < num_ecdsa; ++i) { |
| 92 | keys.emplace_back(GenerateRandomKey()); |
| 93 | outputs.emplace_back(COIN, GetScriptForDestination(WitnessV0KeyHash{keys.back().GetPubKey()})); |
| 94 | } |
| 95 | |
| 96 | for (size_t i{0}; i < num_schnorr; ++i) { |
| 97 | keys.emplace_back(GenerateRandomKey()); |
| 98 | outputs.emplace_back(COIN, GetScriptForDestination(WitnessV1Taproot{XOnlyPubKey(keys.back().GetPubKey())})); |
| 99 | } |
| 100 | |
| 101 | return {keys, outputs}; |
| 102 | } |
| 103 | |
| 104 | void BenchmarkConnectBlock(benchmark::Bench& bench, std::vector<CKey>& keys, std::vector<CTxOut>& outputs, TestChain100Setup& test_setup) |
| 105 | { |
no test coverage detected