Fix some overly-strict privacy policies in btest

These were introduced earlier in this PR, but they were incorrect.
This commit is contained in:
Greg Pfeil 2023-01-31 13:05:52 -07:00
parent 47f15811d8
commit 71c0dad1a1
No known key found for this signature in database
GPG Key ID: 1193ACD196ED61F2
1 changed files with 14 additions and 15 deletions

View File

@ -87,8 +87,6 @@ static SaplingPaymentAddress DefaultSaplingAddress(CWallet* pwallet) {
.FindAddress(libzcash::diversifier_index_t(0)).first;
}
auto FULL_PRIVACY = TransactionStrategy(PrivacyPolicy::FullPrivacy);
BOOST_FIXTURE_TEST_SUITE(rpc_wallet_tests, WalletTestingSetup)
BOOST_AUTO_TEST_CASE(rpc_addmultisig)
@ -804,7 +802,8 @@ void CheckHaveAddr(const std::optional<libzcash::PaymentAddress>& addr) {
auto addr_of_type = std::get_if<ADDR_TYPE>(&(addr.value()));
BOOST_ASSERT(addr_of_type != nullptr);
BOOST_CHECK(pwalletMain->ZTXOSelectorForAddress(*addr_of_type, true, false, FULL_PRIVACY).has_value());
TransactionStrategy strategy(PrivacyPolicy::FullPrivacy);
BOOST_CHECK(pwalletMain->ZTXOSelectorForAddress(*addr_of_type, true, false, strategy).has_value());
}
BOOST_AUTO_TEST_CASE(rpc_wallet_z_getnewaddress) {
@ -1238,10 +1237,10 @@ BOOST_AUTO_TEST_CASE(rpc_z_sendmany_internals)
// there are no utxos to spend
{
auto selector = pwalletMain->ZTXOSelectorForAddress(taddr1, true, false, FULL_PRIVACY).value();
TransactionStrategy strategy(PrivacyPolicy::AllowRevealedSenders);
auto selector = pwalletMain->ZTXOSelectorForAddress(taddr1, true, false, strategy).value();
WalletTxBuilder builder(Params(), *pwalletMain, minRelayTxFee);
std::vector<Payment> recipients = { Payment(zaddr1, 100*COIN, Memo::FromHexOrThrow("DEADBEEF")) };
TransactionStrategy strategy;
std::shared_ptr<AsyncRPCOperation> operation(new AsyncRPCOperation_sendmany(std::move(builder), selector, recipients, 1, 1, strategy));
operation->main();
BOOST_CHECK(operation->isFailed());
@ -1251,10 +1250,10 @@ BOOST_AUTO_TEST_CASE(rpc_z_sendmany_internals)
// there are no unspent notes to spend
{
auto selector = pwalletMain->ZTXOSelectorForAddress(zaddr1, true, false, FULL_PRIVACY).value();
TransactionStrategy strategy(PrivacyPolicy::AllowRevealedRecipients);
auto selector = pwalletMain->ZTXOSelectorForAddress(zaddr1, true, false, strategy).value();
WalletTxBuilder builder(Params(), *pwalletMain, minRelayTxFee);
std::vector<Payment> recipients = { Payment(taddr1, 100*COIN, Memo::FromHexOrThrow("DEADBEEF")) };
TransactionStrategy strategy(PrivacyPolicy::AllowRevealedRecipients);
std::shared_ptr<AsyncRPCOperation> operation(new AsyncRPCOperation_sendmany(std::move(builder), selector, recipients, 1, 1, strategy));
operation->main();
BOOST_CHECK(operation->isFailed());