@@ -498,77 +498,6 @@ BOOST_AUTO_TEST_CASE(rpc_shieldsendmany_taddr_to_sapling)
498
498
vpwallets.erase (vpwallets.begin ());
499
499
}
500
500
501
- struct RealWalletTestingSetup : public WalletTestingSetupBase
502
- {
503
- RealWalletTestingSetup () : WalletTestingSetupBase(CBaseChainParams::MAIN,
504
- " test_wallet" ,
505
- WalletDatabase::Create (fs::absolute(" test_wallet" , GetWalletDir()))) {};
506
- };
507
-
508
- BOOST_FIXTURE_TEST_CASE (rpc_wallet_encrypted_wallet_sapzkeys, RealWalletTestingSetup)
509
- {
510
- UniValue retValue;
511
- int n = 100 ;
512
-
513
- {
514
- LOCK (m_wallet.cs_wallet );
515
- m_wallet.SetMinVersion (FEATURE_SAPLING);
516
- m_wallet.SetupSPKM (false );
517
- }
518
- vpwallets.insert (vpwallets.begin (), &m_wallet);
519
-
520
- // wallet should currently be empty
521
- std::set<libzcash::SaplingPaymentAddress> addrs;
522
- m_wallet.GetSaplingPaymentAddresses (addrs);
523
- BOOST_CHECK (addrs.empty ());
524
-
525
- // create keys
526
- for (int i = 0 ; i < n; i++) {
527
- CallRPC (" getnewshieldaddress" );
528
- }
529
-
530
- // Verify we can list the keys imported
531
- BOOST_CHECK_NO_THROW (retValue = CallRPC (" listshieldaddresses" ));
532
- UniValue arr = retValue.get_array ();
533
- BOOST_CHECK ((int ) arr.size () == n);
534
-
535
- // Verify that the wallet encryption RPC is disabled
536
- // TODO: We don't have the experimental mode to disable the encryptwallet disable.
537
- // BOOST_CHECK_THROW(CallRPC("encryptwallet passphrase"), std::runtime_error);
538
-
539
- // Encrypt the wallet (we can't call RPC encryptwallet as that shuts down node)
540
- SecureString strWalletPass;
541
- strWalletPass.reserve (100 );
542
- strWalletPass = " hello" ;
543
-
544
- PushCurrentDirectory push_dir (gArgs .GetArg (" -datadir" ," /tmp/thisshouldnothappen" ));
545
- BOOST_CHECK (m_wallet.EncryptWallet (strWalletPass));
546
- BOOST_CHECK (m_wallet.IsCrypted ());
547
-
548
- // Verify we can still list the keys imported
549
- BOOST_CHECK_NO_THROW (retValue = CallRPC (" listshieldaddresses" ));
550
- arr = retValue.get_array ();
551
- BOOST_CHECK ((int ) arr.size () == n);
552
-
553
- // Try to add a new key, but we can't as the wallet is locked
554
- BOOST_CHECK_THROW (CallRPC (" getnewshieldaddress" ), std::runtime_error);
555
-
556
- // We can't call RPC walletpassphrase as that invokes RPCRunLater which breaks tests.
557
- // So we manually unlock.
558
- BOOST_CHECK (m_wallet.Unlock (strWalletPass));
559
- BOOST_CHECK (m_wallet.IsCrypted ());
560
-
561
- // Now add a key
562
- BOOST_CHECK_NO_THROW (CallRPC (" getnewshieldaddress" ));
563
-
564
- // Verify the key has been added
565
- BOOST_CHECK_NO_THROW (retValue = CallRPC (" listshieldaddresses" ));
566
- arr = retValue.get_array ();
567
- BOOST_CHECK ((int ) arr.size () == n+1 );
568
-
569
- vpwallets.erase (vpwallets.begin ());
570
- }
571
-
572
501
BOOST_AUTO_TEST_CASE (rpc_listshieldunspent_parameters)
573
502
{
574
503
{
0 commit comments