aboutsummaryrefslogtreecommitdiff
path: root/tests/core_tests/tx_validation.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-06-15 23:37:13 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-08-28 21:28:37 +0100
commitdc4aad7eb5fffa450d4c5eb094cf962e45b2f43a (patch)
treee8fc99783d63582ff026adee2584478b0e799933 /tests/core_tests/tx_validation.cpp
parentdb_lmdb: update reset for recent db changes (diff)
downloadmonero-dc4aad7eb5fffa450d4c5eb094cf962e45b2f43a.tar.xz
add rct to the protocol
It is not yet constrained to a fork, so don't use on the real network or you'll be orphaned or rejected.
Diffstat (limited to 'tests/core_tests/tx_validation.cpp')
-rw-r--r--tests/core_tests/tx_validation.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/core_tests/tx_validation.cpp b/tests/core_tests/tx_validation.cpp
index f72c906e5..cf018c8e2 100644
--- a/tests/core_tests/tx_validation.cpp
+++ b/tests/core_tests/tx_validation.cpp
@@ -39,7 +39,7 @@ namespace
{
struct tx_builder
{
- void step1_init(size_t version = CURRENT_TRANSACTION_VERSION, uint64_t unlock_time = 0)
+ void step1_init(size_t version = 1, uint64_t unlock_time = 0)
{
m_tx.vin.clear();
m_tx.vout.clear();
@@ -108,9 +108,13 @@ namespace
BOOST_FOREACH(const tx_source_entry& src_entr, sources)
{
std::vector<const crypto::public_key*> keys_ptrs;
+ std::vector<crypto::public_key> keys(src_entr.outputs.size());
+ size_t j = 0;
BOOST_FOREACH(const tx_source_entry::output_entry& o, src_entr.outputs)
{
- keys_ptrs.push_back(&o.second);
+ keys[j] = rct::rct2pk(o.second.dest);
+ keys_ptrs.push_back(&keys[j]);
+ ++j;
}
m_tx.signatures.push_back(std::vector<crypto::signature>());
@@ -136,7 +140,7 @@ namespace
fill_tx_sources_and_destinations(events, blk_head, from, to, amount, TESTS_DEFAULT_FEE, 0, sources, destinations);
tx_builder builder;
- builder.step1_init(CURRENT_TRANSACTION_VERSION, unlock_time);
+ builder.step1_init(1, unlock_time);
builder.step2_fill_inputs(from.get_keys(), sources);
builder.step3_fill_outputs(destinations);
builder.step4_calc_hash();
@@ -177,7 +181,7 @@ bool gen_tx_big_version::generate(std::vector<test_event_entry>& events) const
fill_tx_sources_and_destinations(events, blk_0, miner_account, miner_account, MK_COINS(1), TESTS_DEFAULT_FEE, 0, sources, destinations);
tx_builder builder;
- builder.step1_init(CURRENT_TRANSACTION_VERSION + 1, 0);
+ builder.step1_init(1 + 1, 0);
builder.step2_fill_inputs(miner_account.get_keys(), sources);
builder.step3_fill_outputs(destinations);
builder.step4_calc_hash();