Skip to content

Commit

Permalink
Unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
panleone committed Aug 31, 2023
1 parent 9000dd8 commit dd34ff6
Show file tree
Hide file tree
Showing 5 changed files with 455 additions and 14 deletions.
11 changes: 9 additions & 2 deletions src/sapling/transaction_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

#include "sapling/transaction_builder.h"

#include "script/sign.h"
#include "utilmoneystr.h"
#include "consensus/upgrades.h"
#include "policy/policy.h"
#include "primitives/transaction.h"
#include "script/sign.h"
#include "utilmoneystr.h"
#include "validation.h"

#include <librustzcash.h>
Expand Down Expand Up @@ -447,3 +448,9 @@ TransactionBuilderResult TransactionBuilder::Build(bool fDummySig)

return fDummySig ? AddDummySignatures() : ProveAndSign();
}

// WARNING: This function must be used only for testing
TransactionBuilderResult TransactionBuilder::BuildWithoutConstraints()
{
return ProveAndSign();
}
3 changes: 3 additions & 0 deletions src/sapling/transaction_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ class TransactionBuilder

void SendChangeTo(const CTxDestination& changeAddr);

// WARNING: This function must be used only for testing
TransactionBuilderResult BuildWithoutConstraints();

TransactionBuilderResult Build(bool fDummySig = false);
// Add Sapling Spend/Output descriptions, binding sig, and transparent signatures
TransactionBuilderResult ProveAndSign();
Expand Down
Loading

0 comments on commit dd34ff6

Please sign in to comment.