void plugin::plugin_initialize(const boost::program_options::variables_map &options) { ilog("witness_api plugin: plugin_initialize() begin"); try { my = std::make_unique<witness_plugin_impl>(); JSON_RPC_REGISTER_API(name()); } FC_CAPTURE_AND_RETHROW() ilog("witness_api plugin: plugin_initialize() end"); }
const account_object &database_fixture::account_create( const string &name, const public_key_type &key, const public_key_type &post_key ) { try { return account_create( name, STEEMIT_INIT_MINER_NAME, init_account_priv_key, 100, key, post_key, ""); } FC_CAPTURE_AND_RETHROW((name)); }
const account_object& database_fixture::account_create( const string& name, const public_key_type& key, const public_key_type& post_key ) { try { return account_create( name, STEEMIT_INIT_MINER_NAME, init_account_priv_key, std::max( db.get_witness_schedule_object().median_props.account_creation_fee.amount * STEEMIT_CREATE_ACCOUNT_WITH_STEEM_MODIFIER, share_type( 100 ) ), key, post_key, "" ); } FC_CAPTURE_AND_RETHROW( (name) ); }
void database_fixture::set_price_feed(const price &new_price) { try { for (int i = 1; i < 8; i++) { feed_publish_operation op; op.publisher = STEEMIT_INIT_MINER_NAME + fc::to_string(i); op.exchange_rate = new_price; trx.operations.push_back(op); trx.set_expiration(db.head_block_time() + STEEMIT_MAX_TIME_UNTIL_EXPIRATION); db.push_transaction(trx, ~0); trx.operations.clear(); } } FC_CAPTURE_AND_RETHROW((new_price)) generate_blocks(STEEMIT_BLOCKS_PER_HOUR); #ifdef STEEMIT_BUILD_TESTNET BOOST_REQUIRE(!db.skip_price_feed_limit_check || db.get(feed_history_id_type()).current_median_history == new_price); #else BOOST_REQUIRE(db.get(feed_history_id_type()).current_median_history == new_price); #endif }