Skip to content

Commit

Permalink
Unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
panleone committed Sep 13, 2023
1 parent 5fcb18f commit 9191b68
Show file tree
Hide file tree
Showing 3 changed files with 345 additions and 36 deletions.
3 changes: 1 addition & 2 deletions src/test/test_pivx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ CBlock TestChainSetup::CreateBlock(const std::vector<CMutableTransaction>& txns,
.CreateNewBlock(scriptPubKey,
nullptr, // wallet
false, // fProofOfStake
nullptr, // availableCoins
nullptr, // availableShieldCoins
{}, // availableCoins
fNoMempoolTx,
fTestBlockValidity,
customPrevBlock,
Expand Down
4 changes: 2 additions & 2 deletions src/test/validation_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ BOOST_FIXTURE_TEST_CASE(test_simple_shielded_invalid, TestingSetup)
CMutableTransaction newTx(tx);
CValidationState state;

// Create a coinstake transaction
// Create a mixed transaction with an empty vout and sapling data (so it isn't neither coinstake nor coinshieldstake)
CTxIn vin;
vin.prevout = COutPoint(UINT256_ZERO, 0);
newTx.vin.emplace_back(vin);
Expand All @@ -90,7 +90,7 @@ BOOST_FIXTURE_TEST_CASE(test_simple_shielded_invalid, TestingSetup)
newTx.sapData->vShieldedSpend.emplace_back();

BOOST_CHECK(!CheckTransaction(newTx, state, false));
BOOST_CHECK(state.GetRejectReason() == "bad-txns-invalid-sapling");
BOOST_CHECK(state.GetRejectReason() == "bad-txns-vout-empty");
}
}

Expand Down
Loading

0 comments on commit 9191b68

Please sign in to comment.