13 #include "validation.h"
15 #include <boost/test/unit_test.hpp>
37 std::vector<unsigned char> vchSig;
59 txCoinStake.
vin.emplace_back(input);
64 txCoinStake.
vout.emplace_back(0, scriptPubKey);
68 block.
vtx.emplace_back(std::make_shared<const CTransaction>(
CTransaction()));
69 block.
vtx.emplace_back(std::make_shared<const CTransaction>(txCoinStake));
82 for (
int i = 0; i < 20; ++i) {
85 bool useInputP2PK = i % 2 == 0;
109 for (
int nHeight = 0; nHeight < 1; nHeight += 1) {
116 for (
int nHeight = 1; nHeight < 86400; nHeight += 1) {
123 for (
int nHeight = 86400; nHeight < 151200; nHeight += 1) {
130 for (
int nHeight = 151200; nHeight < 259200; nHeight += 1) {
int64_t CAmount
Amount in PIV (Can be negative)
bool CheckBlockSignature(const CBlock &block)
bool SignBlockWithKey(CBlock &block, const CKey &key)
const CChainParams & Params()
Return the currently selected parameters.
std::vector< CTransactionRef > vtx
An encapsulated private key.
void MakeNewKey(bool fCompressed)
Generate a new private key using a cryptographic PRNG.
CPubKey GetPubKey() const
Compute the public key from a private key.
An encapsulated public key.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
Serialized script, used inside transaction inputs and outputs.
The basic transaction that is broadcasted on the network and contained in blocks.
An input of a transaction.
A signature creator that just produces 72-byte empty signatyres.
bool CreateSig(std::vector< unsigned char > &vchSig, const CKeyID &keyid, const CScript &scriptCode, SigVersion sigversion) const
Create a singular (non-script) signature.
BOOST_AUTO_TEST_SUITE_END()
CScript GetScriptForType(CPubKey pubKey, BlockSignatureType type)
BOOST_AUTO_TEST_CASE(block_signature_test)
CBlock CreateDummyBlockWithSignature(CKey stakingKey, BlockSignatureType type, bool useInputP2PK)
CScript GetDummyScriptSigByType(CPubKey pubKey, bool isP2PK)
CAmount nMoneySupplyPoWEnd
std::vector< unsigned char > CreateDummyScriptSigWithKey(CPubKey pubKey)
bool TestBlockSignature(const CBlock &block)
#define BOOST_FIXTURE_TEST_SUITE(a, b)
#define BOOST_CHECK(expr)
std::vector< unsigned char > ToByteVector(const T &in)
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a PIVX scriptPubKey for the given CTxDestination.
A mutable version of CTransaction.
std::vector< CTxOut > vout
CAmount GetBlockValue(int nHeight)