MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / run_verify_test

Function run_verify_test

src/test/kernel/test_kernel.cpp:209–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207};
208
209void run_verify_test(
210 const ScriptPubkey& spent_script_pubkey,
211 const Transaction& spending_tx,
212 const PrecomputedTransactionData* precomputed_txdata,
213 int64_t amount,
214 unsigned int input_index,
215 bool taproot)
216{
217 auto status = ScriptVerifyStatus::OK;
218
219 if (taproot) {
220 BOOST_CHECK(spent_script_pubkey.Verify(
221 amount,
222 spending_tx,
223 precomputed_txdata,
224 input_index,
225 ScriptVerificationFlags::ALL,
226 status));
227 BOOST_CHECK(status == ScriptVerifyStatus::OK);
228 } else {
229 BOOST_CHECK(!spent_script_pubkey.Verify(
230 amount,
231 spending_tx,
232 precomputed_txdata,
233 input_index,
234 ScriptVerificationFlags::ALL,
235 status));
236 BOOST_CHECK(status == ScriptVerifyStatus::ERROR_SPENT_OUTPUTS_REQUIRED);
237 }
238
239 BOOST_CHECK(spent_script_pubkey.Verify(
240 amount,
241 spending_tx,
242 precomputed_txdata,
243 input_index,
244 VERIFY_ALL_PRE_TAPROOT,
245 status));
246 BOOST_CHECK(status == ScriptVerifyStatus::OK);
247
248 BOOST_CHECK(spent_script_pubkey.Verify(
249 0,
250 spending_tx,
251 precomputed_txdata,
252 input_index,
253 VERIFY_ALL_PRE_SEGWIT,
254 status));
255 BOOST_CHECK(status == ScriptVerifyStatus::OK);
256}
257
258template <typename T>
259concept HasToBytes = requires(T t) {

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 1

VerifyMethod · 0.45

Tested by

no test coverage detected