diff --git a/src/test/blsct/wallet/address_tests.cpp b/src/test/blsct/wallet/address_tests.cpp index 5fbd00738bb2a3..6c670774dcae5e 100644 --- a/src/test/blsct/wallet/address_tests.cpp +++ b/src/test/blsct/wallet/address_tests.cpp @@ -31,8 +31,8 @@ BOOST_FIXTURE_TEST_CASE(address_test, BasicTestingSetup) blsct::PublicKey viewKey; blsct::PublicKey spendKey; - BOOST_ASSERT(subAddressDoubleKey.GetViewKey(viewKey)); - BOOST_ASSERT(subAddressDoubleKey.GetSpendKey(spendKey)); + Assert(subAddressDoubleKey.GetViewKey(viewKey)); + Assert(subAddressDoubleKey.GetSpendKey(spendKey)); BOOST_CHECK(viewKey.ToString() == "809ad665b3de4e1d44d835f1b8de36aafeea3279871aeceb56dbdda90c0426c022e8a6dda7313dc5e4c1817287805e3b"); diff --git a/src/test/blsct/wallet/chain_tests.cpp b/src/test/blsct/wallet/chain_tests.cpp index aeb0857b0b8faa..3661cf90629bc2 100644 --- a/src/test/blsct/wallet/chain_tests.cpp +++ b/src/test/blsct/wallet/chain_tests.cpp @@ -41,12 +41,12 @@ BOOST_FIXTURE_TEST_CASE(SyncTest, TestBLSCTChain100Setup) auto available_coins = AvailableCoins(*wallet); std::vector coins = available_coins.All(); - BOOST_ASSERT(coins.size() == 1); + Assert(coins.size() == 1); // Create Transaction sending to another address auto tx = blsct::TxFactory::CreateTransaction(wallet.get(), wallet->GetOrCreateBLSCTKeyMan(), blsct::SubAddress(), 1 * COIN, "test"); - BOOST_ASSERT(tx != std::nullopt); + Assert(tx != std::nullopt); auto block = CreateAndProcessBlock({tx.value()}, walletDestination); diff --git a/src/test/blsct/wallet/txfactory_tests.cpp b/src/test/blsct/wallet/txfactory_tests.cpp index a3aca5ad37041c..e2c9f33c7465c6 100644 --- a/src/test/blsct/wallet/txfactory_tests.cpp +++ b/src/test/blsct/wallet/txfactory_tests.cpp @@ -29,12 +29,12 @@ BOOST_FIXTURE_TEST_CASE(ismine_test, TestingSetup) auto recvAddress = std::get(blsct_km->GetNewDestination(0).value()); auto out = blsct::CreateOutput(recvAddress, 1000, "test"); - BOOST_ASSERT(blsct_km->IsMine(out.out)); + Assert(blsct_km->IsMine(out.out)); auto hashId = blsct_km->GetHashId(out.out); blsct::SubAddress subAddressId; - BOOST_ASSERT(blsct_km->GetSubAddress(hashId, subAddressId)); + Assert(blsct_km->GetSubAddress(hashId, subAddressId)); auto result = blsct_km->RecoverOutputs({out.out}); @@ -75,23 +75,23 @@ BOOST_FIXTURE_TEST_CASE(createtransaction_test, TestingSetup) CCoinsViewCache coins_view_cache{&base, /*deterministic=*/true}; coins_view_cache.SetBestBlock(InsecureRand256()); coins_view_cache.AddCoin(outpoint, std::move(coin), true); - BOOST_ASSERT(coins_view_cache.Flush()); + Assert(coins_view_cache.Flush()); } CCoinsViewCache coins_view_cache{&base, /*deterministic=*/true}; - BOOST_ASSERT(tx.AddInput(coins_view_cache, outpoint)); + Assert(tx.AddInput(coins_view_cache, outpoint)); tx.AddOutput(recvAddress, 900 * COIN, "test"); auto finalTx = tx.BuildTx(); - BOOST_ASSERT(finalTx.has_value()); - BOOST_ASSERT(blsct::VerifyTx(CTransaction(finalTx.value()), coins_view_cache)); + Assert(finalTx.has_value()); + Assert(blsct::VerifyTx(CTransaction(finalTx.value()), coins_view_cache)); bool fFoundChange = false; // Wallet does not have the coins available yet - BOOST_ASSERT(blsct::TxFactory::CreateTransaction(wallet, wallet->GetOrCreateBLSCTKeyMan(), recvAddress, 900 * COIN, "test") == std::nullopt); + Assert(blsct::TxFactory::CreateTransaction(wallet, wallet->GetOrCreateBLSCTKeyMan(), recvAddress, 900 * COIN, "test") == std::nullopt); auto result = blsct_km->RecoverOutputs(finalTx.value().vout); @@ -99,12 +99,12 @@ BOOST_FIXTURE_TEST_CASE(createtransaction_test, TestingSetup) if (res.message == "Change" && res.amount == (1000 - 900 - 0.006) * COIN) fFoundChange = true; } - BOOST_ASSERT(fFoundChange); + Assert(fFoundChange); wallet->transactionAddedToMempool(MakeTransactionRef(finalTx.value())); // Wallet does not have the coins available yet (not confirmed in block) - BOOST_ASSERT(blsct::TxFactory::CreateTransaction(wallet, wallet->GetOrCreateBLSCTKeyMan(), recvAddress, 900 * COIN, "test") == std::nullopt); + Assert(blsct::TxFactory::CreateTransaction(wallet, wallet->GetOrCreateBLSCTKeyMan(), recvAddress, 900 * COIN, "test") == std::nullopt); } BOOST_FIXTURE_TEST_CASE(addinput_test, TestingSetup) @@ -137,18 +137,18 @@ BOOST_FIXTURE_TEST_CASE(addinput_test, TestingSetup) CCoinsViewCache coins_view_cache{&base, /*deterministic=*/true}; coins_view_cache.SetBestBlock(InsecureRand256()); coins_view_cache.AddCoin(outpoint, std::move(coin), true); - BOOST_ASSERT(coins_view_cache.Flush()); + Assert(coins_view_cache.Flush()); } CCoinsViewCache coins_view_cache{&base, /*deterministic=*/true}; - BOOST_ASSERT(tx.AddInput(coins_view_cache, outpoint)); + Assert(tx.AddInput(coins_view_cache, outpoint)); tx.AddOutput(recvAddress, 900 * COIN, "test"); auto finalTx = tx.BuildTx(); - BOOST_ASSERT(finalTx.has_value()); - BOOST_ASSERT(blsct::VerifyTx(CTransaction(finalTx.value()), coins_view_cache)); + Assert(finalTx.has_value()); + Assert(blsct::VerifyTx(CTransaction(finalTx.value()), coins_view_cache)); bool fFoundChange = false; @@ -158,12 +158,12 @@ BOOST_FIXTURE_TEST_CASE(addinput_test, TestingSetup) if (res.message == "Change" && res.amount == (1000 - 900 - 0.006) * COIN) fFoundChange = true; } - BOOST_ASSERT(fFoundChange); + Assert(fFoundChange); wallet->transactionAddedToMempool(MakeTransactionRef(finalTx.value())); auto wtx = wallet->GetWalletTx(finalTx.value().GetHash()); - BOOST_ASSERT(wtx != nullptr); + Assert(wtx != nullptr); fFoundChange = false; uint32_t nChangePosition = 0; @@ -176,7 +176,7 @@ BOOST_FIXTURE_TEST_CASE(addinput_test, TestingSetup) } } - BOOST_ASSERT(fFoundChange); + Assert(fFoundChange); auto tx2 = blsct::TxFactory(blsct_km); auto outpoint2 = COutPoint(finalTx.value().GetHash(), nChangePosition); @@ -185,7 +185,7 @@ BOOST_FIXTURE_TEST_CASE(addinput_test, TestingSetup) coin2.out = finalTx.value().vout[nChangePosition]; coins_view_cache.AddCoin(outpoint2, std::move(coin2), true); - BOOST_ASSERT(tx2.AddInput(coins_view_cache, outpoint2)); + Assert(tx2.AddInput(coins_view_cache, outpoint2)); blsct::SubAddress randomAddress(blsct::DoublePublicKey(MclG1Point::MapToPoint("test1"), MclG1Point::MapToPoint("test2"))); tx2.AddOutput(randomAddress, 50 * COIN, "test"); @@ -193,8 +193,8 @@ BOOST_FIXTURE_TEST_CASE(addinput_test, TestingSetup) auto finalTx2 = tx2.BuildTx(); wallet->transactionAddedToMempool(MakeTransactionRef(finalTx2.value())); - BOOST_ASSERT(wallet->GetDebit(CTransaction(finalTx2.value()), wallet::ISMINE_SPENDABLE_BLSCT) == (1000 - 900 - 0.006) * COIN); - BOOST_ASSERT(TxGetCredit(*wallet, CTransaction(finalTx2.value()), wallet::ISMINE_SPENDABLE_BLSCT) == (1000 - 900 - 0.006 - 50 - 0.006) * COIN); + Assert(wallet->GetDebit(CTransaction(finalTx2.value()), wallet::ISMINE_SPENDABLE_BLSCT) == (1000 - 900 - 0.006) * COIN); + Assert(TxGetCredit(*wallet, CTransaction(finalTx2.value()), wallet::ISMINE_SPENDABLE_BLSCT) == (1000 - 900 - 0.006 - 50 - 0.006) * COIN); } BOOST_AUTO_TEST_SUITE_END() \ No newline at end of file diff --git a/src/test/blsct/wallet/validation_tests.cpp b/src/test/blsct/wallet/validation_tests.cpp index 9d518a2f18171b..2441fb24147372 100644 --- a/src/test/blsct/wallet/validation_tests.cpp +++ b/src/test/blsct/wallet/validation_tests.cpp @@ -45,18 +45,18 @@ BOOST_FIXTURE_TEST_CASE(validation_test, TestingSetup) CCoinsViewCache coins_view_cache{&base, /*deterministic=*/true}; coins_view_cache.SetBestBlock(InsecureRand256()); coins_view_cache.AddCoin(outpoint, std::move(coin), true); - BOOST_ASSERT(coins_view_cache.Flush()); + Assert(coins_view_cache.Flush()); } CCoinsViewCache coins_view_cache{&base, /*deterministic=*/true}; - BOOST_ASSERT(tx.AddInput(coins_view_cache, outpoint)); + Assert(tx.AddInput(coins_view_cache, outpoint)); tx.AddOutput(recvAddress, 900 * COIN, "test"); auto finalTx = tx.BuildTx(); - BOOST_ASSERT(finalTx.has_value()); - BOOST_ASSERT(blsct::VerifyTx(CTransaction(finalTx.value()), coins_view_cache)); + Assert(finalTx.has_value()); + Assert(blsct::VerifyTx(CTransaction(finalTx.value()), coins_view_cache)); } BOOST_FIXTURE_TEST_CASE(validation_reward_test, TestingSetup) @@ -70,8 +70,8 @@ BOOST_FIXTURE_TEST_CASE(validation_reward_test, TestingSetup) tx.vout.push_back(out.out); tx.txSig = out.GetSignature(); - BOOST_ASSERT(!blsct::VerifyTx(CTransaction(tx), coins_view_cache)); - BOOST_ASSERT(blsct::VerifyTx(CTransaction(tx), coins_view_cache, 900 * COIN)); + Assert(!blsct::VerifyTx(CTransaction(tx), coins_view_cache)); + Assert(blsct::VerifyTx(CTransaction(tx), coins_view_cache, 900 * COIN)); } BOOST_AUTO_TEST_SUITE_END() \ No newline at end of file diff --git a/src/wallet/test/coinselector_tests.cpp b/src/wallet/test/coinselector_tests.cpp index 7f66179517a4c3..b96e3344253651 100644 --- a/src/wallet/test/coinselector_tests.cpp +++ b/src/wallet/test/coinselector_tests.cpp @@ -431,7 +431,7 @@ BOOST_AUTO_TEST_CASE(bnb_search_test) CAmount selection_target = 16 * CENT; const auto& no_res = SelectCoinsBnB(GroupCoins(available_coins.All(), /*subtract_fee_outputs*/true), selection_target, /*cost_of_change=*/0, MAX_STANDARD_TX_WEIGHT); - BOOST_ASSERT(!no_res); + Assert(!no_res); BOOST_CHECK(util::ErrorString(no_res).original.find("The inputs size exceeds the maximum weight") != std::string::npos); // Now add same coin value with a good size and check that it gets selected diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index 6ddca2cb9c3543..53f48f4cf07476 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -1022,7 +1022,7 @@ BOOST_FIXTURE_TEST_CASE(wallet_sync_tx_invalid_state_test, TestingSetup) // Add tx to wallet const auto& op_dest = wallet.GetNewDestination(OutputType::BECH32M, ""); - BOOST_ASSERT(op_dest); + Assert(op_dest); CMutableTransaction mtx; mtx.vout.push_back({COIN, GetScriptForDestination(*op_dest)}); diff --git a/src/wallet/test/walletload_tests.cpp b/src/wallet/test/walletload_tests.cpp index 7b008a29a99173..76bdc86b724c34 100644 --- a/src/wallet/test/walletload_tests.cpp +++ b/src/wallet/test/walletload_tests.cpp @@ -178,7 +178,7 @@ BOOST_FIXTURE_TEST_CASE(wallet_load_verif_crypted_key_checksum, TestingSetup) std::unique_ptr db = get_db(dbs); { CPubKey invalid_key; - BOOST_ASSERT(!invalid_key.IsValid()); + Assert(!invalid_key.IsValid()); const auto key = std::make_pair(DBKeys::CRYPTED_KEY, invalid_key); std::pair, uint256> value; BOOST_CHECK(db->MakeBatch(false)->Write(key, value, /*fOverwrite=*/true)); @@ -305,7 +305,7 @@ BOOST_FIXTURE_TEST_CASE(wallet_load_verif_crypted_blsct, TestingSetup) std::unique_ptr db = get_db(dbs); { CPubKey invalid_key; - BOOST_ASSERT(!invalid_key.IsValid()); + Assert(!invalid_key.IsValid()); const auto key = std::make_pair(DBKeys::CRYPTED_KEY, invalid_key); std::pair, uint256> value; BOOST_CHECK(db->MakeBatch(false)->Write(key, value, /*fOverwrite=*/true));