Hardcode transaction data for DuplicateOrchardNullifier test.
This commit is contained in:
parent
90b07d65be
commit
652a0df78d
File diff suppressed because one or more lines are too long
|
@ -203,26 +203,16 @@ TEST(TransactionBuilder, SproutToSproutAndSapling) {
|
||||||
|
|
||||||
TEST(TransactionBuilder, DuplicateOrchardNullifier)
|
TEST(TransactionBuilder, DuplicateOrchardNullifier)
|
||||||
{
|
{
|
||||||
LoadProofParameters();
|
#include "data/tx-orchard-duplicate-nullifiers.h"
|
||||||
auto consensusParams = RegtestActivateNU5();
|
|
||||||
|
|
||||||
CBasicKeyStore keystore;
|
CDataStream ssin(
|
||||||
CKey tsk = AddTestCKeyToKeyStore(keystore);
|
ParseHex(txdata),
|
||||||
auto scriptPubKey = GetScriptForDestination(tsk.GetPubKey().GetID());
|
SER_NETWORK,
|
||||||
|
PROTOCOL_VERSION
|
||||||
|
);
|
||||||
|
|
||||||
TransactionBuilderCoinsViewDB fakeDB;
|
CTransaction tx;
|
||||||
auto orchardAnchor = fakeDB.GetBestAnchor(ShieldedType::ORCHARD);
|
ssin >> tx;
|
||||||
|
|
||||||
auto builder = TransactionBuilder(consensusParams, 1, orchardAnchor, &keystore);
|
|
||||||
builder.AddTransparentInput(COutPoint(uint256S("1234"), 0), scriptPubKey, 10000);
|
|
||||||
builder.AddBogusOrchardSpends();
|
|
||||||
auto maybeTx = builder.Build();
|
|
||||||
EXPECT_TRUE(maybeTx.IsTx());
|
|
||||||
if (maybeTx.IsError()) {
|
|
||||||
std::cerr << "Failed to build transaction: " << maybeTx.GetError() << std::endl;
|
|
||||||
GTEST_FAIL();
|
|
||||||
}
|
|
||||||
auto tx = maybeTx.GetTxOrThrow();
|
|
||||||
|
|
||||||
CValidationState state;
|
CValidationState state;
|
||||||
EXPECT_FALSE(CheckTransactionWithoutProofVerification(tx, state));
|
EXPECT_FALSE(CheckTransactionWithoutProofVerification(tx, state));
|
||||||
|
|
Loading…
Reference in New Issue