message: Changed validating_tester to allow setting trusted_producers and to manually produce blocks on the main chain and then manually pass the block to the validating_node. GH
diff: @@ -308,6 +308,7 @@ namespace eosio { namespace testing {
  try {
  if( num_blocks_to_producer_before_shutdown > 0 )
  produce_blocks( num_blocks_to_producer_before_shutdown );
  + if (!skip_validate)
  BOOST_REQUIRE_EQUAL( validate(), true );
  } catch( const fc::exception& e ) {
  wdump((e.to_detail_string()));
  @@ -315,7 +316,9 @@ namespace eosio { namespace testing {
  }
  controller::config vcfg;
  - validating_tester() {
  + static controller::config default_config() {
  + fc::temp_directory tempdir;
  + controller::config vcfg;
  vcfg.blocks_dir = tempdir.path() / std::string("v_").append(config::default_blocks_dir_name);
  vcfg.state_dir = tempdir.path() / std::string("v_").append(config::default_state_dir_name);
  vcfg.state_size = 1024*1024*8;
  @@ -333,7 +336,13 @@ namespace eosio { namespace testing {
  else if(boost::unit_test::framework::master_test_suite().argv[i] == std::string("--wavm"))
  vcfg.wasm_runtime = chain::wasm_interface::vm_type::wavm;
  }
  + return vcfg;
  + }
  + validating_tester(const flat_set<account_name>& trusted_producers = flat_set<account_name>()) {
  + vcfg = default_config();
  +
  + vcfg.trusted_producers = trusted_producers;
  validating_node = std::make_unique<controller>(vcfg);
  validating_node->startup();
  @@ -362,6 +371,14 @@ namespace eosio { namespace testing {
  return sb;
  }
  + signed_block_ptr produce_block_no_validation( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms), uint32_t skip_flag = 0 /*skip_missed_block_penalty*/ ) {
  + return _produce_block(skip_time, false, skip_flag | 2);
  + }
  +
  + void validate_push_block(const signed_block_ptr& sb) {
  + validating_node->push_block( sb );
  + }
  +
  signed_block_ptr produce_empty_block( fc::microseconds skip_time = fc::milliseconds(config::block_interval_ms), uint32_t skip_flag = 0 /*skip_missed_block_penalty*/ )override {
  control->abort_block();
  auto sb = _produce_block(skip_time, true, skip_flag | 2);
  @@ -393,6 +410,7 @@ namespace eosio { namespace testing {
  unique_ptr<controller> validating_node;
  uint32_t num_blocks_to_producer_before_shutdown = 0;
  + bool skip_validate = false;
  };
  /**
  