forked from hush/hush3
![taylor@defuse.ca](/assets/img/avatar_default.png)
3 changed files with 52 additions and 9 deletions
@ -0,0 +1,26 @@ |
|||
#include <gtest/gtest.h> |
|||
|
|||
#include "main.h" |
|||
#include "primitives/transaction.h" |
|||
#include "consensus/validation.h" |
|||
|
|||
TEST(checktransaction_tests, check_vpub_not_both_nonzero) { |
|||
CMutableTransaction tx; |
|||
tx.nVersion = 2; |
|||
|
|||
{ |
|||
// Ensure that values within the pour are well-formed.
|
|||
CMutableTransaction newTx(tx); |
|||
CValidationState state; |
|||
state.SetPerformPourVerification(false); // don't verify the snark
|
|||
|
|||
newTx.vpour.push_back(CPourTx()); |
|||
|
|||
CPourTx *pourtx = &newTx.vpour[0]; |
|||
pourtx->vpub_old = 1; |
|||
pourtx->vpub_new = 1; |
|||
|
|||
EXPECT_FALSE(CheckTransaction(newTx, state)); |
|||
EXPECT_EQ(state.GetRejectReason(), "bad-txns-vpubs-both-nonzero"); |
|||
} |
|||
} |
Loading…
Reference in new issue