2018-12-27 18:50:45 +03:00
|
|
|
// Copyright (c) 2014-2018 Zano Project
|
|
|
|
|
// Copyright (c) 2014-2018 The Louisdor Project
|
|
|
|
|
// Copyright (c) 2012-2013 The Cryptonote developers
|
|
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
#include "chaingen.h"
|
2025-06-03 00:01:11 +02:00
|
|
|
#include "wallet_tests_basic.h"
|
2018-12-27 18:50:45 +03:00
|
|
|
|
|
|
|
|
struct gen_tx_big_version : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_unlock_time : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_input_is_not_txin_to_key : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_no_inputs_no_outputs : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_no_inputs_has_outputs : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_has_inputs_no_outputs : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_invalid_input_amount : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_input_wo_key_offsets : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_key_offest_points_to_foreign_key : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_sender_key_offest_not_exist : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_mixed_key_offest_not_exist : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_key_image_not_derive_from_tx_key : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_key_image_is_invalid : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_check_input_unlock_time : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_txout_to_key_has_invalid_key : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_output_with_zero_amount : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_output_is_not_txout_to_key : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_signatures_are_invalid : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_broken_attachments : test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_crypted_attachments : test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
gen_crypted_attachments();
|
|
|
|
|
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
bool check_crypted_tx(currency::core& /*c*/, size_t ev_index, const std::vector<test_event_entry>& /*events*/);
|
|
|
|
|
bool set_blockchain_height(currency::core& /*c*/, size_t ev_index, const std::vector<test_event_entry>& /*events*/);
|
|
|
|
|
bool set_crypted_tx_height(currency::core& /*c*/, size_t ev_index, const std::vector<test_event_entry>& /*events*/);
|
|
|
|
|
bool check_offers_count_befor_cancel(currency::core& /*c*/, size_t ev_index, const std::vector<test_event_entry>& /*events*/);
|
|
|
|
|
bool check_offers_count_after_cancel(currency::core& /*c*/, size_t ev_index, const std::vector<test_event_entry>& /*events*/);
|
|
|
|
|
|
|
|
|
|
mutable size_t crypted_tx_height;
|
|
|
|
|
mutable uint64_t bc_height_before;
|
|
|
|
|
mutable uint64_t offers_before_canel;
|
|
|
|
|
mutable currency::tx_payer pr;
|
|
|
|
|
mutable currency::tx_comment cm;
|
2019-09-27 17:16:18 +02:00
|
|
|
//mutable currency::tx_message ms;
|
2018-12-27 18:50:45 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_extra_double_entry : test_chain_unit_enchanced
|
|
|
|
|
{
|
2021-03-11 19:43:39 +03:00
|
|
|
gen_tx_extra_double_entry();
|
2018-12-27 18:50:45 +03:00
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
2022-05-27 19:50:21 +02:00
|
|
|
bool configure_core(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events);
|
2018-12-27 18:50:45 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gen_tx_double_key_image : test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct tx_expiration_time : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct tx_expiration_time_and_block_template : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
tx_expiration_time_and_block_template();
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
bool c1(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct tx_expiration_time_and_chain_switching : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
2019-10-16 16:34:34 +03:00
|
|
|
|
|
|
|
|
struct tx_key_image_pool_conflict : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
mutable currency::account_base m_miner_acc;
|
|
|
|
|
};
|
2024-08-01 01:39:13 +02:00
|
|
|
|
|
|
|
|
struct tx_version_against_hardfork : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
2024-09-28 06:17:36 +05:00
|
|
|
|
2024-10-15 05:30:05 +05:00
|
|
|
struct tx_pool_semantic_validation : public test_chain_unit_enchanced
|
2024-09-28 06:17:36 +05:00
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
2024-12-09 21:34:28 +05:00
|
|
|
|
|
|
|
|
struct input_refers_to_incompatible_by_type_output : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
input_refers_to_incompatible_by_type_output();
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
bool assert_htlc_input_refers_to_key_output_is_wrong(const currency::core& c, const size_t ev_index, const std::vector<test_event_entry>& events) const;
|
|
|
|
|
bool assert_to_key_input_refers_zarcanum_output_is_wrong(const currency::core& c, const size_t ev_index, const std::vector<test_event_entry>& events) const;
|
|
|
|
|
bool assert_zc_input_refers_bare_output_is_wrong(const currency::core& c, const size_t ev_index, const std::vector<test_event_entry>& events) const;
|
|
|
|
|
bool assert_htlc_input_refers_zarcanum_output_is_wrong(const currency::core& c, const size_t ev_index, const std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
2025-06-03 00:01:11 +02:00
|
|
|
|
|
|
|
|
struct tx_pool_validation_and_chain_switch : public wallet_test
|
|
|
|
|
{
|
|
|
|
|
tx_pool_validation_and_chain_switch();
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
bool c1(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events);
|
|
|
|
|
};
|
2025-07-15 23:36:53 +03:00
|
|
|
|
2025-07-19 15:49:10 +03:00
|
|
|
struct tx_coinbase_separate_sig_flag : public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|
|
|
|
|
|
2025-07-15 23:36:53 +03:00
|
|
|
struct tx_input_mixins: public test_chain_unit_enchanced
|
|
|
|
|
{
|
|
|
|
|
tx_input_mixins();
|
|
|
|
|
|
|
|
|
|
bool configure_core(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events);
|
|
|
|
|
bool generate(std::vector<test_event_entry>& events) const;
|
|
|
|
|
};
|