fixed very dumb bug with cheching minimum coinage condition + fixed test for auditable wallet against the hardfork 4
This commit is contained in:
parent
27bb395542
commit
ca9f44967d
4 changed files with 12 additions and 5 deletions
|
|
@ -897,7 +897,7 @@ namespace currency
|
|||
{
|
||||
//with hard fork 4 make it network rule to have at least 10 confirmations
|
||||
|
||||
if (this->get_current_blockchain_size() - max_related_block_height > CURRENCY_HF4_MANDATORY_MIN_COINAGE)
|
||||
if (this->get_current_blockchain_size() - max_related_block_height < CURRENCY_HF4_MANDATORY_MIN_COINAGE)
|
||||
{
|
||||
LOG_ERROR("Coinage rule broken(mainblock): h = " << this->get_current_blockchain_size() << ", max_related_block_height=" << max_related_block_height << ", tx: " << get_transaction_hash(validated_tx));
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1232,7 +1232,7 @@ int main(int argc, char* argv[])
|
|||
GENERATE_AND_PLAY(hard_fork_2_tx_payer_in_wallet);
|
||||
GENERATE_AND_PLAY(hard_fork_2_tx_receiver_in_wallet);
|
||||
GENERATE_AND_PLAY(hard_fork_2_tx_extra_alias_entry_in_wallet);
|
||||
GENERATE_AND_PLAY(hard_fork_2_auditable_addresses_basics);
|
||||
GENERATE_AND_PLAY_HF(hard_fork_2_auditable_addresses_basics, "2-*");
|
||||
GENERATE_AND_PLAY(hard_fork_2_no_new_structures_before_hf);
|
||||
GENERATE_AND_PLAY(hard_fork_2_awo_wallets_basic_test<true>);
|
||||
GENERATE_AND_PLAY(hard_fork_2_awo_wallets_basic_test<false>);
|
||||
|
|
@ -1250,7 +1250,7 @@ int main(int argc, char* argv[])
|
|||
GENERATE_AND_PLAY(atomic_test_altchain_simple);
|
||||
GENERATE_AND_PLAY(atomic_test_check_hardfork_rules);
|
||||
|
||||
GENERATE_AND_PLAY(isolate_auditable_and_proof);
|
||||
GENERATE_AND_PLAY_HF(isolate_auditable_and_proof, "2-*");
|
||||
|
||||
GENERATE_AND_PLAY(zarcanum_basic_test);
|
||||
|
||||
|
|
|
|||
|
|
@ -612,7 +612,6 @@ bool hard_fork_2_tx_extra_alias_entry_in_wallet::c1(currency::core& c, size_t ev
|
|||
//------------------------------------------------------------------------------
|
||||
|
||||
hard_fork_2_auditable_addresses_basics::hard_fork_2_auditable_addresses_basics()
|
||||
: hard_fork_2_base_test(23)
|
||||
{
|
||||
REGISTER_CALLBACK_METHOD(hard_fork_2_auditable_addresses_basics, c1);
|
||||
}
|
||||
|
|
@ -644,6 +643,8 @@ bool hard_fork_2_auditable_addresses_basics::generate(std::vector<test_event_ent
|
|||
// make sure all Bob's outputs has mix_attr = 1
|
||||
for (auto& out : tx_1.vout)
|
||||
{
|
||||
if (out.type() != typeid(tx_out_bare))
|
||||
continue; // skip if we're in postzarcanum era
|
||||
if (boost::get<tx_out_bare>(out).amount != MK_TEST_COINS(5))
|
||||
continue; // skip change
|
||||
uint8_t mix_attr = boost::get<txout_to_key>(boost::get<tx_out_bare>(out).target).mix_attr;
|
||||
|
|
@ -677,6 +678,9 @@ bool hard_fork_2_auditable_addresses_basics::c1(currency::core& c, size_t ev_ind
|
|||
// make sure all Bob's outputs has mix_attr = 1
|
||||
for (auto& out : tx.vout)
|
||||
{
|
||||
if (out.type() != typeid(tx_out_bare))
|
||||
continue; // skip if we're in postzarcanum era
|
||||
|
||||
if (boost::get<tx_out_bare>(out).amount != MK_TEST_COINS(1))
|
||||
continue; // skip change
|
||||
uint8_t mix_attr = boost::get<txout_to_key>(boost::get<tx_out_bare>(out).target).mix_attr;
|
||||
|
|
@ -702,6 +706,9 @@ bool hard_fork_2_auditable_addresses_basics::c1(currency::core& c, size_t ev_ind
|
|||
// make sure all Bob's outputs has mix_attr = 1
|
||||
for (auto& out : tx.vout)
|
||||
{
|
||||
if (out.type() != typeid(tx_out_bare))
|
||||
continue; // skip if we're in postzarcanum era
|
||||
|
||||
if (boost::get<tx_out_bare>(out).amount != MK_TEST_COINS(1))
|
||||
continue; // skip change
|
||||
uint8_t mix_attr = boost::get<txout_to_key>(boost::get<tx_out_bare>(out).target).mix_attr;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ struct hard_fork_2_tx_extra_alias_entry_in_wallet : public hard_fork_2_base_test
|
|||
bool c1(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events);
|
||||
};
|
||||
|
||||
struct hard_fork_2_auditable_addresses_basics : public hard_fork_2_base_test
|
||||
struct hard_fork_2_auditable_addresses_basics : public wallet_test //hard_fork_2_base_test
|
||||
{
|
||||
hard_fork_2_auditable_addresses_basics();
|
||||
bool generate(std::vector<test_event_entry>& events) const;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue