| 1 | // Copyright (c) 2014-2022, The Monero Project |
| 2 | // |
| 3 | // All rights reserved. |
| 4 | // |
| 5 | // Redistribution and use in source and binary forms, with or without modification, are |
| 6 | // permitted provided that the following conditions are met: |
| 7 | // |
| 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of |
| 9 | // conditions and the following disclaimer. |
| 10 | // |
| 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list |
| 12 | // of conditions and the following disclaimer in the documentation and/or other |
| 13 | // materials provided with the distribution. |
| 14 | // |
| 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be |
| 16 | // used to endorse or promote products derived from this software without specific |
| 17 | // prior written permission. |
| 18 | // |
| 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY |
| 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL |
| 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
| 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | // |
| 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers |
| 30 | |
| 31 | #include "chaingen.h" |
| 32 | #include "chain_split_1.h" |
| 33 | |
| 34 | using namespace std; |
| 35 | |
| 36 | using namespace epee; |
| 37 | using namespace cryptonote; |
| 38 | |
| 39 | |
| 40 | gen_simple_chain_split_1::gen_simple_chain_split_1() |
| 41 | { |
| 42 | REGISTER_CALLBACK("check_split_not_switched", gen_simple_chain_split_1::check_split_not_switched); |
| 43 | REGISTER_CALLBACK("check_split_not_switched2", gen_simple_chain_split_1::check_split_not_switched2); |
| 44 | REGISTER_CALLBACK("check_split_switched", gen_simple_chain_split_1::check_split_switched); |
| 45 | REGISTER_CALLBACK("check_split_not_switched_back", gen_simple_chain_split_1::check_split_not_switched_back); |
| 46 | REGISTER_CALLBACK("check_split_switched_back_1", gen_simple_chain_split_1::check_split_switched_back_1); |
| 47 | REGISTER_CALLBACK("check_split_switched_back_2", gen_simple_chain_split_1::check_split_switched_back_2); |
| 48 | REGISTER_CALLBACK("check_mempool_1", gen_simple_chain_split_1::check_mempool_1); |
| 49 | REGISTER_CALLBACK("check_mempool_2", gen_simple_chain_split_1::check_mempool_2); |
| 50 | //REGISTER_CALLBACK("check_orphaned_chain_1", gen_simple_chain_split_1::check_orphaned_chain_1); |
| 51 | //REGISTER_CALLBACK("check_orphaned_switched_to_alternative", gen_simple_chain_split_1::check_orphaned_switched_to_alternative); |
| 52 | //REGISTER_CALLBACK("check_orphaned_chain_2", gen_simple_chain_split_1::check_orphaned_chain_2); |
| 53 | //REGISTER_CALLBACK("check_orphaned_switched_to_main", gen_simple_chain_split_1::check_orphaned_switched_to_main); |
| 54 | //REGISTER_CALLBACK("check_orphaned_chain_38", gen_simple_chain_split_1::check_orphaned_chain_38); |
| 55 | //REGISTER_CALLBACK("check_orphaned_chain_39", gen_simple_chain_split_1::check_orphaned_chain_39); |
| 56 | //REGISTER_CALLBACK("check_orphaned_chain_40", gen_simple_chain_split_1::check_orphaned_chain_40); |
| 57 | //REGISTER_CALLBACK("check_orphaned_chain_41", gen_simple_chain_split_1::check_orphaned_chain_41); |
| 58 | } |
| 59 | //----------------------------------------------------------------------------------------------------- |
| 60 | bool gen_simple_chain_split_1::generate(std::vector<test_event_entry> &events) const |
| 61 | { |
| 62 | uint64_t ts_start = 1338224400; |
| 63 | /* |
| 64 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 <-- main blockchain height |
| 65 | (0 )-(1 )-(2 )-(3 )-(4 )-(5 ) -(6 ) -(7 ) -(8 )|-(17) -(18) -(19) -(20) -(21)|-(22)|-(23)|-(24)| |
| 66 | \ -(9 ) -(10)|-(11)|-(12)|-(13) -(14) -(15) -(16) |
| 67 | -(25) -(26)| |
| 68 | -(27)| #check switching to alternative |
| 69 | ---------------------------------------------------------------------------------- |
| 70 | -(28) -(29) -(30) -(31)| |
| 71 | -(32)| #check switching orphans to main |
| 72 | ---------------------------------------------------------------------------------- |
| 73 | -(33) -(34) -(35) -(36) -(37) -(38)| |
| 74 | -(39)| #<--this part becomes alternative chain connected to main |
| 75 | -(40)| #still marked as orphaned |
| 76 | -(41)| |
| 77 | #check orphaned with block in the middle of the orphaned chain |
| 78 | */ |
| 79 | |
| 80 | GENERATE_ACCOUNT(first_miner_account); |
| 81 | // events index |
| 82 | MAKE_GENESIS_BLOCK(events, blk_0, first_miner_account, ts_start); // 0 |
| 83 | MAKE_NEXT_BLOCK(events, blk_1, blk_0, first_miner_account); // 1 |
| 84 | MAKE_NEXT_BLOCK(events, blk_2, blk_1, first_miner_account); // 2 |
| 85 | MAKE_NEXT_BLOCK(events, blk_3, blk_2, first_miner_account); // 3 |
| 86 | MAKE_NEXT_BLOCK(events, blk_4, blk_3, first_miner_account); // 4 |
| 87 | MAKE_NEXT_BLOCK(events, blk_5, blk_4, first_miner_account); // 5 |
| 88 | MAKE_NEXT_BLOCK(events, blk_6, blk_5, first_miner_account); // 6 |
| 89 | MAKE_NEXT_BLOCK(events, blk_7, blk_6, first_miner_account); // 7 |
| 90 | MAKE_NEXT_BLOCK(events, blk_8, blk_7, first_miner_account); // 8 |
| 91 | //split |
| 92 | MAKE_NEXT_BLOCK(events, blk_9, blk_5, first_miner_account); // 9 |
| 93 | MAKE_NEXT_BLOCK(events, blk_10, blk_9, first_miner_account); // 10 |
| 94 | DO_CALLBACK(events, "check_split_not_switched"); // 11 |
| 95 | MAKE_NEXT_BLOCK(events, blk_11, blk_10, first_miner_account); // 12 |
| 96 | DO_CALLBACK(events, "check_split_not_switched2"); // 13 |
| 97 | MAKE_NEXT_BLOCK(events, blk_12, blk_11, first_miner_account); // 14 |
| 98 | DO_CALLBACK(events, "check_split_switched"); // 15 |
| 99 | MAKE_NEXT_BLOCK(events, blk_13, blk_12, first_miner_account); // 16 |
| 100 | MAKE_NEXT_BLOCK(events, blk_14, blk_13, first_miner_account); // 17 |
| 101 | MAKE_NEXT_BLOCK(events, blk_15, blk_14, first_miner_account); // 18 |
| 102 | MAKE_NEXT_BLOCK(events, blk_16, blk_15, first_miner_account); // 19 |
| 103 | //split again and check back switching |
| 104 | MAKE_NEXT_BLOCK(events, blk_17, blk_8, first_miner_account); // 20 |
| 105 | MAKE_NEXT_BLOCK(events, blk_18, blk_17, first_miner_account); // 21 |
| 106 | MAKE_NEXT_BLOCK(events, blk_19, blk_18, first_miner_account); // 22 |
| 107 | MAKE_NEXT_BLOCK(events, blk_20, blk_19, first_miner_account); // 23 |
| 108 | MAKE_NEXT_BLOCK(events, blk_21, blk_20, first_miner_account); // 24 |
| 109 | DO_CALLBACK(events, "check_split_not_switched_back"); // 25 |
| 110 | MAKE_NEXT_BLOCK(events, blk_22, blk_21, first_miner_account); // 26 |
| 111 | DO_CALLBACK(events, "check_split_switched_back_1"); // 27 |
| 112 | MAKE_NEXT_BLOCK(events, blk_23, blk_22, first_miner_account); // 28 |
| 113 | DO_CALLBACK(events, "check_split_switched_back_2"); // 29 |
| 114 | |
| 115 | REWIND_BLOCKS(events, blk_23r, blk_23, first_miner_account); // 30...N1 |
| 116 | GENERATE_ACCOUNT(alice); |
| 117 | MAKE_TX(events, tx_0, first_miner_account, alice, MK_COINS(10), blk_23); // N1+1 |
| 118 | MAKE_TX(events, tx_1, first_miner_account, alice, MK_COINS(20), blk_23); // N1+2 |
| 119 | MAKE_TX(events, tx_2, first_miner_account, alice, MK_COINS(30), blk_23); // N1+3 |
| 120 | DO_CALLBACK(events, "check_mempool_1"); // N1+4 |
| 121 | MAKE_NEXT_BLOCK_TX1(events, blk_24, blk_23r, first_miner_account, tx_0); // N1+5 |
| 122 | DO_CALLBACK(events, "check_mempool_2"); // N1+6 |
| 123 | /* |
| 124 | //check orphaned blocks |
| 125 | MAKE_NEXT_BLOCK_NO_ADD(events, blk_orph_27, blk_16, get_test_target(), first_miner_account); |
| 126 | MAKE_NEXT_BLOCK(events, blk_25, blk_orph_27, get_test_target(), first_miner_account); // 36 |
| 127 | MAKE_NEXT_BLOCK(events, blk_26, blk_25, get_test_target(), first_miner_account); // 37 |
| 128 | DO_CALLBACK(events, "check_orphaned_chain_1"); // 38 |
| 129 | ADD_BLOCK(events, blk_orph_27); // 39 |
| 130 | DO_CALLBACK(events, "check_orphaned_switched_to_alternative"); // 40 |
| 131 | |
| 132 | //check orphaned check to main chain |
| 133 | MAKE_NEXT_BLOCK_NO_ADD(events, blk_orph_32, blk_16, get_test_target(), first_miner_account); |
| 134 | MAKE_NEXT_BLOCK(events, blk_28, blk_orph_32, get_test_target(), first_miner_account); // 41 |
| 135 | MAKE_NEXT_BLOCK(events, blk_29, blk_28, get_test_target(), first_miner_account); // 42 |
| 136 | MAKE_NEXT_BLOCK(events, blk_30, blk_29, get_test_target(), first_miner_account); // 43 |
| 137 | MAKE_NEXT_BLOCK(events, blk_31, blk_30, get_test_target(), first_miner_account); // 44 |
| 138 | DO_CALLBACK(events, "check_orphaned_chain_2"); // 45 |
| 139 | ADD_BLOCK(events, blk_orph_32); // 46 |
| 140 | DO_CALLBACK(events, "check_orphaned_switched_to_main"); // 47 |
| 141 | |
| 142 | //check orphaned check to main chain |
| 143 | MAKE_NEXT_BLOCK_NO_ADD(events, blk_orph_39, blk_16, get_test_target(), first_miner_account); |
| 144 | MAKE_NEXT_BLOCK(events, blk_33, blk_orph_39, get_test_target(), first_miner_account); // 48 |
| 145 | MAKE_NEXT_BLOCK(events, blk_34, blk_33, get_test_target(), first_miner_account); // 49 |
| 146 | MAKE_NEXT_BLOCK_NO_ADD(events, blk_orph_41, blk_34, get_test_target(), first_miner_account); |
| 147 | MAKE_NEXT_BLOCK(events, blk_35, blk_orph_41, get_test_target(), first_miner_account); // 50 |
| 148 | MAKE_NEXT_BLOCK(events, blk_36, blk_35, get_test_target(), first_miner_account); // 51 |
| 149 | MAKE_NEXT_BLOCK_NO_ADD(events, blk_orph_40, blk_36, get_test_target(), first_miner_account); |
| 150 | MAKE_NEXT_BLOCK(events, blk_37, blk_orph_40, get_test_target(), first_miner_account); // 52 |
| 151 | MAKE_NEXT_BLOCK(events, blk_38, blk_37, get_test_target(), first_miner_account); // 53 |
| 152 | DO_CALLBACK(events, "check_orphaned_chain_38"); // 54 |
| 153 | ADD_BLOCK(events, blk_orph_39); // 55 |
| 154 | DO_CALLBACK(events, "check_orphaned_chain_39"); // 56 |
| 155 | ADD_BLOCK(events, blk_orph_40); // 57 |
| 156 | DO_CALLBACK(events, "check_orphaned_chain_40"); // 58 |
| 157 | ADD_BLOCK(events, blk_orph_41); // 59 |
| 158 | DO_CALLBACK(events, "check_orphaned_chain_41"); // 60 |
| 159 | */ |
| 160 | return true; |
| 161 | } |
| 162 | //----------------------------------------------------------------------------------------------------- |
| 163 | bool gen_simple_chain_split_1::check_mempool_2(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 164 | { |
| 165 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_mempool_2"); |
| 166 | CHECK_TEST_CONDITION(c.get_pool_transactions_count() == 2); |
| 167 | return true; |
| 168 | } |
| 169 | //----------------------------------------------------------------------------------------------------- |
| 170 | bool gen_simple_chain_split_1::check_mempool_1(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 171 | { |
| 172 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_mempool_1"); |
| 173 | CHECK_TEST_CONDITION(c.get_pool_transactions_count() == 3); |
| 174 | return true; |
| 175 | } |
| 176 | //----------------------------------------------------------------------------------------------------- |
| 177 | bool gen_simple_chain_split_1::check_split_not_switched(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 178 | { |
| 179 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_split_not_switched"); |
| 180 | //check height |
| 181 | CHECK_TEST_CONDITION(c.get_current_blockchain_height() == 9); |
| 182 | CHECK_TEST_CONDITION(c.get_blockchain_total_transactions() == 9); |
| 183 | CHECK_TEST_CONDITION(c.get_tail_id() == get_block_hash(boost::get<cryptonote::block>(events[8]))); |
| 184 | CHECK_TEST_CONDITION(c.get_alternative_blocks_count() == 2); |
| 185 | return true; |
| 186 | } |
| 187 | //----------------------------------------------------------------------------------------------------- |
| 188 | bool gen_simple_chain_split_1::check_split_not_switched2(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 189 | { |
| 190 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_split_not_switched2"); |
| 191 | //check height |
| 192 | CHECK_TEST_CONDITION(c.get_current_blockchain_height() == 9); |
| 193 | CHECK_TEST_CONDITION(c.get_blockchain_total_transactions() == 9); |
| 194 | CHECK_TEST_CONDITION(c.get_tail_id() == get_block_hash(boost::get<cryptonote::block>(events[8]))); |
| 195 | CHECK_TEST_CONDITION(c.get_alternative_blocks_count() == 3); |
| 196 | return true; |
| 197 | } |
| 198 | //----------------------------------------------------------------------------------------------------- |
| 199 | bool gen_simple_chain_split_1::check_split_switched(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 200 | { |
| 201 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_split_switched"); |
| 202 | |
| 203 | //check height |
| 204 | CHECK_TEST_CONDITION(c.get_current_blockchain_height() == 10); |
| 205 | CHECK_TEST_CONDITION(c.get_blockchain_total_transactions() == 10); |
| 206 | CHECK_TEST_CONDITION(c.get_tail_id() == get_block_hash(boost::get<cryptonote::block>(events[14]))); |
| 207 | CHECK_TEST_CONDITION(c.get_alternative_blocks_count() == 3); |
| 208 | return true; |
| 209 | } |
| 210 | //----------------------------------------------------------------------------------------------------- |
| 211 | bool gen_simple_chain_split_1::check_split_not_switched_back(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 212 | { |
| 213 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_split_not_switched_back"); |
| 214 | //check height |
| 215 | CHECK_TEST_CONDITION(c.get_current_blockchain_height() == 14); |
| 216 | CHECK_TEST_CONDITION(c.get_blockchain_total_transactions() == 14); |
| 217 | CHECK_TEST_CONDITION(c.get_tail_id() == get_block_hash(boost::get<cryptonote::block>(events[19]))); |
| 218 | CHECK_TEST_CONDITION(c.get_alternative_blocks_count() == 8); |
| 219 | |
| 220 | return true; |
| 221 | } |
| 222 | //----------------------------------------------------------------------------------------------------- |
| 223 | bool gen_simple_chain_split_1::check_split_switched_back_1(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 224 | { |
| 225 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_split_switched_back_1"); |
| 226 | |
| 227 | //check height |
| 228 | CHECK_TEST_CONDITION(c.get_current_blockchain_height()== 15); |
| 229 | CHECK_TEST_CONDITION(c.get_blockchain_total_transactions() == 15); |
| 230 | CHECK_TEST_CONDITION(c.get_tail_id() == get_block_hash(boost::get<cryptonote::block>(events[26]))); |
| 231 | CHECK_TEST_CONDITION(c.get_alternative_blocks_count() == 8); |
| 232 | |
| 233 | return true; |
| 234 | }//----------------------------------------------------------------------------------------------------- |
| 235 | bool gen_simple_chain_split_1::check_split_switched_back_2(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 236 | { |
| 237 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_split_switched_back_2"); |
| 238 | |
| 239 | //check height |
| 240 | CHECK_TEST_CONDITION(c.get_current_blockchain_height() == 16); |
| 241 | CHECK_TEST_CONDITION(c.get_blockchain_total_transactions() == 16); |
| 242 | CHECK_TEST_CONDITION(c.get_tail_id() == get_block_hash(boost::get<cryptonote::block>(events[28]))); |
| 243 | CHECK_TEST_CONDITION(c.get_alternative_blocks_count() == 8); |
| 244 | return true; |
| 245 | } |
| 246 | //----------------------------------------------------------------------------------------------------- |
| 247 | /* |
| 248 | bool gen_simple_chain_split_1::check_orphaned_chain_1(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 249 | { |
| 250 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_orphaned_chain_1"); |
| 251 | CHECK_TEST_CONDITION(c.get_orphaned_by_prev_blocks_count() == 2); |
| 252 | return true; |
| 253 | } |
| 254 | //----------------------------------------------------------------------------------------------------- |
| 255 | bool gen_simple_chain_split_1::check_orphaned_switched_to_alternative(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 256 | { |
| 257 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_orphaned_switched_to_alternative"); |
| 258 | CHECK_TEST_CONDITION(c.get_orphaned_by_prev_blocks_count() == 0); |
| 259 | CHECK_TEST_CONDITION(c.get_current_blockchain_height()== 17); |
| 260 | CHECK_TEST_CONDITION(c.get_alternative_blocks_count() == 11); |
| 261 | return true; |
| 262 | } |
| 263 | //----------------------------------------------------------------------------------------------------- |
| 264 | bool gen_simple_chain_split_1::check_orphaned_chain_2(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 265 | { |
| 266 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_orphaned_chain_2"); |
| 267 | CHECK_TEST_CONDITION(c.get_orphaned_by_prev_blocks_count() == 4); |
| 268 | return true; |
| 269 | } |
| 270 | //----------------------------------------------------------------------------------------------------- |
| 271 | bool gen_simple_chain_split_1::check_orphaned_switched_to_main(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 272 | { |
| 273 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_orphaned_switched_to_main"); |
| 274 | CHECK_TEST_CONDITION(c.get_orphaned_by_prev_blocks_count() == 0); |
| 275 | CHECK_TEST_CONDITION(c.get_current_blockchain_height()== 19); |
| 276 | CHECK_TEST_CONDITION(c.get_alternative_blocks_count() == 14); |
| 277 | return true; |
| 278 | } |
| 279 | //----------------------------------------------------------------------------------------------------- |
| 280 | bool gen_simple_chain_split_1::check_orphaned_chain_38(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 281 | { |
| 282 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_orphaned_chain_38"); |
| 283 | CHECK_TEST_CONDITION(c.get_orphaned_by_prev_blocks_count() == 6); |
| 284 | CHECK_TEST_CONDITION(c.get_alternative_blocks_count() == 14); |
| 285 | CHECK_TEST_CONDITION(c.get_current_blockchain_height()== 19); |
| 286 | return true; |
| 287 | } |
| 288 | //----------------------------------------------------------------------------------------------------- |
| 289 | bool gen_simple_chain_split_1::check_orphaned_chain_39(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 290 | { |
| 291 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_orphaned_chain_39"); |
| 292 | CHECK_TEST_CONDITION(c.get_orphaned_by_prev_blocks_count() == 4); |
| 293 | CHECK_TEST_CONDITION(c.get_alternative_blocks_count() == 17); |
| 294 | CHECK_TEST_CONDITION(c.get_current_blockchain_height()== 19); |
| 295 | return true; |
| 296 | } |
| 297 | //----------------------------------------------------------------------------------------------------- |
| 298 | bool gen_simple_chain_split_1::check_orphaned_chain_40(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 299 | { |
| 300 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_orphaned_chain_40"); |
| 301 | CHECK_TEST_CONDITION(c.get_orphaned_by_prev_blocks_count() == 5); |
| 302 | CHECK_TEST_CONDITION(c.get_alternative_blocks_count() == 17); |
| 303 | CHECK_TEST_CONDITION(c.get_current_blockchain_height()== 19); |
| 304 | return true; |
| 305 | } |
| 306 | //----------------------------------------------------------------------------------------------------- |
| 307 | bool gen_simple_chain_split_1::check_orphaned_chain_41(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry> &events) |
| 308 | { |
| 309 | DEFINE_TESTS_ERROR_CONTEXT("gen_simple_chain_split_1::check_orphaned_chain_41"); |
| 310 | CHECK_TEST_CONDITION(c.get_orphaned_by_prev_blocks_count() == 0); |
| 311 | CHECK_TEST_CONDITION(c.get_alternative_blocks_count() == 19); |
| 312 | CHECK_TEST_CONDITION(c.get_current_blockchain_height()== 23); |
| 313 | |
| 314 | return true; |
| 315 | }*/ |
| 316 | //----------------------------------------------------------------------------------------------------- |
| 317 | |
| 318 | |
| 319 |