test: Assert that GetValidTransaction supports the given branch ID

Also includes a small documentation fix.
This commit is contained in:
Jack Grigg 2020-04-09 15:43:18 +12:00
parent f21de9d0d6
commit 4216319ee6
2 changed files with 4 additions and 1 deletions

View File

@ -62,6 +62,9 @@ CMutableTransaction GetValidTransaction(uint32_t consensusBranchId=SPROUT_BRANCH
mtx.fOverwintered = true;
mtx.nVersionGroupId = SAPLING_VERSION_GROUP_ID;
mtx.nVersion = SAPLING_TX_VERSION;
} else if (consensusBranchId != SPROUT_BRANCH_ID) {
// Unsupported consensus branch ID
assert(false);
}
mtx.vin.resize(2);

View File

@ -23,7 +23,7 @@ void ExpectOptionalAmount(CAmount expected, boost::optional<CAmount> actual) {
}
}
// Fake a view containing a single coin
// Fake a view that optionally contains a single coin.
class ValidationFakeCoinsViewDB : public CCoinsView {
public:
boost::optional<std::pair<std::pair<uint256, uint256>, std::pair<CTxOut, int>>> coin;