Enforce zk-SNARK validity during consensus.

This commit is contained in:
Sean Bowe
2016-01-08 02:00:54 -07:00
parent 0a87fc4ad0
commit 03bff15fe2
4 changed files with 23 additions and 1 deletions

View File

@@ -227,6 +227,7 @@ BOOST_AUTO_TEST_CASE(sighash_from_data)
stream >> tx;
CValidationState state;
state.SetPerformPourVerification(false); // don't verify the snark
BOOST_CHECK_MESSAGE(CheckTransaction(tx, state), strTest);
BOOST_CHECK(state.IsValid());

View File

@@ -391,6 +391,9 @@ BOOST_AUTO_TEST_CASE(test_simple_pour_invalidity)
// pours.
CMutableTransaction newTx(tx);
CValidationState state;
state.SetPerformPourVerification(false); // don't verify the snark
// No pours, vin and vout, means it should be invalid.
BOOST_CHECK(!CheckTransaction(newTx, state));
BOOST_CHECK(state.GetRejectReason() == "bad-txns-vin-empty");