提交 3e22ac9a 编写于 作者: N Nathan Hourt 提交者: GitHub

Merge pull request #41 from danielfrndz/g++_compile_fix

Make necessary changes to make it compile with g++
......@@ -841,7 +841,7 @@ void chain_controller::initialize_chain(chain_initializer_interface& starter)
_db.create<block_summary_object>([&](block_summary_object&) {});
auto messages = starter.prepare_database(*this, _db);
std::for_each(messages.begin(), messages.end(), [this](const auto& m) { process_message(m); });
std::for_each(messages.begin(), messages.end(), [this](const Message& m) { process_message(m); });
});
}
} FC_CAPTURE_AND_RETHROW() }
......
......@@ -38,8 +38,6 @@
using std::string;
using std::vector;
namespace bpo = boost::program_options;
namespace eos {
class producer_plugin_impl {
......@@ -98,11 +96,11 @@ void producer_plugin::set_program_options(
eos::utilities::key_to_wif(default_priv_key));
command_line_options.add_options()
("enable-stale-production", bpo::bool_switch()->notifier([this](bool e){my->_production_enabled = e;}), "Enable block production, even if the chain is stale.")
("required-participation", bpo::bool_switch()->notifier([this](int e){my->_required_producer_participation = uint32_t(e*config::Percent1);}), "Percent of producers (0-99) that must be participating in order to produce blocks")
("producer-name,p", bpo::value<vector<string>>()->composing()->multitoken(),
("enable-stale-production", boost::program_options::bool_switch()->notifier([this](bool e){my->_production_enabled = e;}), "Enable block production, even if the chain is stale.")
("required-participation", boost::program_options::bool_switch()->notifier([this](int e){my->_required_producer_participation = uint32_t(e*config::Percent1);}), "Percent of producers (0-99) that must be participating in order to produce blocks")
("producer-name,p", boost::program_options::value<vector<string>>()->composing()->multitoken(),
("ID of producer controlled by this node (e.g. " + producer_id_example + ", quotes are required, may specify multiple times)").c_str())
("private-key", bpo::value<vector<string>>()->composing()->multitoken()->default_value({fc::json::to_string(private_key_default)},
("private-key", boost::program_options::value<vector<string>>()->composing()->multitoken()->default_value({fc::json::to_string(private_key_default)},
fc::json::to_string(private_key_default)),
"Tuple of [PublicKey, WIF private key] (may specify multiple times)")
;
......
......@@ -30,14 +30,14 @@ BOOST_AUTO_TEST_CASE(median_properties_test)
votes.emplace_back(BlockchainConfiguration{1, 1, 1, 1, 1, 1, 1});
votes.emplace_back(BlockchainConfiguration{1, 1, 1, 1, 1, 1, 1});
medians = {1024, 100, 1000, Asset(3333).amount, Asset(50).amount, Asset(50).amount, 100};
medians = BlockchainConfiguration {1024, 100, 1000, Asset(3333).amount, Asset(50).amount, Asset(50).amount, 100};
BOOST_CHECK_EQUAL(BlockchainConfiguration::get_median_values(votes), medians);
BOOST_CHECK_EQUAL(BlockchainConfiguration::get_median_values({medians}), medians);
votes.erase(votes.begin() + 2);
votes.erase(votes.end() - 1);
medians = {1024, 100, 1024, Asset(3333).amount, Asset(50).amount, Asset(100).amount, 100};
medians = BlockchainConfiguration {1024, 100, 1024, Asset(3333).amount, Asset(50).amount, Asset(100).amount, 100};
BOOST_CHECK_EQUAL(BlockchainConfiguration::get_median_values(votes), medians);
} FC_LOG_AND_RETHROW() }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册