Skip to content

Commit cb4ffa1

Browse files
random-zebrafurszy
authored andcommitted
[zPIV] remove enforcement from 'CreateZerocoinSpendTransaction' fixing the unit tests
1 parent 657bb41 commit cb4ffa1

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/test/zerocoin_transactions_tests.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ BOOST_AUTO_TEST_CASE(zerocoin_spend_test)
4242
CZerocoinSpendReceipt receipt;
4343
cWallet.SpendZerocoin(nAmount, *wtx, receipt, vMints, fMintChange, fMinimizeChange);
4444

45-
BOOST_CHECK_MESSAGE(receipt.GetStatus() == ZPIV_TRX_FUNDS_PROBLEMS, "Failed Invalid Amount Check");
45+
BOOST_CHECK_MESSAGE(receipt.GetStatus() == ZPIV_TRX_FUNDS_PROBLEMS, strprintf("Failed Invalid Amount Check: %s", receipt.GetStatusMessage()));
4646

4747
nAmount = 1;
4848
CZerocoinSpendReceipt receipt2;
@@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE(zerocoin_spend_test)
5151
// if using "wallet.dat", instead of "unlocked.dat" need this
5252
/// BOOST_CHECK_MESSAGE(vString == "Error: Wallet locked, unable to create transaction!"," Locked Wallet Check Failed");
5353

54-
BOOST_CHECK_MESSAGE(receipt2.GetStatus() == ZPIV_TRX_FUNDS_PROBLEMS, "Failed Invalid Amount Check");
54+
BOOST_CHECK_MESSAGE(receipt2.GetStatus() == ZPIV_TRX_FUNDS_PROBLEMS, strprintf("Failed Invalid Amount Check: %s", receipt.GetStatusMessage()));
5555

5656
}
5757

src/wallet/wallet.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -4904,12 +4904,6 @@ bool CWallet::MintsToInputVectorPublicSpend(std::map<CBigNum, CZerocoinMint>& ma
49044904
bool CWallet::CreateZerocoinSpendTransaction(CAmount nValue, CWalletTx& wtxNew, CReserveKey& reserveKey, CZerocoinSpendReceipt& receipt, vector<CZerocoinMint>& vSelectedMints, vector<CDeterministicMint>& vNewMints, bool fMintChange, bool fMinimizeChange, CBitcoinAddress* address)
49054905
{
49064906

4907-
// Check enforcement
4908-
if (chainActive.Tip()->nHeight < Params().Zerocoin_Block_Public_Spend_Enabled()){
4909-
receipt.SetStatus(_("New protocol enforcement not activated"), ZPIV_SPEND_ERROR);
4910-
return false;
4911-
}
4912-
49134907
// Check available funds
49144908
int nStatus = ZPIV_TRX_FUNDS_PROBLEMS;
49154909
if (nValue > GetZerocoinBalance(true)) {

0 commit comments

Comments
 (0)