| 20 | } |
| 21 | |
| 22 | void CheckTimeLock(const std::string& base64_psbt, std::optional<uint32_t> timelock) |
| 23 | { |
| 24 | util::Result<PartiallySignedTransaction> psbt = DecodeBase64PSBT(base64_psbt); |
| 25 | BOOST_CHECK(psbt); |
| 26 | |
| 27 | std::optional<uint32_t> computed_timelock = psbt->ComputeTimeLock(); |
| 28 | std::optional<CMutableTransaction> tx = psbt->GetUnsignedTx(); |
| 29 | if (timelock) { |
| 30 | BOOST_CHECK(computed_timelock); |
| 31 | BOOST_CHECK_EQUAL(*computed_timelock, *timelock); |
| 32 | BOOST_CHECK(tx); |
| 33 | BOOST_CHECK_EQUAL(tx->nLockTime, *timelock); |
| 34 | } else { |
| 35 | BOOST_CHECK(!computed_timelock); |
| 36 | BOOST_CHECK(!tx); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | BOOST_AUTO_TEST_CASE(psbt2_timelock_test) |
| 41 | { |
no test coverage detected