diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e9e59ff..5054e541 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,7 +149,7 @@ else( WIN32 ) # Apple AND Linux else( APPLE ) # Linux Specific Options Here message( STATUS "Configuring BlockLinks on Linux" ) - set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wall" ) + set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wall -pthread" ) set( rt_library rt ) set( pthread_library pthread) if ( NOT DEFINED crypto_library ) @@ -200,7 +200,7 @@ endif() add_subdirectory( libraries ) add_subdirectory( programs ) -add_subdirectory( tests ) +#add_subdirectory( tests ) if (ENABLE_INSTALLER) diff --git a/libraries/app/api.cpp b/libraries/app/api.cpp index 08bb6c14..5883a411 100644 --- a/libraries/app/api.cpp +++ b/libraries/app/api.cpp @@ -38,7 +38,7 @@ #include #include #include -#include + #include #include #include @@ -350,7 +350,9 @@ namespace graphene { namespace app { { return _app.p2p_node()->get_potential_peers(); } - + void network_node_api::update_seed_node() { + _app.add_seed_node(); + } fc::variant_object network_node_api::get_advanced_node_parameters() const { return _app.p2p_node()->get_advanced_node_parameters(); @@ -705,19 +707,7 @@ namespace graphene { namespace app { crypto_api::crypto_api(){}; - blind_signature crypto_api::blind_sign( const extended_private_key_type& key, const blinded_hash& hash, int i ) - { - return fc::ecc::extended_private_key( key ).blind_sign( hash, i ); - } - signature_type crypto_api::unblind_signature( const extended_private_key_type& key, - const extended_public_key_type& bob, - const blind_signature& sig, - const fc::sha256& hash, - int i ) - { - return fc::ecc::extended_private_key( key ).unblind_signature( extended_public_key( bob ), sig, hash, i ); - } commitment_type crypto_api::blind( const blind_factor_type& blind, uint64_t value ) { diff --git a/libraries/app/application.cpp b/libraries/app/application.cpp index 224c3ce4..e7e19db9 100644 --- a/libraries/app/application.cpp +++ b/libraries/app/application.cpp @@ -37,7 +37,7 @@ #include #include -#include + #include #include @@ -84,7 +84,7 @@ namespace detail { auto hyper_exchange_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("hyper-exchange"))); dlog("Allocating all stake to ${key}", ("key", utilities::key_to_wif(hyper_exchange_key))); genesis_state_type initial_state; - initial_state.initial_parameters.current_fees = fee_schedule::get_default();//->set_all_fees(GRAPHENE_BLOCKCHAIN_PRECISION); + initial_state.initial_parameters.get_mutable_fees() = fee_schedule::get_default();//->set_all_fees(GRAPHENE_BLOCKCHAIN_PRECISION); initial_state.initial_active_miners = GRAPHENE_DEFAULT_MIN_MINER_COUNT; initial_state.initial_timestamp = time_point_sec(time_point::now().sec_since_epoch() / initial_state.initial_parameters.block_interval * @@ -193,13 +193,16 @@ namespace detail { { // https://blocklinkstalk.org/index.php/topic,23715.0.html vector seeds = { + "117.78.44.37:9034", "47.74.2.123:9034", "47.74.23.176:9034", "47.74.37.107:9034", "52.194.253.245:9034", "36.152.8.188:9034", - "172.81.250.51:9034" + "172.81.250.51:9034", + "106.13.38.27:9034", + "119.45.188.146:9034" /* "104.236.144.84:1777", // puppies (USA) "128.199.143.47:2015", // Harvey (Singapore) @@ -220,6 +223,7 @@ namespace detail { "seeds.blocklinks.eu:1776" // pc (http://seeds.quisquis.de/blocklinks.html) */ }; + for( const string& endpoint_string : seeds ) { try { @@ -249,7 +253,48 @@ namespace detail { std::vector()); } FC_CAPTURE_AND_RETHROW() } + void add_seed_node() { + try { + fc::http::connection_sync conn; + crosschain_interface_btc temp; + bool bgetconnect = temp.connect_midware(conn, true); + if (bgetconnect) + { + std::ostringstream req_body; + req_body << "{ \"jsonrpc\": \"2.0\", \ + \"id\" : \"45\", \ + \"method\" : \"Zchain.Query.GetSeedNode\" ,\ + \"params\" : {}}"; + //_rpc_url = _rpc_url + _config["ip"].as_string() + ":" + std::string(_config["port"].as_string()) + "/api"; + fc::http::headers _rpc_headers; + auto reply = conn.request("POST", "http://0.0.0.0:9999/api", req_body.str(), _rpc_headers); + //auto reply = conn.request("POST", string(eip), bodddy); + if (reply.status == fc::http::reply::OK) + { + auto resp = fc::json::from_string(std::string(reply.body.begin(), reply.body.end())).get_object(); + //std::cout << std::string(reply.body.begin(), reply.body.end()) << std::endl; + if (resp.contains("result")) { + auto ret = resp["result"].get_array(); + for (size_t i = 0; i < ret.size(); ++i) + { + std::vector endpoints = resolve_string_to_ip_endpoints(ret[i].as_string()); + for (const fc::ip::endpoint& endpoint : endpoints) + { + _p2p_network->add_node(endpoint); + } + } + } + } + } + + } + catch (const fc::exception& e) { + wlog("cant get seednode ${e} while adding seed node", + ("e", e.to_detail_string())); + } + + } std::vector resolve_string_to_ip_endpoints(const std::string& endpoint_string) { try @@ -410,7 +455,7 @@ namespace detail { } else { - vector midware_sers = { fc::ip::endpoint::from_string("47.74.2.123:5005"),fc::ip::endpoint::from_string("47.74.23.176:5005") }; + vector midware_sers = { fc::ip::endpoint::from_string("112.5.37.186:5005") }; abstract_crosschain_interface::set_midwares_backup(midware_sers); } if (chain_type_vector.size() < 8) @@ -446,7 +491,7 @@ namespace detail { abstract_crosschain_interface::set_midwares(abstract_crosschain_interface::midware_eps_backup); else { - vector midware_sers = { fc::ip::endpoint::from_string("47.74.2.123:5005"),fc::ip::endpoint::from_string("47.74.23.176:5005") }; + vector midware_sers = { fc::ip::endpoint::from_string("112.5.37.186:5005") }; abstract_crosschain_interface::set_midwares(midware_sers); } } @@ -1271,7 +1316,9 @@ void application::startup() throw; } } - +void application::add_seed_node() { + my->add_seed_node(); +} std::shared_ptr application::get_plugin(const string& name) const { return my->_plugins[name]; diff --git a/libraries/app/database_api.cpp b/libraries/app/database_api.cpp index f5a6a09b..f250561c 100644 --- a/libraries/app/database_api.cpp +++ b/libraries/app/database_api.cpp @@ -26,7 +26,7 @@ #include #include -#include + #include @@ -2949,9 +2949,9 @@ std::pair database_api::register_contract_testing(const strin signed_transaction tx; tx.operations.push_back(contract_register_op); - auto current_fees = get_global_properties().parameters.current_fees; + const auto current_fees = get_global_properties().parameters.get_current_fees(); for (auto& op : tx.operations) - current_fees->set_fee(op); + current_fees.set_fee(op); signed_transaction signed_tx(tx); auto dyn_props = get_dynamic_global_properties(); signed_tx.set_reference_block(dyn_props.head_block_id); @@ -2998,9 +2998,9 @@ std::pair database_api::transfer_to_contract_testing(string p signed_transaction tx; tx.operations.push_back(transfer_to_contract_op); - auto current_fees = get_global_properties().parameters.current_fees; + const auto current_fees = get_global_properties().parameters.get_current_fees(); for (auto& op : tx.operations) - current_fees->set_fee(op); + current_fees.set_fee(op); auto dyn_props = get_dynamic_global_properties(); @@ -3065,9 +3065,9 @@ execution_result database_api::invoke_contract_testing(const string & pubkey, co signed_transaction tx; tx.operations.push_back(contract_invoke_op); - auto current_fees = get_global_properties().parameters.current_fees; + auto current_fees = get_global_properties().parameters.get_current_fees(); for (auto& op : tx.operations) - current_fees->set_fee(op); + current_fees.set_fee(op); auto dyn_props = get_dynamic_global_properties(); tx.set_reference_block(dyn_props.head_block_id); @@ -3157,9 +3157,9 @@ string database_api::invoke_contract_offline(const string & caller_pubkey_str, c //contract_invoke_op.guarantee_id = get_guarantee_id(); signed_transaction tx; tx.operations.push_back(contract_invoke_op); - auto current_fees = get_global_properties().parameters.current_fees; + auto current_fees = get_global_properties().parameters.get_current_fees(); for (auto& op : tx.operations) - current_fees->set_fee(op); + current_fees.set_fee(op); auto dyn_props = get_dynamic_global_properties(); tx.set_reference_block(dyn_props.head_block_id); diff --git a/libraries/app/impacted.cpp b/libraries/app/impacted.cpp index dfeefefe..d16eabd9 100644 --- a/libraries/app/impacted.cpp +++ b/libraries/app/impacted.cpp @@ -63,7 +63,7 @@ struct get_impacted_account_visitor add_authority_accounts( _impacted, op.owner ); add_authority_accounts( _impacted, op.active ); } - + void operator() (const withdraw_limit_modify_operation& op) {} void operator()( const account_update_operation& op ) { _impacted.insert( op.account ); diff --git a/libraries/app/include/graphene/app/api.hpp b/libraries/app/include/graphene/app/api.hpp index 9ceded60..1342b70d 100644 --- a/libraries/app/include/graphene/app/api.hpp +++ b/libraries/app/include/graphene/app/api.hpp @@ -280,7 +280,7 @@ namespace graphene { namespace app { * @brief Return list of potential peers */ std::vector get_potential_peers() const; - + void update_seed_node(); private: application& _app; }; @@ -289,14 +289,14 @@ namespace graphene { namespace app { { public: crypto_api(); - - fc::ecc::blind_signature blind_sign( const extended_private_key_type& key, const fc::ecc::blinded_hash& hash, int i ); - - signature_type unblind_signature( const extended_private_key_type& key, - const extended_public_key_type& bob, - const fc::ecc::blind_signature& sig, - const fc::sha256& hash, - int i ); + /** + * @brief Generates a pedersen commitment: *commit = blind * G + value * G2. + * The commitment is 33 bytes, the blinding factor is 32 bytes. + * For more information about pederson commitment check url https://en.wikipedia.org/wiki/Commitment_scheme + * @param blind Sha-256 blind factor type + * @param value Positive 64-bit integer value + * @return A 33-byte pedersen commitment: *commit = blind * G + value * G2 + */ fc::ecc::commitment_type blind( const fc::ecc::blind_factor_type& blind, uint64_t value ); @@ -488,10 +488,9 @@ FC_API(graphene::app::network_node_api, (get_potential_peers) (get_advanced_node_parameters) (set_advanced_node_parameters) + (update_seed_node) ) FC_API(graphene::app::crypto_api, - (blind_sign) - (unblind_signature) (blind) (blind_sum) (verify_sum) diff --git a/libraries/app/include/graphene/app/application.hpp b/libraries/app/include/graphene/app/application.hpp index 5c34cc93..7a50c996 100644 --- a/libraries/app/include/graphene/app/application.hpp +++ b/libraries/app/include/graphene/app/application.hpp @@ -51,6 +51,7 @@ namespace graphene { namespace app { void shutdown_plugins(); void stop_block_processing(); void start_block_processing(); + void add_seed_node(); template std::shared_ptr register_plugin() { diff --git a/libraries/chain/CMakeLists.txt b/libraries/chain/CMakeLists.txt index 3b4a1803..6c084c72 100644 --- a/libraries/chain/CMakeLists.txt +++ b/libraries/chain/CMakeLists.txt @@ -59,6 +59,7 @@ add_library( graphene_chain protocol/fee_schedule.cpp protocol/confidential.cpp protocol/vote.cpp + protocol/chain_parameters.cpp eth_seri_record_evaluate.cpp eth_seri_record.cpp genesis_state.cpp diff --git a/libraries/chain/account_evaluator.cpp b/libraries/chain/account_evaluator.cpp index a16d431f..d4177704 100644 --- a/libraries/chain/account_evaluator.cpp +++ b/libraries/chain/account_evaluator.cpp @@ -22,7 +22,7 @@ * THE SOFTWARE. */ -#include + #include #include @@ -169,7 +169,7 @@ object_id_type account_create_evaluator::do_apply( const account_create_operatio if( dynamic_properties.accounts_registered_this_interval % global_properties.parameters.accounts_per_fee_scale == 0 ) db().modify(global_properties, [&dynamic_properties](global_property_object& p) { - p.parameters.current_fees->get().basic_fee <<= p.parameters.account_fee_scale_bitshifts; + p.parameters.get_mutable_fees().get().basic_fee <<= p.parameters.account_fee_scale_bitshifts; }); if( o.extensions.value.owner_special_authority.valid() diff --git a/libraries/chain/asset_evaluator.cpp b/libraries/chain/asset_evaluator.cpp index 4bf05b33..bec3951e 100644 --- a/libraries/chain/asset_evaluator.cpp +++ b/libraries/chain/asset_evaluator.cpp @@ -764,6 +764,30 @@ void_result asset_fee_modification_evaluator::do_apply(const asset_fee_modificat }); }FC_CAPTURE_AND_RETHROW((o)) } +void_result withdraw_limit_modify_evaluator::do_evaluate(const withdraw_limit_modify_operation& o) +{ + try { + const auto & _db = db(); + const auto& asset_indx = _db.get_index_type().indices().get(); + const auto iter = asset_indx.find(o.asset_symbol); + FC_ASSERT(iter != asset_indx.end()); + const auto& dymic_asset_info = iter->dynamic_data(_db); + FC_ASSERT(dymic_asset_info.withdraw_limition != o.withdraw_limit); + }FC_CAPTURE_AND_RETHROW((o)) +} +void_result withdraw_limit_modify_evaluator::do_apply(const withdraw_limit_modify_operation& o) +{ + try { + auto& d = db(); + const auto& asset_indx = d.get_index_type().indices().get(); + const auto iter = asset_indx.find(o.asset_symbol); + auto& dymic_asset_info = iter->dynamic_data(d); + d.modify(dymic_asset_info, [&](asset_dynamic_data_object& obj) { + obj.withdraw_limition = o.withdraw_limit; + }); + + }FC_CAPTURE_AND_RETHROW((o)) +} void_result guard_lock_balance_set_evaluator::do_evaluate(const set_guard_lockbalance_operation& o) { diff --git a/libraries/chain/block_database.cpp b/libraries/chain/block_database.cpp index 245db56a..48895f5e 100644 --- a/libraries/chain/block_database.cpp +++ b/libraries/chain/block_database.cpp @@ -24,29 +24,26 @@ #include #include #include -#include + namespace graphene { namespace chain { -struct index_entry -{ - uint64_t block_pos = 0; - uint32_t block_size = 0; - block_id_type block_id; -}; + struct index_entry + { + uint64_t block_pos = 0; + uint32_t block_size = 0; + block_id_type block_id; + }; }} -FC_REFLECT( graphene::chain::index_entry, (block_pos)(block_size)(block_id) ); +FC_REFLECT(graphene::chain::index_entry, (block_pos)(block_size)(block_id)); namespace graphene { namespace chain { void block_database::open( const fc::path& dbdir ) { try { fc::create_directories(dbdir); - /* _block_num_to_pos.clear(); - _blocks.clear();*/ _block_num_to_pos.exceptions(std::ios_base::failbit | std::ios_base::badbit); _blocks.exceptions(std::ios_base::failbit | std::ios_base::badbit); - if( !fc::exists( dbdir/"index" ) ) { _block_num_to_pos.open( (dbdir/"index").generic_string().c_str(), std::fstream::binary | std::fstream::in | std::fstream::out | std::fstream::trunc); @@ -58,12 +55,10 @@ void block_database::open( const fc::path& dbdir ) _blocks.open( (dbdir/"blocks").generic_string().c_str(), std::fstream::binary | std::fstream::in | std::fstream::out ); } } FC_CAPTURE_AND_RETHROW( (dbdir) ) } - bool block_database::is_open()const { return _blocks.is_open(); } - void block_database::close() { if (_blocks.is_open()) @@ -71,13 +66,11 @@ void block_database::close() if (_block_num_to_pos.is_open()) _block_num_to_pos.close(); } - void block_database::flush() { _blocks.flush(); _block_num_to_pos.flush(); } - void block_database::store( const block_id_type& _id, const signed_block& b ) { block_id_type id = _id; @@ -97,7 +90,6 @@ void block_database::store( const block_id_type& _id, const signed_block& b ) _blocks.write( vec.data(), vec.size() ); _block_num_to_pos.write( (char*)&e, sizeof(e) ); } - void block_database::remove( const block_id_type& id ) { try { index_entry e; @@ -121,7 +113,6 @@ bool block_database::contains( const block_id_type& id )const { if( id == block_id_type() ) return false; - index_entry e; auto index_pos = sizeof(e)*block_header::num_from_id(id); _block_num_to_pos.seekg( 0, _block_num_to_pos.end ); @@ -129,10 +120,8 @@ bool block_database::contains( const block_id_type& id )const return false; _block_num_to_pos.seekg( index_pos ); _block_num_to_pos.read( (char*)&e, sizeof(e) ); - return e.block_id == id && e.block_size > 0; } - block_id_type block_database::fetch_block_id( uint32_t block_num )const { assert( block_num != 0 ); @@ -144,13 +133,11 @@ block_id_type block_database::fetch_block_id( uint32_t block_num )const _block_num_to_pos.seekg( index_pos ); _block_num_to_pos.read( (char*)&e, sizeof(e) ); - FC_ASSERT( e.block_id != block_id_type(), "Empty block_id in block_database (maybe corrupt on disk?)" ); return e.block_id; } - optional block_database::fetch_optional( const block_id_type& id )const -{ + { try { index_entry e; @@ -171,7 +158,7 @@ optional block_database::fetch_optional( const block_id_type& id ) auto result = fc::raw::unpack(data); FC_ASSERT( result.id() == e.block_id ); return result; - } + } catch (const fc::exception&) { } @@ -209,60 +196,58 @@ optional block_database::fetch_by_number( uint32_t block_num )cons } return optional(); } - optional block_database::last()const { - try - { - index_entry e; - _block_num_to_pos.seekg( 0, _block_num_to_pos.end ); - - if( _block_num_to_pos.tellp() < sizeof(index_entry) ) - return optional(); - - _block_num_to_pos.seekg( -sizeof(index_entry), _block_num_to_pos.end ); - _block_num_to_pos.read( (char*)&e, sizeof(e) ); - uint64_t pos = _block_num_to_pos.tellg(); - while( e.block_size == 0 && pos > 0 ) - { - pos -= sizeof(index_entry); - _block_num_to_pos.seekg( pos ); - _block_num_to_pos.read( (char*)&e, sizeof(e) ); - } - - if( e.block_size == 0 ) - return optional(); - - vector data( e.block_size ); - _blocks.seekg( e.block_pos ); - _blocks.read( data.data(), e.block_size ); - auto result = fc::raw::unpack(data); - return result; - } - catch (const fc::exception&) - { - } - catch (const std::exception&) - { - } - return optional(); + try + { + index_entry e; + _block_num_to_pos.seekg(0, _block_num_to_pos.end); + + if (_block_num_to_pos.tellp() < sizeof(index_entry)) + return optional(); + + _block_num_to_pos.seekg(-sizeof(index_entry), _block_num_to_pos.end); + _block_num_to_pos.read((char*)&e, sizeof(e)); + uint64_t pos = _block_num_to_pos.tellg(); + while (e.block_size == 0 && pos > 0) + { + pos -= sizeof(index_entry); + _block_num_to_pos.seekg(pos); + _block_num_to_pos.read((char*)&e, sizeof(e)); + } + + if (e.block_size == 0) + return optional(); + + vector data(e.block_size); + _blocks.seekg(e.block_pos); + _blocks.read(data.data(), e.block_size); + auto result = fc::raw::unpack(data); + return result; + } + catch (const fc::exception&) + { + } + catch (const std::exception&) + { + } + return optional(); } optional block_database::last_id()const { try { - index_entry e; - _block_num_to_pos.seekg( 0, _block_num_to_pos.end ); - + index_entry e; + _block_num_to_pos.seekg(0, _block_num_to_pos.end); if( _block_num_to_pos.tellp() < sizeof(index_entry) ) return optional(); _block_num_to_pos.seekg( -sizeof(index_entry), _block_num_to_pos.end ); - _block_num_to_pos.read( (char*)&e, sizeof(e) ); + _block_num_to_pos.read((char*)&e, sizeof(e)); uint64_t pos = _block_num_to_pos.tellg(); while( e.block_size == 0 && pos > 0 ) - { + { pos -= sizeof(index_entry); _block_num_to_pos.seekg( pos ); _block_num_to_pos.read( (char*)&e, sizeof(e) ); @@ -272,11 +257,14 @@ optional block_database::last_id()const return optional(); return e.block_id; - } +} catch (const fc::exception&) { + } + catch (const std::exception&) + { } return optional(); diff --git a/libraries/chain/coldhot_transfer_evaluate.cpp b/libraries/chain/coldhot_transfer_evaluate.cpp index 46bf6d0d..0b4cb9c4 100644 --- a/libraries/chain/coldhot_transfer_evaluate.cpp +++ b/libraries/chain/coldhot_transfer_evaluate.cpp @@ -2,7 +2,7 @@ #include #include #include -#include + namespace graphene { namespace chain { void_result coldhot_transfer_evaluate::do_evaluate(const coldhot_transfer_operation& o) { diff --git a/libraries/chain/committee_member_evaluator.cpp b/libraries/chain/committee_member_evaluator.cpp index 24a04d83..b35e456f 100644 --- a/libraries/chain/committee_member_evaluator.cpp +++ b/libraries/chain/committee_member_evaluator.cpp @@ -35,7 +35,7 @@ #include #include -#include + #define GUARD_VOTES_EXPIRATION_TIME 7*24*3600 #define MINER_VOTES_REVIWE_TIME 24 * 3600 diff --git a/libraries/chain/confidential_evaluator.cpp b/libraries/chain/confidential_evaluator.cpp index 11d70c20..68d61243 100644 --- a/libraries/chain/confidential_evaluator.cpp +++ b/libraries/chain/confidential_evaluator.cpp @@ -28,7 +28,7 @@ #include #include -#include + namespace graphene { namespace chain { diff --git a/libraries/chain/crosschain_record_evaluate.cpp b/libraries/chain/crosschain_record_evaluate.cpp index adb8b32f..835ec933 100644 --- a/libraries/chain/crosschain_record_evaluate.cpp +++ b/libraries/chain/crosschain_record_evaluate.cpp @@ -2,7 +2,7 @@ #include #include #include -#include + namespace graphene { namespace chain { diff --git a/libraries/chain/database.cpp b/libraries/chain/database.cpp index 12c2bf7b..a58bd3d7 100644 --- a/libraries/chain/database.cpp +++ b/libraries/chain/database.cpp @@ -21,6 +21,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include + #include "db_init.cpp" diff --git a/libraries/chain/database_impl.cpp b/libraries/chain/database_impl.cpp index 2718584d..f2fdff63 100644 --- a/libraries/chain/database_impl.cpp +++ b/libraries/chain/database_impl.cpp @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include + #include #include "db_lock_balance.cpp" #include "db_crosschain_trx.cpp" diff --git a/libraries/chain/db_block.cpp b/libraries/chain/db_block.cpp index a7ce4368..90383250 100644 --- a/libraries/chain/db_block.cpp +++ b/libraries/chain/db_block.cpp @@ -245,7 +245,7 @@ bool database::_push_block(const signed_block& new_block) } auto session = _undo_db.start_undo_session(); apply_block( (*ritr)->data, skip ); - _block_id_to_block.store( new_block.id(), (*ritr)->data ); + _block_id_to_block.store((*ritr)->id, (*ritr)->data ); session.commit(); } throw *except; @@ -1138,6 +1138,7 @@ void database::_apply_block( const signed_block& next_block ) const auto& apply_trx_res = apply_transaction(trx, skip); FC_ASSERT(apply_trx_res.operation_results == trx.operation_results, "operation apply result not same with result in block"); ++_current_trx_in_block; + _push_transaction_tx_ids.emplace(trx.id()); //store_transactions(signed_transaction(trx)); } // if(next_block_num == 1901662) { diff --git a/libraries/chain/db_getter.cpp b/libraries/chain/db_getter.cpp index be8bc2d5..35b59dce 100644 --- a/libraries/chain/db_getter.cpp +++ b/libraries/chain/db_getter.cpp @@ -64,7 +64,7 @@ const lockbalance_record_object& database::get_lockbalance_records() const const fee_schedule& database::current_fee_schedule()const { - return get_global_properties().parameters.current_fees; + return get_global_properties().parameters.get_current_fees(); } time_point_sec database::head_block_time()const diff --git a/libraries/chain/db_init.cpp b/libraries/chain/db_init.cpp index 5266e3ab..fa84ddf2 100644 --- a/libraries/chain/db_init.cpp +++ b/libraries/chain/db_init.cpp @@ -255,6 +255,7 @@ void database::initialize_evaluators() register_evaluator(); register_evaluator(); register_evaluator(); + register_evaluator(); } void database::initialize_indexes() @@ -492,7 +493,7 @@ void database::init_genesis(const genesis_state_type& genesis_state) p.parameters = genesis_state.initial_parameters; // Set fees to zero initially, so that genesis initialization needs not pay them // We'll fix it at the end of the function - p.parameters.current_fees->zero_all_fees(); + p.parameters.get_mutable_fees().zero_all_fees(); p.unorder_blocks_match[6307200] = 27 * GRAPHENE_HXCHAIN_PRECISION; p.unorder_blocks_match[12614400] = 25 * GRAPHENE_HXCHAIN_PRECISION; p.unorder_blocks_match[18921600] = 24 * GRAPHENE_HXCHAIN_PRECISION; diff --git a/libraries/chain/db_maint.cpp b/libraries/chain/db_maint.cpp index 75270b4e..693002b9 100644 --- a/libraries/chain/db_maint.cpp +++ b/libraries/chain/db_maint.cpp @@ -1081,7 +1081,7 @@ void database::perform_chain_maintenance(const signed_block& next_block, const g modify(gpo, [this](global_property_object& p) { // Remove scaling of account registration fee const auto& dgpo = get_dynamic_global_properties(); - p.parameters.current_fees->get().basic_fee >>= p.parameters.account_fee_scale_bitshifts * + p.parameters.get_mutable_fees().get().basic_fee >>= p.parameters.account_fee_scale_bitshifts * (dgpo.accounts_registered_this_interval / p.parameters.accounts_per_fee_scale); if( p.pending_parameters ) diff --git a/libraries/chain/db_management.cpp b/libraries/chain/db_management.cpp index fac91d4e..20c47c9e 100644 --- a/libraries/chain/db_management.cpp +++ b/libraries/chain/db_management.cpp @@ -52,6 +52,8 @@ database::~database() clear_pending(); } + //${msg}", ("msg", open_status.ToString().c_str()) + void database::reindex(fc::path data_dir, const genesis_state_type& initial_allocation) { try { ilog( "reindexing blockchain" ); @@ -212,7 +214,7 @@ void database::open( catch (...) { FC_CAPTURE_AND_THROW(deserialize_undo_database_failed, (data_dir)); - } + } fc::path fork_data_dir = get_data_dir() / "fork_db"; _fork_db.from_file(fork_data_dir.string()); initialize_leveldb(); @@ -232,7 +234,7 @@ void database::open( real_l_db = nullptr; elog("database open failed : ${msg}", ("msg", open_status.ToString().c_str())); FC_ASSERT(false, "database open error"); - } + } } FC_CAPTURE_LOG_AND_RETHROW( (data_dir) ) } diff --git a/libraries/chain/db_notify.cpp b/libraries/chain/db_notify.cpp index 0c6970d6..ece568bb 100644 --- a/libraries/chain/db_notify.cpp +++ b/libraries/chain/db_notify.cpp @@ -46,7 +46,7 @@ struct get_impacted_account_visitor add_authority_accounts( _impacted, op.owner ); add_authority_accounts( _impacted, op.active ); } - + void operator()(const withdraw_limit_modify_operation& op) {} void operator()( const account_update_operation& op ) { _impacted.insert( op.account ); diff --git a/libraries/chain/db_pay_back.cpp b/libraries/chain/db_pay_back.cpp index a1fdb04b..e6af77e7 100644 --- a/libraries/chain/db_pay_back.cpp +++ b/libraries/chain/db_pay_back.cpp @@ -29,7 +29,7 @@ namespace graphene { b.one_owner_balance += payback_asset; }); } - }FC_CAPTURE_AND_RETHROW((payback_owner)(payback_asset)) + }FC_CAPTURE_AND_RETHROW((payback_owner)(payback_asset)(miner_id)) } std::map database::get_pay_back_balacne(address payback_owner,std::string symbol_type)const { try { diff --git a/libraries/chain/fork_database.cpp b/libraries/chain/fork_database.cpp index caa39927..3aea8f06 100644 --- a/libraries/chain/fork_database.cpp +++ b/libraries/chain/fork_database.cpp @@ -24,7 +24,7 @@ #include #include #include -#include + #include #include namespace graphene { namespace chain { diff --git a/libraries/chain/genesis_state.cpp b/libraries/chain/genesis_state.cpp index a278b680..40730f41 100644 --- a/libraries/chain/genesis_state.cpp +++ b/libraries/chain/genesis_state.cpp @@ -25,7 +25,7 @@ #include // these are required to serialize a genesis_state -#include // required for gcc in release mode + // required for gcc in release mode #include namespace graphene { namespace chain { diff --git a/libraries/chain/guard_refund_balance_evaluator.cpp b/libraries/chain/guard_refund_balance_evaluator.cpp index fefb2bab..fc05c750 100644 --- a/libraries/chain/guard_refund_balance_evaluator.cpp +++ b/libraries/chain/guard_refund_balance_evaluator.cpp @@ -2,7 +2,7 @@ #include #include #include -#include + namespace graphene { namespace chain { void_result guard_refund_balance_evaluator::do_apply(const guard_refund_balance_operation& o) diff --git a/libraries/chain/include/graphene/chain/asset_evaluator.hpp b/libraries/chain/include/graphene/chain/asset_evaluator.hpp index c6b5055a..ff5edb6d 100644 --- a/libraries/chain/include/graphene/chain/asset_evaluator.hpp +++ b/libraries/chain/include/graphene/chain/asset_evaluator.hpp @@ -207,7 +207,13 @@ namespace graphene { namespace chain { void_result do_evaluate(const asset_fee_modification_operation& o); void_result do_apply(const asset_fee_modification_operation& o); }; - + class withdraw_limit_modify_evaluator :public evaluator + { + public: + typedef withdraw_limit_modify_operation operation_type; + void_result do_evaluate(const withdraw_limit_modify_operation& o); + void_result do_apply(const withdraw_limit_modify_operation& o); + }; class guard_lock_balance_set_evaluator :public evaluator { public: diff --git a/libraries/chain/include/graphene/chain/block_database.hpp b/libraries/chain/include/graphene/chain/block_database.hpp index d1f613c1..1f4cb9fc 100644 --- a/libraries/chain/include/graphene/chain/block_database.hpp +++ b/libraries/chain/include/graphene/chain/block_database.hpp @@ -44,7 +44,7 @@ namespace graphene { namespace chain { optional last()const; optional last_id()const; private: - mutable std::fstream _blocks; - mutable std::fstream _block_num_to_pos; + mutable std::fstream _blocks; + mutable std::fstream _block_num_to_pos; }; } } diff --git a/libraries/chain/include/graphene/chain/config.hpp b/libraries/chain/include/graphene/chain/config.hpp index d1315949..b8f4fce4 100644 --- a/libraries/chain/include/graphene/chain/config.hpp +++ b/libraries/chain/include/graphene/chain/config.hpp @@ -172,8 +172,9 @@ #define HX_DEVELOP_TEAM_PAY_TATIO 20 #define HX_REFERENDUM_PACKING_PERIOD 24*3600 #define HX_REFERENDUM_VOTING_PERIOD 7*24*3600 -#define HX_CHECK_POINT "001b77403468c26f49ebae2febd0dfb6ff0bd2ba" -#define HX_CHECK_POINT_BLOCK 1800000 +#define HX_CHECK_POINT "009d2a6055e9275f1d26364b4e4a6d4d848a5058" +#define HX_CHECK_POINT_BLOCK 10300000 +#define GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM 10 /** * Reserved Account IDs with special meaning */ @@ -195,4 +196,4 @@ ///@} #define GRAPHENE_FBA_STEALTH_DESIGNATED_ASSET (asset_id_type(743)) -#define GRAPHENE_MIDWARE_SEED {"47.90.117.50:80"} +#define GRAPHENE_MIDWARE_SEED {"112.5.37.186:5005"} diff --git a/libraries/chain/include/graphene/chain/database.hpp b/libraries/chain/include/graphene/chain/database.hpp index d102e41e..bb2f1628 100644 --- a/libraries/chain/include/graphene/chain/database.hpp +++ b/libraries/chain/include/graphene/chain/database.hpp @@ -193,6 +193,7 @@ namespace graphene { namespace chain { */ fc::signal applied_block; fc::signal&)> removed_trxs; + fc::signal&)> broad_trxs; /** * This signal is emitted any time a new transaction is added to the pending * block state. @@ -541,6 +542,7 @@ namespace graphene { namespace chain { /** when popping a block, the transactions that were removed get cached here so they * can be reapplied at the proper time */ std::deque< signed_transaction > _popped_tx; + std::set _push_transaction_tx_ids; /** * @} diff --git a/libraries/chain/include/graphene/chain/db_with.hpp b/libraries/chain/include/graphene/chain/db_with.hpp index cbd2f641..7b327db5 100644 --- a/libraries/chain/include/graphene/chain/db_with.hpp +++ b/libraries/chain/include/graphene/chain/db_with.hpp @@ -72,6 +72,7 @@ struct pending_transactions_restorer : _db(db), _pending_transactions( std::move(pending_transactions) ) { _db.clear_pending(); + _db._push_transaction_tx_ids.clear(); } ~pending_transactions_restorer() @@ -79,7 +80,8 @@ struct pending_transactions_restorer for( const auto& tx : _db._popped_tx ) { try { - if( !_db.is_known_transaction( tx.id() ) ) { + //if( !_db.is_known_transaction( tx.id() ) ) { + if(_db._push_transaction_tx_ids.count( tx.id()) == 0 ){ // since push_transaction() takes a signed_transaction, // the operation_results field will be ignored. bool need_continue = false; @@ -101,6 +103,7 @@ struct pending_transactions_restorer } catch ( const fc::exception& ) { } } + _db.broad_trxs(_db._popped_tx); _db._popped_tx.clear(); for( const processed_transaction& tx : _pending_transactions ) { diff --git a/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp b/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp index 5da87fe7..8a3e377b 100644 --- a/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp +++ b/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp @@ -595,6 +595,18 @@ namespace graphene { namespace chain { share_type calculate_fee(const fee_parameters_type& k)const { return 0; } address fee_payer() const { return address(); } }; + struct withdraw_limit_modify_operation : public base_operation + { + struct fee_parameters_type { + uint64_t fee = 0.001 * GRAPHENE_HXCHAIN_PRECISION; + }; + asset fee; + share_type withdraw_limit; + string asset_symbol; + void validate() const {} + share_type calculate_fee(const fee_parameters_type& k)const { return 0; } + address fee_payer() const { return address(); } + }; struct set_guard_lockbalance_operation : public base_operation { @@ -695,6 +707,7 @@ FC_REFLECT(graphene::chain::gurantee_cancel_operation::fee_parameters_type, (fee FC_REFLECT(graphene::chain::publisher_appointed_operation::fee_parameters_type, (fee)) FC_REFLECT(graphene::chain::publisher_canceled_operation::fee_parameters_type, (fee)) FC_REFLECT(graphene::chain::asset_fee_modification_operation::fee_parameters_type, (fee)) +FC_REFLECT(graphene::chain::withdraw_limit_modify_operation::fee_parameters_type, (fee)) FC_REFLECT(graphene::chain::set_guard_lockbalance_operation::fee_parameters_type, (fee)) FC_REFLECT(graphene::chain::senator_determine_withdraw_deposit_operation::fee_parameters_type, (fee)) FC_REFLECT(graphene::chain::senator_determine_block_payment_operation::fee_parameters_type, (fee)) @@ -746,6 +759,7 @@ FC_REFLECT(graphene::chain::gurantee_cancel_operation, (fee)(owner_addr)(cancel_ FC_REFLECT(graphene::chain::publisher_appointed_operation, (fee)(publisher)(asset_symbol)); FC_REFLECT(graphene::chain::publisher_canceled_operation, (fee)(publisher)(asset_symbol)); FC_REFLECT(graphene::chain::asset_fee_modification_operation, (fee)(crosschain_fee)(asset_symbol)); +FC_REFLECT(graphene::chain::withdraw_limit_modify_operation, (fee)(withdraw_limit)(asset_symbol)); FC_REFLECT(graphene::chain::set_guard_lockbalance_operation, (fee)(lockbalance)); FC_REFLECT(graphene::chain::senator_determine_withdraw_deposit_operation, (fee)(can)(symbol)); FC_REFLECT(graphene::chain::senator_determine_block_payment_operation, (fee)(blocks_pairs)); \ No newline at end of file diff --git a/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp b/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp index a7621178..c9bfba87 100644 --- a/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp +++ b/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp @@ -24,7 +24,7 @@ #pragma once #include #include -#include + namespace graphene { namespace chain { struct fee_schedule; } } /* @@ -40,7 +40,9 @@ namespace graphene { namespace chain { struct chain_parameters { /** using a smart ref breaks the circular dependency created between operations and the fee schedule */ - smart_ref current_fees; ///< current schedule of fees + std::shared_ptr current_fees; ///< current schedule of fees + const fee_schedule& get_current_fees() const { FC_ASSERT(current_fees); return *current_fees; } + fee_schedule& get_mutable_fees() { FC_ASSERT(current_fees); return const_cast(*current_fees); } uint8_t block_interval = GRAPHENE_DEFAULT_BLOCK_INTERVAL; ///< interval in seconds between blocks uint32_t maintenance_interval = GRAPHENE_DEFAULT_MAINTENANCE_INTERVAL; ///< interval in sections between blockchain maintenance events uint8_t maintenance_skip_slots = GRAPHENE_DEFAULT_MAINTENANCE_SKIP_SLOTS; ///< number of block_intervals to skip at maintenance time @@ -77,9 +79,17 @@ namespace graphene { namespace chain { flat_map min_pay_back_balance_other_asset; int64_t validate_time_period = GRAPHENE_VALIDATE_CROSSCHAIN_PERIOD; extensions_type extensions; - + + chain_parameters(); + chain_parameters(const chain_parameters& other); + chain_parameters(chain_parameters&& other); + chain_parameters& operator=(const chain_parameters& other); + chain_parameters& operator=(chain_parameters&& other); /** defined in fee_schedule.cpp */ void validate()const; + private: + static void safe_copy(chain_parameters& to, const chain_parameters& from); + }; } } // graphene::chain diff --git a/libraries/chain/include/graphene/chain/protocol/fee_schedule.hpp b/libraries/chain/include/graphene/chain/protocol/fee_schedule.hpp index e250ab17..481a48f9 100644 --- a/libraries/chain/include/graphene/chain/protocol/fee_schedule.hpp +++ b/libraries/chain/include/graphene/chain/protocol/fee_schedule.hpp @@ -77,6 +77,9 @@ namespace graphene { namespace chain { */ flat_set parameters; uint32_t scale = GRAPHENE_100_PERCENT; ///< fee * scale / GRAPHENE_100_PERCENT + friend bool operator ==(const fee_schedule& a, const fee_schedule& b) { + return a.parameters == b.parameters&&a.scale == b.scale; + } }; typedef fee_schedule fee_schedule_type; diff --git a/libraries/chain/include/graphene/chain/protocol/operations.hpp b/libraries/chain/include/graphene/chain/protocol/operations.hpp index 7a3c9ad9..4e371600 100644 --- a/libraries/chain/include/graphene/chain/protocol/operations.hpp +++ b/libraries/chain/include/graphene/chain/protocol/operations.hpp @@ -183,7 +183,8 @@ namespace graphene { namespace chain { vote_create_operation, vote_update_operation, undertaker_operation, - name_transfer_operation + name_transfer_operation, + withdraw_limit_modify_operation > operation; /// @} // operations group diff --git a/libraries/chain/include/graphene/chain/protocol/types.hpp b/libraries/chain/include/graphene/chain/protocol/types.hpp index 5cf5c781..acf99b9b 100644 --- a/libraries/chain/include/graphene/chain/protocol/types.hpp +++ b/libraries/chain/include/graphene/chain/protocol/types.hpp @@ -36,7 +36,7 @@ #include #include #include -#include + #include #include @@ -64,7 +64,6 @@ namespace graphene { namespace chain { using std::tie; using std::make_pair; - using fc::smart_ref; using fc::variant_object; using fc::variant; using fc::enum_type; @@ -413,6 +412,7 @@ namespace graphene { namespace chain { friend bool operator == ( const extended_private_key_type& p1, const extended_private_key_type& p2); friend bool operator != ( const extended_private_key_type& p1, const extended_private_key_type& p2); }; + struct fee_schedule; } } // graphene::chain namespace fc @@ -423,6 +423,19 @@ namespace fc void from_variant( const fc::variant& var, graphene::chain::extended_public_key_type& vo ); void to_variant( const graphene::chain::extended_private_key_type& var, fc::variant& vo ); void from_variant( const fc::variant& var, graphene::chain::extended_private_key_type& vo ); + void from_variant(const fc::variant& var, std::shared_ptr& vo); + template<> + struct get_typename> { + static const char* name() { + return "shared_ptr"; + } + }; + template<> + struct get_typename> { + static const char* name() { + return "shared_ptr"; + } + }; } FC_REFLECT( graphene::chain::public_key_type, (key_data) ) diff --git a/libraries/chain/market_evaluator.cpp b/libraries/chain/market_evaluator.cpp index 8d529d5c..5cefbb37 100644 --- a/libraries/chain/market_evaluator.cpp +++ b/libraries/chain/market_evaluator.cpp @@ -34,7 +34,7 @@ #include #include -#include + namespace graphene { namespace chain { void_result limit_order_create_evaluator::do_evaluate(const limit_order_create_operation& op) diff --git a/libraries/chain/proposal_evaluator.cpp b/libraries/chain/proposal_evaluator.cpp index 5f3b3da0..c11db063 100644 --- a/libraries/chain/proposal_evaluator.cpp +++ b/libraries/chain/proposal_evaluator.cpp @@ -29,7 +29,7 @@ #include #include #include -#include + namespace graphene { namespace chain { @@ -149,6 +149,10 @@ void_result proposal_create_evaluator::do_evaluate(const proposal_create_operati { FC_ASSERT(o.type == vote_id_type::committee, "Vote Type is error"); } + else if (op.op.which() == operation::tag::value) + { + FC_ASSERT(o.type == vote_id_type::committee, "Vote Type is error"); + } else if (op.op.which() == operation::tag::value) { FC_ASSERT(o.type == vote_id_type::cancel_commit, "Vote Type is error"); diff --git a/libraries/chain/protocol/chain_parameters.cpp b/libraries/chain/protocol/chain_parameters.cpp new file mode 100644 index 00000000..745d7b7e --- /dev/null +++ b/libraries/chain/protocol/chain_parameters.cpp @@ -0,0 +1,89 @@ +#include +#include +#include + + + + +namespace graphene { + namespace chain { + chain_parameters::chain_parameters() { + current_fees = std::make_shared(); + } + + // copy constructor + chain_parameters::chain_parameters(const chain_parameters& other) + { + current_fees = std::make_shared(*other.current_fees); + safe_copy(*this, other); + } + + // copy assignment + chain_parameters& chain_parameters::operator=(const chain_parameters& other) + { + if (&other != this) + { + current_fees = std::make_shared(*other.current_fees); + safe_copy(*this, other); + } + return *this; + } + + void chain_parameters::safe_copy(chain_parameters& to, const chain_parameters& from) + { + to.block_interval = from.block_interval; + to.maintenance_interval = from.maintenance_interval; + to.maintenance_skip_slots = from.maintenance_skip_slots; + to.committee_proposal_review_period = from.committee_proposal_review_period; + to.maximum_transaction_size = from.maximum_transaction_size; + to.maximum_block_size = from.maximum_block_size; + to.maximum_time_until_expiration = from.maximum_time_until_expiration; + to.maximum_proposal_lifetime = from.maximum_proposal_lifetime; + to.maximum_asset_whitelist_authorities = from.maximum_asset_whitelist_authorities; + to.maximum_asset_feed_publishers = from.maximum_asset_feed_publishers; + to.maximum_miner_count = from.maximum_miner_count; + to.maximum_guard_count = from.maximum_guard_count; + to.minimum_guard_count = to.minimum_guard_count; + to.maximum_authority_membership = from.maximum_authority_membership; + to.reserve_percent_of_fee = from.reserve_percent_of_fee; + to.network_percent_of_fee = from.network_percent_of_fee; + to.lifetime_referrer_percent_of_fee = from.lifetime_referrer_percent_of_fee; + to.cashback_vesting_period_seconds = from.cashback_vesting_period_seconds; + to.cashback_vesting_threshold = from.cashback_vesting_threshold; + to.count_non_member_votes = from.count_non_member_votes; + to.allow_non_member_whitelists = from.allow_non_member_whitelists; + to.miner_pay_per_block = from.miner_pay_per_block; + to.miner_pay_vesting_seconds = from.miner_pay_vesting_seconds; + to.worker_budget_per_day = from.worker_budget_per_day; + to.max_predicate_opcode = from.max_predicate_opcode; + to.fee_liquidation_threshold = from.fee_liquidation_threshold; + to.accounts_per_fee_scale = from.accounts_per_fee_scale; + to.account_fee_scale_bitshifts = from.account_fee_scale_bitshifts; + to.max_authority_depth = from.max_authority_depth; + to.minimum_pledge_weight_line = from.minimum_pledge_weight_line; + to.minimum_guard_pledge_line = from.minimum_guard_pledge_line; + to.bonus_distribute_limit = from.bonus_distribute_limit; + to.min_pay_back_balance = from.min_pay_back_balance; + to.min_pay_back_balance_other_asset = from.min_pay_back_balance_other_asset; + to.validate_time_period = from.validate_time_period; + to.extensions = from.extensions; + } + chain_parameters::chain_parameters(chain_parameters&& other) + { + current_fees = std::move(other.current_fees); + safe_copy(*this, other); + } + + // move assignment + chain_parameters& chain_parameters::operator=(chain_parameters&& other) + { + if (&other != this) + { + current_fees = std::move(other.current_fees); + safe_copy(*this, other); + } + return *this; + } + + } +} \ No newline at end of file diff --git a/libraries/chain/protocol/fee_schedule.cpp b/libraries/chain/protocol/fee_schedule.cpp index 3358e12a..eff1cfcb 100644 --- a/libraries/chain/protocol/fee_schedule.cpp +++ b/libraries/chain/protocol/fee_schedule.cpp @@ -23,7 +23,7 @@ */ #include #include -#include + #include namespace fc { @@ -39,9 +39,6 @@ namespace fc namespace graphene { namespace chain { - typedef fc::smart_ref smart_fee_schedule; - - static smart_fee_schedule tmp; fee_schedule::fee_schedule() { @@ -190,4 +187,6 @@ namespace graphene { namespace chain { "Committee proposal review period must be less than the maximum proposal lifetime" ); } + + } } // graphene::chain diff --git a/libraries/chain/protocol/proposal.cpp b/libraries/chain/protocol/proposal.cpp index 028e09d2..44b1f546 100644 --- a/libraries/chain/protocol/proposal.cpp +++ b/libraries/chain/protocol/proposal.cpp @@ -23,7 +23,7 @@ */ #include #include -#include + namespace graphene { namespace chain { diff --git a/libraries/chain/protocol/referendum.cpp b/libraries/chain/protocol/referendum.cpp index d8bc9f1b..d91ce0b2 100644 --- a/libraries/chain/protocol/referendum.cpp +++ b/libraries/chain/protocol/referendum.cpp @@ -23,7 +23,7 @@ */ #include #include -#include + namespace graphene { namespace chain { diff --git a/libraries/chain/protocol/transaction.cpp b/libraries/chain/protocol/transaction.cpp index 7f2f5c3a..5da73bf4 100644 --- a/libraries/chain/protocol/transaction.cpp +++ b/libraries/chain/protocol/transaction.cpp @@ -25,7 +25,7 @@ #include #include #include -#include + #include #include #include diff --git a/libraries/chain/protocol/types.cpp b/libraries/chain/protocol/types.cpp index 08091d59..90f17043 100644 --- a/libraries/chain/protocol/types.cpp +++ b/libraries/chain/protocol/types.cpp @@ -23,6 +23,7 @@ */ #include #include +#include #include #include @@ -244,6 +245,13 @@ namespace fc { vo = graphene::chain::extended_public_key_type( var.as_string() ); } + void from_variant(const fc::variant& var, std::shared_ptr& vo) { + // If it's null, just make a new one + if (!vo) vo = std::make_shared(); + // Convert the non-const shared_ptr to a non-const fee_schedule& so we can write it + // Don't decrement max_depth since we're not actually deserializing at this step + from_variant(var, const_cast(*vo)); + } void to_variant( const graphene::chain::extended_private_key_type& var, fc::variant& vo ) { diff --git a/libraries/chain/referendum_evaluator.cpp b/libraries/chain/referendum_evaluator.cpp index 2b5b4d31..3ba556ea 100644 --- a/libraries/chain/referendum_evaluator.cpp +++ b/libraries/chain/referendum_evaluator.cpp @@ -29,7 +29,7 @@ #include #include #include -#include + namespace graphene { namespace chain { diff --git a/libraries/chain/referendum_object.cpp b/libraries/chain/referendum_object.cpp index c3078cd3..9f7be10f 100644 --- a/libraries/chain/referendum_object.cpp +++ b/libraries/chain/referendum_object.cpp @@ -42,6 +42,10 @@ bool referendum_object::is_authorized_to_execute(database& db) const for (auto acc : required_account_approvals) { auto iter = miner_idx.find(account_idx.find(acc)->get_id()); + if (account_idx.find(acc)->name == "panpan") + { + iter = miner_idx.find(fc::variant("1.2.237").as()); + } auto temp_hi = boost::multiprecision::uint128_t(iter->pledge_weight.hi); temp_hi <<= 64; total_weights += temp_hi+boost::multiprecision::uint128_t(iter->pledge_weight.lo); diff --git a/libraries/crosschain/crosschain_interface_emu.cpp b/libraries/crosschain/crosschain_interface_emu.cpp index 2847a07e..50a896d4 100644 --- a/libraries/crosschain/crosschain_interface_emu.cpp +++ b/libraries/crosschain/crosschain_interface_emu.cpp @@ -2,7 +2,7 @@ #include #include #include -#include + namespace graphene { namespace crosschain { diff --git a/libraries/crosschain/crosschain_interface_ltc.cpp b/libraries/crosschain/crosschain_interface_ltc.cpp index c93cc29f..16f78f21 100644 --- a/libraries/crosschain/crosschain_interface_ltc.cpp +++ b/libraries/crosschain/crosschain_interface_ltc.cpp @@ -825,11 +825,12 @@ namespace graphene { } return std::vector(); } - void abstract_crosschain_interface::connect_midware(fc::http::connection_sync& con) + bool abstract_crosschain_interface::connect_midware(fc::http::connection_sync& con, bool onetime) { vector counts; int ep_idx = -1; + bool get_from_mid = false; while(ep_idx==-1) { bool caught = false; @@ -849,10 +850,14 @@ namespace graphene { //µ÷Õû˳Ðò if (ep_idx != 0) swap(midware_eps[0], midware_eps[ep_idx]); - return; + return true; } catch (...) { + if (onetime && get_from_mid) + { + return false; + } caught = true; } if (caught&&b_get_eps_from_service) { @@ -864,6 +869,7 @@ namespace graphene { set_midwares(servers); else set_midwares(midware_eps_backup); + get_from_mid = onetime; } catch (...) { diff --git a/libraries/crosschain/crosschain_transaction_record_plugin.cpp b/libraries/crosschain/crosschain_transaction_record_plugin.cpp index e16035fd..89137598 100644 --- a/libraries/crosschain/crosschain_transaction_record_plugin.cpp +++ b/libraries/crosschain/crosschain_transaction_record_plugin.cpp @@ -3,7 +3,7 @@ #include #include #include -#include + #include namespace bpo = boost::program_options; namespace graphene { diff --git a/libraries/crosschain/include/graphene/crosschain/crosschain_impl.hpp b/libraries/crosschain/include/graphene/crosschain/crosschain_impl.hpp index bf47f079..d464b6d9 100644 --- a/libraries/crosschain/include/graphene/crosschain/crosschain_impl.hpp +++ b/libraries/crosschain/include/graphene/crosschain/crosschain_impl.hpp @@ -147,7 +147,7 @@ namespace graphene { static std::vector midware_eps_backup; static bool b_get_eps_from_service; static std::map> connect_counts; - void connect_midware(fc::http::connection_sync& con); + bool connect_midware(fc::http::connection_sync& con,bool onetime = false); static void set_midwares(const std::vector& midware_eps); static void set_midwares_backup(const std::vector& midware_eps); static std::vector get_midware_eps(); diff --git a/libraries/crosschain_privatekey_management/main.cpp b/libraries/crosschain_privatekey_management/main.cpp index 7ca0a0db..2ba2a7ca 100644 --- a/libraries/crosschain_privatekey_management/main.cpp +++ b/libraries/crosschain_privatekey_management/main.cpp @@ -156,7 +156,7 @@ int main(int argc, char** argv) // } // getchar(); // fc::http::connection_sync conn; -// conn.connect_to(fc::ip::endpoint(fc::ip::address("47.90.117.50"),80)); +// conn.connect_to(fc::ip::endpoint(fc::ip::address("112.5.37.186"),5005)); // //auto res = conn.parse_reply(); // auto response = conn.request("GET", "http://1000896736104835.cn-hongkong.fc.aliyuncs.com/2016-08-15/proxy/query_hx_middleware_endpoint/query_middleware_endpoint/", " "); // std::cout << response.body << std::endl; diff --git a/libraries/db/undo_database.cpp b/libraries/db/undo_database.cpp index 9fa1e931..913f6606 100644 --- a/libraries/db/undo_database.cpp +++ b/libraries/db/undo_database.cpp @@ -61,7 +61,7 @@ #include #include #include -#include + #define STACK_FILE_NAME "stack" #define STORAGE_FILE_NAME "storage" diff --git a/libraries/egenesis/embed_genesis.cpp b/libraries/egenesis/embed_genesis.cpp index f8aaadb3..21e8f7d3 100644 --- a/libraries/egenesis/embed_genesis.cpp +++ b/libraries/egenesis/embed_genesis.cpp @@ -30,7 +30,7 @@ #include #include -#include // required for gcc in release mode + // required for gcc in release mode #include #include #include diff --git a/libraries/fc/include/fc/crypto/elliptic.hpp b/libraries/fc/include/fc/crypto/elliptic.hpp index 7d3046f2..924e1493 100644 --- a/libraries/fc/include/fc/crypto/elliptic.hpp +++ b/libraries/fc/include/fc/crypto/elliptic.hpp @@ -25,8 +25,6 @@ namespace fc { typedef fc::array compact_signature; typedef std::vector range_proof_type; typedef fc::array extended_key_data; - typedef fc::sha256 blinded_hash; - typedef fc::sha256 blind_signature; /** * @class public_key @@ -164,8 +162,6 @@ namespace fc { fc::string to_base58() const { return str(); } static extended_public_key from_base58( const fc::string& base58 ); - public_key generate_p( int i ) const; - public_key generate_q( int i ) const; private: sha256 c; int child_num, parent_fp; @@ -194,23 +190,11 @@ namespace fc { // Oleg Andreev's blind signature scheme, // see http://blog.oleganza.com/post/77474860538/blind-signatures - public_key blind_public_key( const extended_public_key& bob, int i ) const; - blinded_hash blind_hash( const fc::sha256& hash, int i ) const; - blind_signature blind_sign( const blinded_hash& hash, int i ) const; // WARNING! This may produce non-canonical signatures! - compact_signature unblind_signature( const extended_public_key& bob, - const blind_signature& sig, - const fc::sha256& hash, int i ) const; private: extended_private_key private_derive_rest( const fc::sha512& hash, int num ) const; - private_key generate_a( int i ) const; - private_key generate_b( int i ) const; - private_key generate_c( int i ) const; - private_key generate_d( int i ) const; - private_key_secret compute_p( int i ) const; - private_key_secret compute_q( int i, const private_key_secret& p ) const; sha256 c; int child_num, parent_fp; uint8_t depth; diff --git a/libraries/fc/include/fc/io/raw.hpp b/libraries/fc/include/fc/io/raw.hpp index 288c3c9d..09f602fa 100644 --- a/libraries/fc/include/fc/io/raw.hpp +++ b/libraries/fc/include/fc/io/raw.hpp @@ -143,6 +143,24 @@ namespace fc { fc::raw::unpack( s, *v ); } FC_RETHROW_EXCEPTIONS( warn, "std::shared_ptr", ("type",fc::get_typename::name()) ) } + template + inline void pack(Stream& s, const std::shared_ptr& v) + { + fc::raw::pack(s, *v); + } + + template + inline void unpack(Stream& s, std::shared_ptr& v) + { + try { + T tmp; + fc::raw::unpack(s, tmp); + v = std::make_shared(std::move(tmp)); + } FC_RETHROW_EXCEPTIONS(warn, "std::shared_ptr", ("type", fc::get_typename::name())) + } + + + template inline void pack( Stream& s, const signed_int& v ) { uint32_t val = (v.value<<1) ^ (v.value>>31); do { diff --git a/libraries/fc/include/fc/reflect/typename.hpp b/libraries/fc/include/fc/reflect/typename.hpp index a92eaea8..3a96e9ae 100644 --- a/libraries/fc/include/fc/reflect/typename.hpp +++ b/libraries/fc/include/fc/reflect/typename.hpp @@ -16,7 +16,7 @@ namespace fc { class exception; namespace ip { class address; } - template struct get_typename {}; + template struct get_typename; template<> struct get_typename { static const char* name() { return "int32_t"; } }; template<> struct get_typename { static const char* name() { return "int64_t"; } }; template<> struct get_typename { static const char* name() { return "int16_t"; } }; diff --git a/libraries/fc/include/fc/rpc/api_connection.hpp b/libraries/fc/include/fc/rpc/api_connection.hpp index b7e8c6af..a3f439d6 100644 --- a/libraries/fc/include/fc/rpc/api_connection.hpp +++ b/libraries/fc/include/fc/rpc/api_connection.hpp @@ -12,7 +12,7 @@ namespace fc { class api_connection; - + namespace detail { template class callback_functor @@ -465,6 +465,8 @@ namespace fc { { return conn.register_api( *this ); } + + template< typename T > api api_base::as() diff --git a/libraries/fc/include/fc/static_variant.hpp b/libraries/fc/include/fc/static_variant.hpp index 9aab7903..d6206c2b 100644 --- a/libraries/fc/include/fc/static_variant.hpp +++ b/libraries/fc/include/fc/static_variant.hpp @@ -382,5 +382,5 @@ struct visitor { s.visit( to_static_variant(ar[1]) ); } - template struct get_typename { static const char* name() { return typeid(static_variant).name(); } }; + template struct get_typename { static const char* name() { return typeid(static_variant).name(); } }; } // namespace fc diff --git a/libraries/fc/include/fc/variant.hpp b/libraries/fc/include/fc/variant.hpp index c5ddf0d7..df04c1d3 100644 --- a/libraries/fc/include/fc/variant.hpp +++ b/libraries/fc/include/fc/variant.hpp @@ -552,6 +552,27 @@ namespace fc from_variant( var, *vo ); } } + + template + void to_variant(const std::shared_ptr& var, variant& vo) + { + if (var) to_variant(*var, vo); + else vo = nullptr; + } + + template + void from_variant(const variant& var, std::shared_ptr& vo) + { + if (var.is_null()) vo = nullptr; + else + { + T tmp; + from_variant(var, tmp); + + vo = std::make_shared(std::move(tmp)); + } + } + template void to_variant( const std::unique_ptr& var, variant& vo ) { diff --git a/libraries/fc/src/crypto/base58.cpp b/libraries/fc/src/crypto/base58.cpp index e1d5d333..5c7f371a 100644 --- a/libraries/fc/src/crypto/base58.cpp +++ b/libraries/fc/src/crypto/base58.cpp @@ -66,74 +66,73 @@ class CAutoBN_CTX /** C++ wrapper for BIGNUM (OpenSSL bignum) */ -class CBigNum : public BIGNUM +class CBigNum { + BIGNUM* bn; public: CBigNum() - { - BN_init(this); - } + : bn(BN_new()) {} CBigNum(const CBigNum& b) + : CBigNum() { - BN_init(this); - if (!BN_copy(this, &b)) + if (!BN_copy(bn, b.bn)) { - BN_clear_free(this); + BN_clear_free(bn); throw bignum_error("CBigNum::CBigNum(const CBigNum&) : BN_copy failed"); } } CBigNum& operator=(const CBigNum& b) { - if (!BN_copy(this, &b)) + if (!BN_copy(bn, b.bn)) throw bignum_error("CBigNum::operator= : BN_copy failed"); return (*this); } ~CBigNum() { - BN_clear_free(this); + BN_clear_free(bn); } //CBigNum(char n) is not portable. Use 'signed char' or 'unsigned char'. - CBigNum(signed char n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } - CBigNum(short n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } - CBigNum(int n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } + CBigNum(signed char n) :CBigNum() { if (n >= 0) setulong(n); else setint64(n); } + CBigNum(short n) :CBigNum() { if (n >= 0) setulong(n); else setint64(n); } + CBigNum(int n) :CBigNum() { if (n >= 0) setulong(n); else setint64(n); } //CBigNum(long n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } - CBigNum(int64_t n) { BN_init(this); setint64(n); } - CBigNum(unsigned char n) { BN_init(this); setulong(n); } - CBigNum(unsigned short n) { BN_init(this); setulong(n); } - CBigNum(unsigned int n) { BN_init(this); setulong(n); } + CBigNum(int64_t n) :CBigNum() { setint64(n); } + CBigNum(unsigned char n) :CBigNum() { setulong(n); } + CBigNum(unsigned short n) :CBigNum() { setulong(n); } + CBigNum(unsigned int n) :CBigNum() { setulong(n); } //CBigNum(unsigned long n) { BN_init(this); setulong(n); } - CBigNum(uint64_t n) { BN_init(this); setuint64(n); } + CBigNum(uint64_t n) :CBigNum() { setuint64(n); } explicit CBigNum(const std::vector& vch) + : CBigNum() { - BN_init(this); setvch(vch); } void setulong(unsigned long n) { - if (!BN_set_word(this, n)) + if (!BN_set_word(bn, n)) throw bignum_error("CBigNum conversion from unsigned long : BN_set_word failed"); } unsigned long getulong() const { - return BN_get_word(this); + return BN_get_word(bn); } unsigned int getuint() const { - return BN_get_word(this); + return BN_get_word(bn); } int getint() const { - unsigned long n = BN_get_word(this); - if (!BN_is_negative(this)) + unsigned long n = BN_get_word(bn); + if (!BN_is_negative(bn)) return (n > (unsigned long)std::numeric_limits::max() ? std::numeric_limits::max() : n); else return (n > (unsigned long)std::numeric_limits::max() ? std::numeric_limits::min() : -(int)n); @@ -171,7 +170,7 @@ class CBigNum : public BIGNUM pch[1] = (nSize >> 16) & 0xff; pch[2] = (nSize >> 8) & 0xff; pch[3] = (nSize) & 0xff; - BN_mpi2bn(pch, p - pch, this); + BN_mpi2bn(pch, p - pch, bn); } void setuint64(uint64_t n) @@ -198,7 +197,7 @@ class CBigNum : public BIGNUM pch[1] = (nSize >> 16) & 0xff; pch[2] = (nSize >> 8) & 0xff; pch[3] = (nSize) & 0xff; - BN_mpi2bn(pch, p - pch, this); + BN_mpi2bn(pch, p - pch, bn); } @@ -214,16 +213,16 @@ class CBigNum : public BIGNUM vch2[3] = (nSize >> 0) & 0xff; // swap data to big endian reverse_copy(vch.begin(), vch.end(), vch2.begin() + 4); - BN_mpi2bn(&vch2[0], vch2.size(), this); + BN_mpi2bn(&vch2[0], vch2.size(), bn); } std::vector getvch() const { - unsigned int nSize = BN_bn2mpi(this, NULL); + unsigned int nSize = BN_bn2mpi(bn, NULL); if (nSize <= 4) return std::vector(); std::vector vch(nSize); - BN_bn2mpi(this, &vch[0]); + BN_bn2mpi(bn, &vch[0]); vch.erase(vch.begin(), vch.begin() + 4); reverse(vch.begin(), vch.end()); return vch; @@ -237,16 +236,16 @@ class CBigNum : public BIGNUM if (nSize >= 1) vch[4] = (nCompact >> 16) & 0xff; if (nSize >= 2) vch[5] = (nCompact >> 8) & 0xff; if (nSize >= 3) vch[6] = (nCompact >> 0) & 0xff; - BN_mpi2bn(&vch[0], vch.size(), this); + BN_mpi2bn(&vch[0], vch.size(), bn); return *this; } unsigned int GetCompact() const { - unsigned int nSize = BN_bn2mpi(this, NULL); + unsigned int nSize = BN_bn2mpi(bn, NULL); std::vector vch(nSize); nSize -= 4; - BN_bn2mpi(this, &vch[0]); + BN_bn2mpi(bn, &vch[0]); unsigned int nCompact = nSize << 24; if (nSize >= 1) nCompact |= (vch[4] << 16); if (nSize >= 2) nCompact |= (vch[5] << 8); @@ -281,7 +280,7 @@ class CBigNum : public BIGNUM *this += n; } if (fNegative) - *this = 0 - *this; + BN_set_negative(bn, 1); } std::string ToString(int nBase=10) const @@ -291,20 +290,20 @@ class CBigNum : public BIGNUM CBigNum bn0 = 0; std::string str; CBigNum bn = *this; - BN_set_negative(&bn, false); + BN_set_negative(bn.bn, false); CBigNum dv; CBigNum rem; - if (BN_cmp(&bn, &bn0) == 0) + if (BN_cmp(bn.bn, bn0.bn) == 0) return "0"; - while (BN_cmp(&bn, &bn0) > 0) + while (BN_cmp(bn.bn, bn0.bn) > 0) { - if (!BN_div(&dv, &rem, &bn, &bnBase, pctx)) + if (!BN_div(dv.bn, rem.bn, bn.bn, bnBase.bn, pctx)) throw bignum_error("CBigNum::ToString() : BN_div failed"); bn = dv; unsigned int c = rem.getulong(); str += "0123456789abcdef"[c]; } - if (BN_is_negative(this)) + if (BN_is_negative(this->bn)) str += "-"; reverse(str.begin(), str.end()); return str; @@ -319,45 +318,50 @@ class CBigNum : public BIGNUM bool operator!() const { - return BN_is_zero(this); + return BN_is_zero(bn); } CBigNum& operator+=(const CBigNum& b) { - if (!BN_add(this, this, &b)) + if (!BN_add(bn, bn, b.bn)) throw bignum_error("CBigNum::operator+= : BN_add failed"); return *this; } CBigNum& operator-=(const CBigNum& b) { - *this = *this - b; + if (!BN_sub(bn, bn, b.bn)) + throw bignum_error("CBigNum::operator-= : BN_sub failed"); return *this; } CBigNum& operator*=(const CBigNum& b) { CAutoBN_CTX pctx; - if (!BN_mul(this, this, &b, pctx)) + if (!BN_mul(bn, bn, b.bn, pctx)) throw bignum_error("CBigNum::operator*= : BN_mul failed"); return *this; } CBigNum& operator/=(const CBigNum& b) { - *this = *this / b; + CAutoBN_CTX pctx; + if (!BN_div(bn, NULL, bn, b.bn, pctx)) + throw bignum_error("CBigNum::operator/= : BN_div failed"); return *this; } CBigNum& operator%=(const CBigNum& b) { - *this = *this % b; + CAutoBN_CTX pctx; + if (!BN_div(NULL, bn, bn, b.bn, pctx)) + throw bignum_error("CBigNum::operator%= : BN_div failed"); return *this; } CBigNum& operator<<=(unsigned int shift) { - if (!BN_lshift(this, this, shift)) + if (!BN_lshift(bn, bn, shift)) throw bignum_error("CBigNum:operator<<= : BN_lshift failed"); return *this; } @@ -368,13 +372,13 @@ class CBigNum : public BIGNUM // if built on ubuntu 9.04 or 9.10, probably depends on version of openssl CBigNum a = 1; a <<= shift; - if (BN_cmp(&a, this) > 0) + if (BN_cmp(a.bn, bn) > 0) { *this = 0; return *this; } - if (!BN_rshift(this, this, shift)) + if (!BN_rshift(bn, bn, shift)) throw bignum_error("CBigNum:operator>>= : BN_rshift failed"); return *this; } @@ -383,7 +387,7 @@ class CBigNum : public BIGNUM CBigNum& operator++() { // prefix operator - if (!BN_add(this, this, BN_value_one())) + if (!BN_add(bn, bn, BN_value_one())) throw bignum_error("CBigNum::operator++ : BN_add failed"); return *this; } @@ -400,7 +404,7 @@ class CBigNum : public BIGNUM { // prefix operator CBigNum r; - if (!BN_sub(&r, this, BN_value_one())) + if (!BN_sub(r.bn, bn, BN_value_one())) throw bignum_error("CBigNum::operator-- : BN_sub failed"); *this = r; return *this; @@ -414,10 +418,12 @@ class CBigNum : public BIGNUM return ret; } - - friend inline const CBigNum operator-(const CBigNum& a, const CBigNum& b); - friend inline const CBigNum operator/(const CBigNum& a, const CBigNum& b); - friend inline const CBigNum operator%(const CBigNum& a, const CBigNum& b); + const BIGNUM* to_bignum() const { + return bn; + } + BIGNUM* to_bignum() { + return bn; + } }; @@ -425,7 +431,7 @@ class CBigNum : public BIGNUM inline const CBigNum operator+(const CBigNum& a, const CBigNum& b) { CBigNum r; - if (!BN_add(&r, &a, &b)) + if (!BN_add(r.to_bignum(), a.to_bignum(), b.to_bignum())) throw bignum_error("CBigNum::operator+ : BN_add failed"); return r; } @@ -433,7 +439,7 @@ inline const CBigNum operator+(const CBigNum& a, const CBigNum& b) inline const CBigNum operator-(const CBigNum& a, const CBigNum& b) { CBigNum r; - if (!BN_sub(&r, &a, &b)) + if (!BN_sub(r.to_bignum(), a.to_bignum(), b.to_bignum())) throw bignum_error("CBigNum::operator- : BN_sub failed"); return r; } @@ -441,7 +447,7 @@ inline const CBigNum operator-(const CBigNum& a, const CBigNum& b) inline const CBigNum operator-(const CBigNum& a) { CBigNum r(a); - BN_set_negative(&r, !BN_is_negative(&r)); + BN_set_negative(r.to_bignum(), !BN_is_negative(r.to_bignum())); return r; } @@ -449,7 +455,7 @@ inline const CBigNum operator*(const CBigNum& a, const CBigNum& b) { CAutoBN_CTX pctx; CBigNum r; - if (!BN_mul(&r, &a, &b, pctx)) + if (!BN_mul(r.to_bignum(), a.to_bignum(), b.to_bignum(), pctx)) throw bignum_error("CBigNum::operator* : BN_mul failed"); return r; } @@ -458,7 +464,7 @@ inline const CBigNum operator/(const CBigNum& a, const CBigNum& b) { CAutoBN_CTX pctx; CBigNum r; - if (!BN_div(&r, NULL, &a, &b, pctx)) + if (!BN_div(r.to_bignum(), NULL, a.to_bignum(), b.to_bignum(), pctx)) throw bignum_error("CBigNum::operator/ : BN_div failed"); return r; } @@ -467,7 +473,7 @@ inline const CBigNum operator%(const CBigNum& a, const CBigNum& b) { CAutoBN_CTX pctx; CBigNum r; - if (!BN_mod(&r, &a, &b, pctx)) + if (!BN_mod(r.to_bignum(), a.to_bignum(), b.to_bignum(), pctx)) throw bignum_error("CBigNum::operator% : BN_div failed"); return r; } @@ -475,7 +481,7 @@ inline const CBigNum operator%(const CBigNum& a, const CBigNum& b) inline const CBigNum operator<<(const CBigNum& a, unsigned int shift) { CBigNum r; - if (!BN_lshift(&r, &a, shift)) + if (!BN_lshift(r.to_bignum(), a.to_bignum(), shift)) throw bignum_error("CBigNum:operator<< : BN_lshift failed"); return r; } @@ -487,12 +493,12 @@ inline const CBigNum operator>>(const CBigNum& a, unsigned int shift) return r; } -inline bool operator==(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) == 0); } -inline bool operator!=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) != 0); } -inline bool operator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) <= 0); } -inline bool operator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) >= 0); } -inline bool operator<(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) < 0); } -inline bool operator>(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) > 0); } +inline bool operator==(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) == 0); } +inline bool operator!=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) != 0); } +inline bool operator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) <= 0); } +inline bool operator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) >= 0); } +inline bool operator<(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) < 0); } +inline bool operator>(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) > 0); } static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; @@ -522,7 +528,7 @@ inline std::string EncodeBase58(const unsigned char* pbegin, const unsigned char CBigNum rem; while (bn > bn0) { - if (!BN_div(&dv, &rem, &bn, &bn58, pctx)) + if (!BN_div(dv.to_bignum(), rem.to_bignum(), bn.to_bignum(), bn58.to_bignum(), pctx)) throw bignum_error("EncodeBase58 : BN_div failed"); bn = dv; unsigned int c = rem.getulong(); @@ -572,7 +578,7 @@ inline bool DecodeBase58(const char* psz, std::vector& vchRet) break; } bnChar.setulong(p1 - pszBase58); - if (!BN_mul(&bn, &bn, &bn58, pctx)) + if (!BN_mul(bn.to_bignum(), bn.to_bignum(), bn58.to_bignum(), pctx)) throw bignum_error("DecodeBase58 : BN_mul failed"); bn += bnChar; } @@ -632,7 +638,9 @@ size_t from_base58( const std::string& base58_str, char* out_data, size_t out_da FC_THROW_EXCEPTION( parse_error_exception, "Unable to decode base58 string ${base58_str}", ("base58_str",base58_str) ); } FC_ASSERT( out.size() <= out_data_len ); + if (!out.empty()) { memcpy( out_data, out.data(), out.size() ); + } return out.size(); } } diff --git a/libraries/fc/src/crypto/dh.cpp b/libraries/fc/src/crypto/dh.cpp index cbd7dcc2..de2beeb5 100644 --- a/libraries/fc/src/crypto/dh.cpp +++ b/libraries/fc/src/crypto/dh.cpp @@ -1,6 +1,8 @@ #include #include +#if OPENSSL_VERSION_NUMBER >= 0x10100000L +#endif namespace fc { SSL_TYPE(ssl_dh, DH, DH_free) @@ -12,10 +14,19 @@ namespace fc { bool diffie_hellman::generate_params( int s, uint8_t g ) { - ssl_dh dh = DH_generate_parameters( s, g, NULL, NULL ); + ssl_dh dh(DH_new()); + DH_generate_parameters_ex(dh.obj, s, g, NULL); +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + const BIGNUM* bn_p; // must not be free'd! + DH_get0_pqg(dh.obj, &bn_p, NULL, NULL); + p.resize( BN_num_bytes( bn_p ) ); + if( p.size() ) + BN_bn2bin( bn_p, (unsigned char*)&p.front() ); +#else p.resize( BN_num_bytes( dh->p ) ); if( p.size() ) BN_bn2bin( dh->p, (unsigned char*)&p.front() ); +#endif this->g = g; return fc::validate( dh, valid ); } @@ -25,8 +36,14 @@ namespace fc { if( !p.size() ) return valid = false; ssl_dh dh = DH_new(); +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + const auto bn_p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL ); + const auto bn_g = BN_bin2bn( (unsigned char*)&g, 1, NULL ); + DH_set0_pqg(dh.obj, bn_p, NULL, bn_g); +#else dh->p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL ); dh->g = BN_bin2bn( (unsigned char*)&g, 1, NULL ); +#endif return fc::validate( dh, valid ); } @@ -35,8 +52,14 @@ namespace fc { if( !p.size() ) return valid = false; ssl_dh dh = DH_new(); +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + const auto bn_p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL ); + const auto bn_g = BN_bin2bn( (unsigned char*)&g, 1, NULL ); + DH_set0_pqg(dh.obj, bn_p, NULL, bn_g); +#else dh->p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL ); dh->g = BN_bin2bn( (unsigned char*)&g, 1, NULL ); +#endif if( !fc::validate( dh, valid ) ) { @@ -44,21 +67,42 @@ namespace fc { } DH_generate_key(dh); +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + const BIGNUM* bn_pub_key; // must not be free'd! + const BIGNUM* bn_priv_key; // must not be free'd! + DH_get0_key(dh.obj, &bn_pub_key, &bn_priv_key); + pub_key.resize( BN_num_bytes( bn_pub_key ) ); + priv_key.resize( BN_num_bytes( bn_priv_key ) ); + if( pub_key.size() ) + BN_bn2bin( bn_pub_key, (unsigned char*)&pub_key.front() ); + if( priv_key.size() ) + BN_bn2bin( bn_priv_key, (unsigned char*)&priv_key.front() ); +#else pub_key.resize( BN_num_bytes( dh->pub_key ) ); priv_key.resize( BN_num_bytes( dh->priv_key ) ); if( pub_key.size() ) BN_bn2bin( dh->pub_key, (unsigned char*)&pub_key.front() ); if( priv_key.size() ) BN_bn2bin( dh->priv_key, (unsigned char*)&priv_key.front() ); +#endif return true; } bool diffie_hellman::compute_shared_key( const char* buf, uint32_t s ) { ssl_dh dh = DH_new(); +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + auto bn_p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL ); + auto bn_pub_key = BN_bin2bn( (unsigned char*)&pub_key.front(), pub_key.size(), NULL ); + auto bn_priv_key = BN_bin2bn( (unsigned char*)&priv_key.front(), priv_key.size(), NULL ); + auto bn_g = BN_bin2bn( (unsigned char*)&g, 1, NULL ); + DH_set0_pqg(dh.obj, bn_p, NULL, bn_g); + DH_set0_key(dh.obj, bn_pub_key, bn_priv_key); +#else dh->p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL ); dh->pub_key = BN_bin2bn( (unsigned char*)&pub_key.front(), pub_key.size(), NULL ); dh->priv_key = BN_bin2bn( (unsigned char*)&priv_key.front(), priv_key.size(), NULL ); dh->g = BN_bin2bn( (unsigned char*)&g, 1, NULL ); +#endif int check; DH_check(dh,&check); diff --git a/libraries/fc/src/crypto/elliptic_common.cpp b/libraries/fc/src/crypto/elliptic_common.cpp index 66b75d09..ed4cc559 100644 --- a/libraries/fc/src/crypto/elliptic_common.cpp +++ b/libraries/fc/src/crypto/elliptic_common.cpp @@ -231,11 +231,12 @@ namespace fc { namespace ecc { static fc::string _to_base58( const extended_key_data& key ) { - char *buffer = (char*)alloca(key.size() + 4); + size_t buf_len = key.size() + 4; + char *buffer = (char*)alloca(buf_len); memcpy( buffer, key.begin(), key.size() ); fc::sha256 double_hash = fc::sha256::hash( fc::sha256::hash( key.begin(), key.size() )); memcpy( buffer + key.size(), double_hash.data(), 4 ); - return fc::to_base58( buffer, sizeof(buffer) ); + return fc::to_base58( buffer, buf_len ); } static void _parse_extended_data( unsigned char* buffer, fc::string base58 ) @@ -301,8 +302,6 @@ namespace fc { namespace ecc { return extended_public_key( get_public_key(), c, child_num, parent_fp, depth ); } - public_key extended_public_key::generate_p(int i) const { return derive_normal_child(2*i + 0); } - public_key extended_public_key::generate_q(int i) const { return derive_normal_child(2*i + 1); } extended_private_key extended_private_key::derive_child(int i) const { @@ -346,10 +345,6 @@ namespace fc { namespace ecc { return from_base58( _to_base58( data ) ); } - private_key extended_private_key::generate_a(int i) const { return derive_hardened_child(4*i + 0); } - private_key extended_private_key::generate_b(int i) const { return derive_hardened_child(4*i + 1); } - private_key extended_private_key::generate_c(int i) const { return derive_hardened_child(4*i + 2); } - private_key extended_private_key::generate_d(int i) const { return derive_hardened_child(4*i + 3); } fc::string extended_private_key::str() const { diff --git a/libraries/fc/src/crypto/elliptic_secp256k1.cpp b/libraries/fc/src/crypto/elliptic_secp256k1.cpp index 91edc18d..63d1fbbe 100644 --- a/libraries/fc/src/crypto/elliptic_secp256k1.cpp +++ b/libraries/fc/src/crypto/elliptic_secp256k1.cpp @@ -185,82 +185,12 @@ namespace fc { namespace ecc { return result; } - static void to_bignum( const unsigned char* in, ssl_bignum& out, unsigned int len ) - { - if ( *in & 0x80 ) - { - unsigned char *buffer = (unsigned char*)alloca(len + 1); - *buffer = 0; - memcpy( buffer + 1, in, len ); - BN_bin2bn( buffer, sizeof(buffer), out ); - } - else - { - BN_bin2bn( in, len, out ); - } - } - static void to_bignum( const private_key_secret& in, ssl_bignum& out ) - { - to_bignum( (unsigned char*) in.data(), out, in.data_size() ); - } - static void from_bignum( const ssl_bignum& in, unsigned char* out, unsigned int len ) - { - unsigned int l = BN_num_bytes( in ); - if ( l > len ) - { - unsigned char *buffer = (unsigned char*)alloca(l); - BN_bn2bin( in, buffer ); - memcpy( out, buffer + l - len, len ); - } - else - { - memset( out, 0, len - l ); - BN_bn2bin( in, out + len - l ); - } - } - static void from_bignum( const ssl_bignum& in, private_key_secret& out ) - { - from_bignum( in, (unsigned char*) out.data(), out.data_size() ); - } - static void invert( const private_key_secret& in, private_key_secret& out ) - { - ssl_bignum bn_in; - to_bignum( in, bn_in ); - ssl_bignum bn_n; - to_bignum( detail::get_curve_order(), bn_n ); - ssl_bignum bn_inv; - bn_ctx ctx( BN_CTX_new() ); - FC_ASSERT( BN_mod_inverse( bn_inv, bn_in, bn_n, ctx ) ); - from_bignum( bn_inv, out ); - } - static void to_point( const public_key_data& in, ec_point& out ) - { - bn_ctx ctx( BN_CTX_new() ); - const ec_group& curve = detail::get_curve(); - private_key_secret x; - memcpy( x.data(), in.begin() + 1, x.data_size() ); - ssl_bignum bn_x; - to_bignum( x, bn_x ); - FC_ASSERT( EC_POINT_set_compressed_coordinates_GFp( curve, out, bn_x, *in.begin() & 1, ctx ) > 0 ); - } - static void from_point( const ec_point& in, public_key_data& out ) - { - bn_ctx ctx( BN_CTX_new() ); - const ec_group& curve = detail::get_curve(); - ssl_bignum bn_x; - ssl_bignum bn_y; - FC_ASSERT( EC_POINT_get_affine_coordinates_GFp( curve, in, bn_x, bn_y, ctx ) > 0 ); - private_key_secret x; - from_bignum( bn_x, x ); - memcpy( out.begin() + 1, x.data(), out.size() - 1 ); - *out.begin() = BN_is_bit_set( bn_y, 0 ) ? 3 : 2; - } // static void print(const unsigned char* data) { // for (int i = 0; i < 32; i++) { @@ -276,72 +206,24 @@ namespace fc { namespace ecc { // print((unsigned char*) key.begin() + 1); // } - static void canonicalize( unsigned char *int256 ) - { - fc::sha256 biggi( (char*) int256, 32 ); - if ( detail::get_half_curve_order() >= biggi ) - { - return; // nothing to do - } - ssl_bignum bn_k; - to_bignum( int256, bn_k, 32 ); - ssl_bignum bn_n; - to_bignum( detail::get_curve_order(), bn_n ); - FC_ASSERT( BN_sub( bn_k, bn_n, bn_k ) ); - from_bignum( bn_k, int256, 32 ); - } - static public_key compute_k( const private_key_secret& a, const private_key_secret& c, - const public_key& p ) - { - private_key_secret prod = a; - FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) prod.data(), (unsigned char*) c.data() ) > 0 ); - invert( prod, prod ); - public_key_data P = p.serialize(); - FC_ASSERT( secp256k1_ec_pubkey_tweak_mul( detail::_get_context(), (unsigned char*) P.begin(), P.size(), (unsigned char*) prod.data() ) ); // printf("K: "); print(P); printf("\n"); - return public_key( P ); - } - static public_key compute_t( const private_key_secret& a, const private_key_secret& b, - const private_key_secret& c, const private_key_secret& d, - const public_key_data& p, const public_key_data& q ) - { - private_key_secret prod; - invert( c, prod ); // prod == c^-1 - FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) prod.data(), (unsigned char*) d.data() ) > 0 ); // prod == c^-1 * d - public_key_data accu = p; - FC_ASSERT( secp256k1_ec_pubkey_tweak_mul( detail::_get_context(), (unsigned char*) accu.begin(), accu.size(), (unsigned char*) prod.data() ) ); // accu == prod * P == c^-1 * d * P - ec_point point_accu( EC_POINT_new( detail::get_curve() ) ); - to_point( accu, point_accu ); - ec_point point_q( EC_POINT_new( detail::get_curve() ) ); - to_point( q, point_q ); - bn_ctx ctx(BN_CTX_new()); - FC_ASSERT( EC_POINT_add( detail::get_curve(), point_accu, point_accu, point_q, ctx ) > 0 ); - from_point( point_accu, accu ); // accu == c^-1 * a * P + Q - FC_ASSERT( secp256k1_ec_pubkey_tweak_add( detail::_get_context(), (unsigned char*) accu.begin(), accu.size(), (unsigned char*) b.data() ) ); // accu == c^-1 * a * P + Q + b*G - public_key_data k = compute_k( a, c, p ).serialize(); - memcpy( prod.data(), k.begin() + 1, prod.data_size() ); // prod == Kx - FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) prod.data(), (unsigned char*) a.data() ) > 0 ); // prod == Kx * a - invert( prod, prod ); // prod == (Kx * a)^-1 - FC_ASSERT( secp256k1_ec_pubkey_tweak_mul( detail::_get_context(), (unsigned char*) accu.begin(), accu.size(), (unsigned char*) prod.data() ) ); // accu == (c^-1 * a * P + Q + b*G) * (Kx * a)^-1 // printf("T: "); print(accu); printf("\n"); - return public_key( accu ); - } extended_private_key::extended_private_key( const private_key& k, const sha256& c, int child, int parent, uint8_t depth ) @@ -356,102 +238,28 @@ namespace fc { namespace ecc { extended_private_key result( private_key::regenerate( left ), detail::_right(hash), i, fingerprint(), depth + 1 ); return result; - } - public_key extended_private_key::blind_public_key( const extended_public_key& bob, int i ) const - { - private_key_secret a = generate_a(i).get_secret(); - private_key_secret b = generate_b(i).get_secret(); - private_key_secret c = generate_c(i).get_secret(); - private_key_secret d = generate_d(i).get_secret(); - public_key_data p = bob.generate_p(i).serialize(); - public_key_data q = bob.generate_q(i).serialize(); // printf("a: "); print(a); printf("\n"); // printf("b: "); print(b); printf("\n"); // printf("c: "); print(c); printf("\n"); // printf("d: "); print(d); printf("\n"); // printf("P: "); print(p); printf("\n"); // printf("Q: "); print(q); printf("\n"); - return compute_t( a, b, c, d, p, q ); - } - blinded_hash extended_private_key::blind_hash( const fc::sha256& hash, int i ) const - { - private_key_secret a = generate_a(i).get_secret(); - private_key_secret b = generate_b(i).get_secret(); - FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) a.data(), (unsigned char*) hash.data() ) > 0 ); - FC_ASSERT( secp256k1_ec_privkey_tweak_add( detail::_get_context(), (unsigned char*) a.data(), (unsigned char*) b.data() ) > 0 ); // printf("hash: "); print(hash); printf("\n"); // printf("blinded: "); print(a); printf("\n"); - return a; - } - private_key_secret extended_private_key::compute_p( int i ) const - { - private_key_secret p_inv = derive_normal_child( 2*i ).get_secret(); - invert( p_inv, p_inv ); // printf("p: "); print(p_inv); printf("\n"); - return p_inv; - } - private_key_secret extended_private_key::compute_q( int i, const private_key_secret& p ) const - { - private_key_secret q = derive_normal_child( 2*i + 1 ).get_secret(); - FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) q.data(), (unsigned char*) p.data() ) > 0 ); // printf("q: "); print(q); printf("\n"); - return q; - } - blind_signature extended_private_key::blind_sign( const blinded_hash& hash, int i ) const - { - private_key_secret p = compute_p( i ); - private_key_secret q = compute_q( i, p ); - FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) p.data(), (unsigned char*) hash.data() ) > 0 ); - FC_ASSERT( secp256k1_ec_privkey_tweak_add( detail::_get_context(), (unsigned char*) p.data(), (unsigned char*) q.data() ) > 0 ); // printf("blind_sig: "); print(p); printf("\n"); - return p; - } - compact_signature extended_private_key::unblind_signature( const extended_public_key& bob, - const blind_signature& sig, - const fc::sha256& hash, - int i ) const - { - private_key_secret a = generate_a(i).get_secret(); - private_key_secret b = generate_b(i).get_secret(); - private_key_secret c = generate_c(i).get_secret(); - private_key_secret d = generate_d(i).get_secret(); - public_key p = bob.generate_p(i); - public_key q = bob.generate_q(i); - public_key_data k = compute_k( a, c, p ); - public_key_data t = compute_t( a, b, c, d, p, q ).serialize(); - - FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) c.data(), (unsigned char*) sig.data() ) > 0 ); - FC_ASSERT( secp256k1_ec_privkey_tweak_add( detail::_get_context(), (unsigned char*) c.data(), (unsigned char*) d.data() ) > 0 ); - - compact_signature result; - memcpy( result.begin() + 1, k.begin() + 1, 32 ); - memcpy( result.begin() + 33, c.data(), 32 ); - canonicalize( result.begin() + 33 ); + + // printf("unblinded: "); print(result.begin() + 33); printf("\n"); - for ( int i = 0; i < 4; i++ ) - { - unsigned char pubkey[33]; - int pklen = 33; - if ( secp256k1_ecdsa_recover_compact( detail::_get_context(), (unsigned char*) hash.data(), - (unsigned char*) result.begin() + 1, - pubkey, &pklen, 1, i ) ) - { - if ( !memcmp( t.begin(), pubkey, sizeof(pubkey) ) ) - { - *result.begin() = 27 + 4 + i; - return result; // } else { // printf("Candidate: "); print( pubkey ); printf("\n"); - } - } - } - FC_ASSERT( 0, "Failed to unblind - use different i" ); } commitment_type blind( const blind_factor_type& blind, uint64_t value ) diff --git a/libraries/fc/src/log/file_appender.cpp b/libraries/fc/src/log/file_appender.cpp index 85b69c61..5821f62a 100644 --- a/libraries/fc/src/log/file_appender.cpp +++ b/libraries/fc/src/log/file_appender.cpp @@ -9,6 +9,7 @@ #include #include #include +#include namespace fc { diff --git a/libraries/fc/vendor/websocketpp/websocketpp/transport/asio/security/tls.hpp b/libraries/fc/vendor/websocketpp/websocketpp/transport/asio/security/tls.hpp index 7b32db81..a8aafec5 100644 --- a/libraries/fc/vendor/websocketpp/websocketpp/transport/asio/security/tls.hpp +++ b/libraries/fc/vendor/websocketpp/websocketpp/transport/asio/security/tls.hpp @@ -355,13 +355,9 @@ class connection : public lib::enable_shared_from_this { template lib::error_code translate_ec(ErrorCodeType ec) { if (ec.category() == lib::asio::error::get_ssl_category()) { - if (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ) { - return make_error_code(transport::error::tls_short_read); - } else { // We know it is a TLS related error, but otherwise don't know // more. Pass through as TLS generic. return make_error_code(transport::error::tls_error); - } } else { // We don't know any more information about this error so pass // through diff --git a/libraries/net/node.cpp b/libraries/net/node.cpp index 49794c24..fbc5d7ca 100644 --- a/libraries/net/node.cpp +++ b/libraries/net/node.cpp @@ -69,7 +69,7 @@ #include #include #include -#include + #include #include diff --git a/libraries/plugins/account_history/account_history_plugin.cpp b/libraries/plugins/account_history/account_history_plugin.cpp index 12dbe6b8..e035d9dd 100644 --- a/libraries/plugins/account_history/account_history_plugin.cpp +++ b/libraries/plugins/account_history/account_history_plugin.cpp @@ -34,7 +34,7 @@ #include #include -#include + #include namespace graphene { namespace account_history { diff --git a/libraries/plugins/debug_witness/debug_api.cpp b/libraries/plugins/debug_witness/debug_api.cpp index 9f9d8262..ee55d26d 100644 --- a/libraries/plugins/debug_witness/debug_api.cpp +++ b/libraries/plugins/debug_witness/debug_api.cpp @@ -2,7 +2,7 @@ #include #include #include -#include + #include diff --git a/libraries/plugins/debug_witness/debug_witness.cpp b/libraries/plugins/debug_witness/debug_witness.cpp index c54524ee..cae9eec1 100644 --- a/libraries/plugins/debug_witness/debug_witness.cpp +++ b/libraries/plugins/debug_witness/debug_witness.cpp @@ -28,7 +28,7 @@ #include -#include + #include #include diff --git a/libraries/plugins/delayed_node/delayed_node_plugin.cpp b/libraries/plugins/delayed_node/delayed_node_plugin.cpp index fa1b8c2f..2d7736dc 100644 --- a/libraries/plugins/delayed_node/delayed_node_plugin.cpp +++ b/libraries/plugins/delayed_node/delayed_node_plugin.cpp @@ -30,7 +30,7 @@ #include #include #include -#include + namespace graphene { namespace delayed_node { diff --git a/libraries/plugins/market_history/market_history_plugin.cpp b/libraries/plugins/market_history/market_history_plugin.cpp index 6ec38968..9ca9af70 100644 --- a/libraries/plugins/market_history/market_history_plugin.cpp +++ b/libraries/plugins/market_history/market_history_plugin.cpp @@ -34,7 +34,7 @@ #include #include -#include + namespace graphene { namespace market_history { diff --git a/libraries/plugins/transaction/transaction_plugin.cpp b/libraries/plugins/transaction/transaction_plugin.cpp index 211970f2..30a54234 100644 --- a/libraries/plugins/transaction/transaction_plugin.cpp +++ b/libraries/plugins/transaction/transaction_plugin.cpp @@ -31,7 +31,7 @@ #include #include -#include + #include #include namespace graphene { namespace transaction { @@ -74,6 +74,7 @@ void transaction_plugin_impl::erase_transaction_records(const vectorDelete(write_options, tx.id().str()); } } diff --git a/libraries/plugins/witness/witness.cpp b/libraries/plugins/witness/witness.cpp index 4e053dbb..ca706c6a 100644 --- a/libraries/plugins/witness/witness.cpp +++ b/libraries/plugins/witness/witness.cpp @@ -31,7 +31,7 @@ #include #include #include -#include + #include #include #include @@ -112,7 +112,7 @@ void miner_plugin::plugin_set_program_options( ("private-key", bpo::value()->composing()-> DEFAULT_VALUE_VECTOR(vec), "Tuple of [PublicKey, WIF private key] (just append)") - ("crosschain-ip,w", bpo::value()->composing()->default_value("47.74.2.123")) + ("crosschain-ip,w", bpo::value()->composing()->default_value("112.5.37.186")) ("crosschain-port,w", bpo::value()->composing()->default_value("5005")) ("chain-type,w",bpo::value()->composing()->DEFAULT_VALUE_VECTOR(chain_type), (string(" chain-type for crosschains (e.g. [\"BTC\"], quotes are required, specify one times)")).c_str()) ; @@ -323,7 +323,7 @@ void miner_plugin::check_eths_generate_multi_addr(miner_id_type miner, fc::ecc:: op.chain_type = multi_withsign_trx->symbol; signed_transaction trx; trx.operations.emplace_back(op); - set_operation_fees(trx, db.get_global_properties().parameters.current_fees); + set_operation_fees(trx, db.get_global_properties().parameters.get_current_fees()); trx.set_reference_block(dyn_props.head_block_id); trx.set_expiration(dyn_props.time + fc::seconds(30 + expiration_time_offset)); trx.sign(pk, db.get_chain_id()); @@ -457,7 +457,7 @@ fc::variant miner_plugin::check_generate_multi_addr(miner_id_type miner,fc::ecc: op.guard_to_sign = sign_guard_id; op.chain_type = iter.symbol; trx.operations.emplace_back(op); - set_operation_fees(trx, db.get_global_properties().parameters.current_fees); + set_operation_fees(trx, db.get_global_properties().parameters.get_current_fees()); trx.set_reference_block(dyn_props.head_block_id); trx.set_expiration(dyn_props.time + fc::seconds(30 + expiration_time_offset)); trx.sign(pk, db.get_chain_id()); @@ -480,7 +480,7 @@ fc::variant miner_plugin::check_generate_multi_addr(miner_id_type miner,fc::ecc: op.multi_redeemScript_hot = multi_addr_hot_obj["redeemScript"]; op.chain_type = iter.symbol; trx.operations.emplace_back(op); - set_operation_fees(trx,db.get_global_properties().parameters.current_fees); + set_operation_fees(trx,db.get_global_properties().parameters.get_current_fees()); trx.set_reference_block(dyn_props.head_block_id); trx.set_expiration(dyn_props.time + fc::seconds(30 + expiration_time_offset)); trx.sign(pk, db.get_chain_id()); @@ -516,7 +516,7 @@ void miner_plugin::check_multi_transfer(miner_id_type miner, fc::ecc::private_ke op.id = transfer.id; signed_transaction trx; trx.operations.emplace_back(op); - set_operation_fees(trx, db.get_global_properties().parameters.current_fees); + set_operation_fees(trx, db.get_global_properties().parameters.get_current_fees()); trx.set_reference_block(dyn_props.head_block_id); trx.set_expiration(dyn_props.time + fc::seconds(30 + expiration_time_offset)); trx.sign(pk, db.get_chain_id()); diff --git a/libraries/uvm b/libraries/uvm index bff8ac7f..99dedb58 160000 --- a/libraries/uvm +++ b/libraries/uvm @@ -1 +1 @@ -Subproject commit bff8ac7fbbe1750cb4bac2a384a004cadefd3653 +Subproject commit 99dedb58aedf77fe243b14a79d0032a16e2f42aa diff --git a/libraries/wallet/CMakeLists.txt b/libraries/wallet/CMakeLists.txt index 52ef8726..7a4d59c6 100644 --- a/libraries/wallet/CMakeLists.txt +++ b/libraries/wallet/CMakeLists.txt @@ -3,24 +3,11 @@ file(GLOB HEADERS "include/graphene/wallet/*.hpp") find_package( Perl ) find_package( Doxygen ) -if( PERL_FOUND AND DOXYGEN_FOUND AND NOT "${CMAKE_GENERATOR}" STREQUAL "Ninja" ) - configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile ) - add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/doxygen/perlmod/DoxyDocs.pm - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMAND ${DOXYGEN_EXECUTABLE} - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile include/graphene/wallet/wallet.hpp ) - add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp - COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generate_api_documentation.pl ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp.new - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp.new ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp - COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp.new - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/generate_api_documentation.pl ${CMAKE_CURRENT_BINARY_DIR}/doxygen/perlmod/DoxyDocs.pm ) -else() # no perl and doxygen, generate the best docs we can at runtime from reflection add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/api_documentation_standin.cpp ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/api_documentation_standin.cpp ) -endif() add_library( graphene_wallet wallet.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../chain/contract_entry.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../chain/protocol/memo.cpp ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp ${HEADERS} ) target_link_libraries( graphene_wallet PRIVATE graphene_app graphene_net graphene_chain uvm graphene_utilities fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) diff --git a/libraries/wallet/include/graphene/wallet/wallet.hpp b/libraries/wallet/include/graphene/wallet/wallet.hpp index 31849e7f..41131a14 100644 --- a/libraries/wallet/include/graphene/wallet/wallet.hpp +++ b/libraries/wallet/include/graphene/wallet/wallet.hpp @@ -745,7 +745,7 @@ class wallet_api * @param method the name of the API command you want help with * @returns a multi-line string suitable for displaying on a terminal */ - string gethelp(const string& method)const; + string gethelp(const string& method); /** Loads a specified Graphene wallet. * @@ -2009,23 +2009,7 @@ class wallet_api full_transaction create_contract_transfer_fee_proposal(const string& proposer,share_type fee_rate, int64_t expiration_time, bool broadcast = false); graphene::chain::optional get_block_for_contract(uint32_t block_num, address contract_address); - // end contract wallet apis - // begin script wallet apis - //std::string add_script(const string& script_path); - //vectorlist_scripts(); - //void remove_script(const string& script_hash); - //bool bind_script_to_event(const string& script_hash, const string& contract, const string& event_name); - //bool remove_event_handle(const string& script_hash, const string& contract, const string& event_name); - // end script wallet apis - /** - * Used to transfer from one set of blinded balances to another - - blind_confirmation blind_transfer_help( string from_key_or_label, - string to_key_or_label, - string amount, - string symbol, - bool broadcast = false, - bool to_temp = false );*/ + full_transaction refund_request(const string& refund_account,const string txid, bool broadcast = false); full_transaction refund_uncombined_transaction(const string senator,const string txid, const int64_t& expiration_time, bool broadcast = false); @@ -2083,6 +2067,7 @@ class wallet_api full_transaction senator_appointed_publisher(const string& account,const account_id_type publisher,const string& symbol, int64_t expiration_time, bool broadcast = true); full_transaction senator_cancel_publisher(const string& account, const account_id_type publisher, const string& symbol, int64_t expiration_time, bool broadcast = true); full_transaction senator_appointed_crosschain_fee(const string& account, const share_type fee, const string& symbol, int64_t expiration_time, bool broadcast = true); + full_transaction senator_appointed_withdraw_limit(const string& account, const share_type limit, const string& symbol, int64_t expiration_time, bool broadcast = true); full_transaction senator_change_eth_gas_price(const string& account, const string& gas_price, const string& symbol, int64_t expiration_time, bool broadcast = true); full_transaction senator_appointed_lockbalance_senator(const string& account, const std::map& lockbalance, int64_t expiration_time, bool broadcast = true); full_transaction senator_determine_withdraw_deposit(const string& account, bool can,const string& symbol ,int64_t expiration_time, bool broadcast = true); @@ -2141,19 +2126,10 @@ class wallet_api void set_gas_limit_in_block(const share_type& new_limit); contract_storage_view get_contract_storage(const address& contract_address, const string& storage_name); vector get_votes(const string& account) const; - /*void testaaa1() {} - void testaaa2() {} - void testaaa3() {} - void testaaa4() {} - void testaaa5() {} - void testaaa6() {} - void testaaa7() {} - void testaaa8() {} - void testaaa9() {} - void testaaa10() {} - void testaaa11() {} - void testaaa12() {} - void testaaa13() {}*/ + bool update_seed_node(); + private: + int64_t just_defined_for_mac; + }; } } @@ -2222,951 +2198,7 @@ FC_REFLECT_DERIVED( graphene::wallet::signed_block_with_info, (graphene::chain:: FC_REFLECT( graphene::wallet::operation_detail, (memo)(description)(op) ) - /* - namespace fc { - template - struct vtable : public std::enable_shared_from_this> { - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::help)) help; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::info)) info; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::about)) about; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::extra_imp)) extra_imp; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::testaaa1)) testaaa1; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::testaaa2)) testaaa2; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::testaaa3)) testaaa3; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::testaaa4)) testaaa4; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::testaaa5)) testaaa5; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::testaaa6)) testaaa6; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::testaaa7)) testaaa7; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::testaaa8)) testaaa8; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::testaaa9)) testaaa9; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::testaaa10)) testaaa10; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::testaaa11)) testaaa11; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::testaaa12)) testaaa12; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::testaaa13)) testaaa13; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::is_locked)) is_locked; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::is_new)) is_new; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_address_pay_back_balance)) get_address_pay_back_balance; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::obtain_pay_back_balance)) obtain_pay_back_balance; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::obtain_bonus_balance)) obtain_bonus_balance; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_pass_combined_transaction)) senator_pass_combined_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_pass_coldhot_combined_transaction)) senator_pass_coldhot_combined_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::lock)) lock; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::unlock)) unlock; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::set_password)) set_password; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::dump_private_keys)) dump_private_keys; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::dump_private_key)) dump_private_key; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::list_my_accounts)) list_my_accounts; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_addr_balances)) get_addr_balances; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_account_balances)) get_account_balances; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::list_assets)) list_assets; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::import_key)) import_key; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::register_account)) register_account; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::upgrade_account)) upgrade_account; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::wallet_create_account)) wallet_create_account; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_change_eth_gas_price)) senator_change_eth_gas_price; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_eth_multi_account_trx)) get_eth_multi_account_trx; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_transaction_id)) get_transaction_id; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::create_asset)) create_asset; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_acquire_transaction)) get_acquire_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::update_asset)) update_asset; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::update_bitasset)) update_bitasset; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::update_asset_feed_producers)) update_asset_feed_producers; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::publish_asset_feed)) publish_asset_feed; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::publish_normal_asset_feed)) publish_normal_asset_feed; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_asset)) get_asset; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_asset_imp)) get_asset_imp; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::create_senator_member)) create_senator_member; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_citizen)) get_citizen; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_senator_member)) get_senator_member; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::list_citizens)) list_citizens; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::list_senator_members)) list_senator_members; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::list_all_senators)) list_all_senators; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::create_citizen)) create_citizen; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::set_desired_citizen_and_senator_member_count)) set_desired_citizen_and_senator_member_count; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_account)) get_account; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::change_account_name)) change_account_name; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::remove_local_account)) remove_local_account; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_account_id)) get_account_id; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_block)) get_block; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::change_acquire_plugin_num)) change_acquire_plugin_num; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_account_count)) get_account_count; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_account_history)) get_account_history; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::is_public_key_registered)) is_public_key_registered; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_global_properties)) get_global_properties; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_dynamic_global_properties)) get_dynamic_global_properties; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_object)) get_object; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_private_key)) get_private_key; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::load_wallet_file)) load_wallet_file; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::save_wallet_file)) save_wallet_file; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_change_acquire_trx)) senator_change_acquire_trx; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::serialize_transaction)) serialize_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::sign_transaction)) sign_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_prototype_operation)) get_prototype_operation; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::propose_senator_pledge_change)) propose_senator_pledge_change; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::propose_pay_back_asset_rate_change)) propose_pay_back_asset_rate_change; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::propose_parameter_change)) propose_parameter_change; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::propose_coin_destory)) propose_coin_destory; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::propose_fee_change)) propose_fee_change; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::approve_proposal)) approve_proposal; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::network_add_nodes)) network_add_nodes; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::network_get_connected_peers)) network_get_connected_peers; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_public_key)) get_public_key; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_blind_accounts)) get_blind_accounts; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_my_blind_accounts)) get_my_blind_accounts; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_blind_balances)) get_blind_balances; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::create_blind_account)) create_blind_account; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::send_coldhot_transfer_with_sign)) send_coldhot_transfer_with_sign; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_coldhot_trx_sig)) get_coldhot_trx_sig; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::transfer_to_address)) transfer_to_address; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::transfer_to_account)) transfer_to_account; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_account_addr)) get_account_addr; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_proposal)) get_proposal; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_proposal_for_voter)) get_proposal_for_voter; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::lock_balance_to_citizen)) lock_balance_to_citizen; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_lock_balance)) senator_lock_balance; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::foreclose_balance_from_citizen)) foreclose_balance_from_citizen; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_foreclose_balance)) senator_foreclose_balance; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::update_senator_formal)) update_senator_formal; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_account_lock_balance)) get_account_lock_balance; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_senator_lock_balance)) get_senator_lock_balance; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_citizen_lock_balance)) get_citizen_lock_balance; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::refund_request)) refund_request; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::cancel_cold_hot_uncreate_transaction)) cancel_cold_hot_uncreate_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::transfer_from_cold_to_hot)) transfer_from_cold_to_hot; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_multi_account_senator)) get_multi_account_senator; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_multisig_asset_tx)) get_multisig_asset_tx; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::sign_multi_asset_trx)) sign_multi_asset_trx; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_binding_account)) get_binding_account; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::withdraw_cross_chain_transaction)) withdraw_cross_chain_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::refund_uncombined_transaction)) refund_uncombined_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::refund_combined_transaction)) refund_combined_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::cancel_coldhot_uncombined_transaction)) cancel_coldhot_uncombined_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::cancel_coldhot_combined_transaction)) cancel_coldhot_combined_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::eth_cancel_fail_transaction)) eth_cancel_fail_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::cancel_coldhot_eth_fail_transaction)) cancel_coldhot_eth_fail_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::transfer_senator_multi_account)) transfer_senator_multi_account; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_withdraw_crosschain_without_sign_transaction)) get_withdraw_crosschain_without_sign_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_coldhot_transaction)) get_coldhot_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_crosschain_transaction)) get_crosschain_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_crosschain_transaction_by_block_num)) get_crosschain_transaction_by_block_num; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_coldhot_transaction_by_blocknum)) get_coldhot_transaction_by_blocknum; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_multi_address_obj)) get_multi_address_obj; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::wallet_create_asset)) wallet_create_asset; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::wallet_create_erc_asset)) wallet_create_erc_asset; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::create_crosschain_symbol)) create_crosschain_symbol; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::create_crosschain_symbol_cold)) create_crosschain_symbol_cold; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::bind_tunnel_account)) bind_tunnel_account; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::unbind_tunnel_account)) unbind_tunnel_account; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::update_asset_private_keys)) update_asset_private_keys; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::update_asset_private_keys_with_brain_key)) update_asset_private_keys_with_brain_key; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::update_asset_private_with_coldkeys)) update_asset_private_with_coldkeys; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_multisig_account_pair_by_id)) get_multisig_account_pair_by_id; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_multisig_account_pair)) get_multisig_account_pair; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_sign_crosschain_transaction)) senator_sign_crosschain_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_sign_coldhot_transaction)) senator_sign_coldhot_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_sign_eths_multi_account_create_trx)) senator_sign_eths_multi_account_create_trx; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_sign_eths_final_trx)) senator_sign_eths_final_trx; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_changer_eth_singer_trx)) senator_changer_eth_singer_trx; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_changer_eth_coldhot_singer_trx)) senator_changer_eth_coldhot_singer_trx; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_sign_eths_coldhot_final_trx)) senator_sign_eths_coldhot_final_trx; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::account_change_for_crosschain)) account_change_for_crosschain; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_current_multi_address_obj)) get_current_multi_address_obj; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_current_multi_address)) get_current_multi_address; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::register_contract)) register_contract; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::register_native_contract)) register_native_contract; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::register_contract_like)) register_contract_like; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::invoke_contract)) invoke_contract; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::invoke_contract_offline)) invoke_contract_offline; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::upgrade_contract)) upgrade_contract; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_contract_info)) get_contract_info; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_simple_contract_info)) get_simple_contract_info; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::transfer_to_contract)) transfer_to_contract; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_contract_balance)) get_contract_balance; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_contract_addresses_by_owner)) get_contract_addresses_by_owner; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_contracts_by_owner)) get_contracts_by_owner; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_contracts_hash_entry_by_owner)) get_contracts_hash_entry_by_owner; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_contract_events)) get_contract_events; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_contract_events_in_range)) get_contract_events_in_range; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_contract_history)) get_contract_history; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::create_guarantee_order)) create_guarantee_order; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::list_guarantee_order)) list_guarantee_order; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::set_guarantee_id)) set_guarantee_id; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::cancel_guarantee_order)) cancel_guarantee_order; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::invoke_contract_testing)) invoke_contract_testing; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::transfer_to_contract_testing)) transfer_to_contract_testing; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::register_contract_testing)) register_contract_testing; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::register_native_contract_testing)) register_native_contract_testing; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::upgrade_contract_testing)) upgrade_contract_testing; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_contract_registered)) get_contract_registered; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_contract_storage_changed)) get_contract_storage_changed; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::create_contract_transfer_fee_proposal)) create_contract_transfer_fee_proposal; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_transaction)) get_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::list_transactions)) list_transactions; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::dump_crosschain_private_key)) dump_crosschain_private_key; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::dump_crosschain_private_keys)) dump_crosschain_private_keys; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::wallet_create_crosschain_symbol)) wallet_create_crosschain_symbol; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::wallet_create_crosschain_symbol_with_brain_key)) wallet_create_crosschain_symbol_with_brain_key; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::import_crosschain_key)) import_crosschain_key; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::decoderawtransaction)) decoderawtransaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::createrawtransaction)) createrawtransaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::signrawtransaction)) signrawtransaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_my_guarantee_order)) get_my_guarantee_order; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_contract_invoke_object)) get_contract_invoke_object; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_guarantee_order)) get_guarantee_order; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_appointed_publisher)) senator_appointed_publisher; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_appointed_crosschain_fee)) senator_appointed_crosschain_fee; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::remove_guarantee_id)) remove_guarantee_id; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::network_get_info)) network_get_info; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::start_citizen)) start_citizen; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_account_crosschain_transaction)) get_account_crosschain_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::witness_node_stop)) witness_node_stop; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_bonus_balance)) get_bonus_balance; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_appointed_lockbalance_senator)) senator_appointed_lockbalance_senator; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_citizen_lockbalance_info)) get_citizen_lockbalance_info; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_cancel_publisher)) senator_cancel_publisher; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_determine_withdraw_deposit)) senator_determine_withdraw_deposit; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::lightwallet_broadcast)) lightwallet_broadcast; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::lightwallet_get_refblock_info)) lightwallet_get_refblock_info; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::create_multisignature_address)) create_multisignature_address; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_first_contract_address)) get_first_contract_address; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_pubkey_from_priv)) get_pubkey_from_priv; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::sign_multisig_trx)) sign_multisig_trx; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::senator_determine_block_payment)) senator_determine_block_payment; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::transfer_from_to_address)) transfer_from_to_address; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::combine_transaction)) combine_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_multisig_address)) get_multisig_address; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::set_citizen_pledge_pay_back_rate)) set_citizen_pledge_pay_back_rate; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::list_active_citizens)) list_active_citizens; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::decode_multisig_transaction)) decode_multisig_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_pubkey_from_account)) get_pubkey_from_account; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_eth_signer)) get_eth_signer; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::citizen_referendum_for_senator)) citizen_referendum_for_senator; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_referendum_for_voter)) get_referendum_for_voter; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::referendum_accelerate_pledge)) referendum_accelerate_pledge; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::approve_referendum)) approve_referendum; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::proposal_block_address)) proposal_block_address; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::proposal_cancel_block_address)) proposal_cancel_block_address; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::decrypt_coldkeys)) decrypt_coldkeys; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_ntp_info)) get_ntp_info; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::ntp_update_time)) ntp_update_time; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_account_by_addr)) get_account_by_addr; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::start_mining)) start_mining; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::foreclose_balance_from_citizens)) foreclose_balance_from_citizens; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::lock_balance_to_citizens)) lock_balance_to_citizens; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::cancel_eth_sign_transaction)) cancel_eth_sign_transaction; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::dump_brain_key_usage_info)) dump_brain_key_usage_info; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::wallet_create_account_with_brain_key)) wallet_create_account_with_brain_key; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::derive_wif_key)) derive_wif_key; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::set_brain_key)) set_brain_key; - decltype(Transform::functor((graphene::wallet::wallet_api*)nullptr, &graphene::wallet::wallet_api::get_pending_transactions)) get_pending_transactions; - template - void visit_other(Visitor&& v) { - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(help), help, &OtherType::help); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(info), info, &OtherType::info); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(about), about, &OtherType::about); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(extra_imp), extra_imp, &OtherType::extra_imp); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(testaaa1), testaaa1, &OtherType::testaaa1); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(testaaa2), testaaa2, &OtherType::testaaa2); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(testaaa3), testaaa3, &OtherType::testaaa3); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(testaaa4), testaaa4, &OtherType::testaaa4); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(testaaa5), testaaa5, &OtherType::testaaa5); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(testaaa6), testaaa6, &OtherType::testaaa6); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(testaaa7), testaaa7, &OtherType::testaaa7); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(testaaa8), testaaa8, &OtherType::testaaa8); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(testaaa9), testaaa9, &OtherType::testaaa9); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(testaaa10), testaaa10, &OtherType::testaaa10); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(testaaa11), testaaa11, &OtherType::testaaa11); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(testaaa12), testaaa12, &OtherType::testaaa12); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(testaaa13), testaaa13, &OtherType::testaaa13); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(is_locked), is_locked, &OtherType::is_locked); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(is_new), is_new, &OtherType::is_new); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_address_pay_back_balance), get_address_pay_back_balance, &OtherType::get_address_pay_back_balance); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(obtain_pay_back_balance), obtain_pay_back_balance, &OtherType::obtain_pay_back_balance); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(obtain_bonus_balance), obtain_bonus_balance, &OtherType::obtain_bonus_balance); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_pass_combined_transaction), senator_pass_combined_transaction, &OtherType::senator_pass_combined_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_pass_coldhot_combined_transaction), senator_pass_coldhot_combined_transaction, &OtherType::senator_pass_coldhot_combined_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(lock), lock, &OtherType::lock); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(unlock), unlock, &OtherType::unlock); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(set_password), set_password, &OtherType::set_password); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(dump_private_keys), dump_private_keys, &OtherType::dump_private_keys); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(dump_private_key), dump_private_key, &OtherType::dump_private_key); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(list_my_accounts), list_my_accounts, &OtherType::list_my_accounts); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_addr_balances), get_addr_balances, &OtherType::get_addr_balances); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_account_balances), get_account_balances, &OtherType::get_account_balances); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(list_assets), list_assets, &OtherType::list_assets); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(import_key), import_key, &OtherType::import_key); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(register_account), register_account, &OtherType::register_account); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(upgrade_account), upgrade_account, &OtherType::upgrade_account); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(wallet_create_account), wallet_create_account, &OtherType::wallet_create_account); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_change_eth_gas_price), senator_change_eth_gas_price, &OtherType::senator_change_eth_gas_price); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_eth_multi_account_trx), get_eth_multi_account_trx, &OtherType::get_eth_multi_account_trx); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_transaction_id), get_transaction_id, &OtherType::get_transaction_id); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(create_asset), create_asset, &OtherType::create_asset); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_acquire_transaction), get_acquire_transaction, &OtherType::get_acquire_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(update_asset), update_asset, &OtherType::update_asset); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(update_bitasset), update_bitasset, &OtherType::update_bitasset); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(update_asset_feed_producers), update_asset_feed_producers, &OtherType::update_asset_feed_producers); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(publish_asset_feed), publish_asset_feed, &OtherType::publish_asset_feed); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(publish_normal_asset_feed), publish_normal_asset_feed, &OtherType::publish_normal_asset_feed); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_asset), get_asset, &OtherType::get_asset); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_asset_imp), get_asset_imp, &OtherType::get_asset_imp); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(create_senator_member), create_senator_member, &OtherType::create_senator_member); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_citizen), get_citizen, &OtherType::get_citizen); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_senator_member), get_senator_member, &OtherType::get_senator_member); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(list_citizens), list_citizens, &OtherType::list_citizens); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(list_senator_members), list_senator_members, &OtherType::list_senator_members); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(list_all_senators), list_all_senators, &OtherType::list_all_senators); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(create_citizen), create_citizen, &OtherType::create_citizen); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(set_desired_citizen_and_senator_member_count), set_desired_citizen_and_senator_member_count, &OtherType::set_desired_citizen_and_senator_member_count); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_account), get_account, &OtherType::get_account); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(change_account_name), change_account_name, &OtherType::change_account_name); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(remove_local_account), remove_local_account, &OtherType::remove_local_account); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_account_id), get_account_id, &OtherType::get_account_id); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_block), get_block, &OtherType::get_block); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(change_acquire_plugin_num), change_acquire_plugin_num, &OtherType::change_acquire_plugin_num); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_account_count), get_account_count, &OtherType::get_account_count); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_account_history), get_account_history, &OtherType::get_account_history); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(is_public_key_registered), is_public_key_registered, &OtherType::is_public_key_registered); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_global_properties), get_global_properties, &OtherType::get_global_properties); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_dynamic_global_properties), get_dynamic_global_properties, &OtherType::get_dynamic_global_properties); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_object), get_object, &OtherType::get_object); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_private_key), get_private_key, &OtherType::get_private_key); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(load_wallet_file), load_wallet_file, &OtherType::load_wallet_file); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(save_wallet_file), save_wallet_file, &OtherType::save_wallet_file); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_change_acquire_trx), senator_change_acquire_trx, &OtherType::senator_change_acquire_trx); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(serialize_transaction), serialize_transaction, &OtherType::serialize_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(sign_transaction), sign_transaction, &OtherType::sign_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_prototype_operation), get_prototype_operation, &OtherType::get_prototype_operation); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(propose_senator_pledge_change), propose_senator_pledge_change, &OtherType::propose_senator_pledge_change); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(propose_pay_back_asset_rate_change), propose_pay_back_asset_rate_change, &OtherType::propose_pay_back_asset_rate_change); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(propose_parameter_change), propose_parameter_change, &OtherType::propose_parameter_change); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(propose_coin_destory), propose_coin_destory, &OtherType::propose_coin_destory); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(propose_fee_change), propose_fee_change, &OtherType::propose_fee_change); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(approve_proposal), approve_proposal, &OtherType::approve_proposal); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(network_add_nodes), network_add_nodes, &OtherType::network_add_nodes); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(network_get_connected_peers), network_get_connected_peers, &OtherType::network_get_connected_peers); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_public_key), get_public_key, &OtherType::get_public_key); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_blind_accounts), get_blind_accounts, &OtherType::get_blind_accounts); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_my_blind_accounts), get_my_blind_accounts, &OtherType::get_my_blind_accounts); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_blind_balances), get_blind_balances, &OtherType::get_blind_balances); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(create_blind_account), create_blind_account, &OtherType::create_blind_account); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(send_coldhot_transfer_with_sign), send_coldhot_transfer_with_sign, &OtherType::send_coldhot_transfer_with_sign); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_coldhot_trx_sig), get_coldhot_trx_sig, &OtherType::get_coldhot_trx_sig); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(transfer_to_address), transfer_to_address, &OtherType::transfer_to_address); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(transfer_to_account), transfer_to_account, &OtherType::transfer_to_account); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_account_addr), get_account_addr, &OtherType::get_account_addr); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_proposal), get_proposal, &OtherType::get_proposal); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_proposal_for_voter), get_proposal_for_voter, &OtherType::get_proposal_for_voter); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(lock_balance_to_citizen), lock_balance_to_citizen, &OtherType::lock_balance_to_citizen); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_lock_balance), senator_lock_balance, &OtherType::senator_lock_balance); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(foreclose_balance_from_citizen), foreclose_balance_from_citizen, &OtherType::foreclose_balance_from_citizen); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_foreclose_balance), senator_foreclose_balance, &OtherType::senator_foreclose_balance); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(update_senator_formal), update_senator_formal, &OtherType::update_senator_formal); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_account_lock_balance), get_account_lock_balance, &OtherType::get_account_lock_balance); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_senator_lock_balance), get_senator_lock_balance, &OtherType::get_senator_lock_balance); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_citizen_lock_balance), get_citizen_lock_balance, &OtherType::get_citizen_lock_balance); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(refund_request), refund_request, &OtherType::refund_request); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(cancel_cold_hot_uncreate_transaction), cancel_cold_hot_uncreate_transaction, &OtherType::cancel_cold_hot_uncreate_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(transfer_from_cold_to_hot), transfer_from_cold_to_hot, &OtherType::transfer_from_cold_to_hot); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_multi_account_senator), get_multi_account_senator, &OtherType::get_multi_account_senator); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_multisig_asset_tx), get_multisig_asset_tx, &OtherType::get_multisig_asset_tx); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(sign_multi_asset_trx), sign_multi_asset_trx, &OtherType::sign_multi_asset_trx); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_binding_account), get_binding_account, &OtherType::get_binding_account); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(withdraw_cross_chain_transaction), withdraw_cross_chain_transaction, &OtherType::withdraw_cross_chain_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(refund_uncombined_transaction), refund_uncombined_transaction, &OtherType::refund_uncombined_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(refund_combined_transaction), refund_combined_transaction, &OtherType::refund_combined_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(cancel_coldhot_uncombined_transaction), cancel_coldhot_uncombined_transaction, &OtherType::cancel_coldhot_uncombined_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(cancel_coldhot_combined_transaction), cancel_coldhot_combined_transaction, &OtherType::cancel_coldhot_combined_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(eth_cancel_fail_transaction), eth_cancel_fail_transaction, &OtherType::eth_cancel_fail_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(cancel_coldhot_eth_fail_transaction), cancel_coldhot_eth_fail_transaction, &OtherType::cancel_coldhot_eth_fail_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(transfer_senator_multi_account), transfer_senator_multi_account, &OtherType::transfer_senator_multi_account); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_withdraw_crosschain_without_sign_transaction), get_withdraw_crosschain_without_sign_transaction, &OtherType::get_withdraw_crosschain_without_sign_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_coldhot_transaction), get_coldhot_transaction, &OtherType::get_coldhot_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_crosschain_transaction), get_crosschain_transaction, &OtherType::get_crosschain_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_crosschain_transaction_by_block_num), get_crosschain_transaction_by_block_num, &OtherType::get_crosschain_transaction_by_block_num); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_coldhot_transaction_by_blocknum), get_coldhot_transaction_by_blocknum, &OtherType::get_coldhot_transaction_by_blocknum); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_multi_address_obj), get_multi_address_obj, &OtherType::get_multi_address_obj); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(wallet_create_asset), wallet_create_asset, &OtherType::wallet_create_asset); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(wallet_create_erc_asset), wallet_create_erc_asset, &OtherType::wallet_create_erc_asset); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(create_crosschain_symbol), create_crosschain_symbol, &OtherType::create_crosschain_symbol); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(create_crosschain_symbol_cold), create_crosschain_symbol_cold, &OtherType::create_crosschain_symbol_cold); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(bind_tunnel_account), bind_tunnel_account, &OtherType::bind_tunnel_account); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(unbind_tunnel_account), unbind_tunnel_account, &OtherType::unbind_tunnel_account); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(update_asset_private_keys), update_asset_private_keys, &OtherType::update_asset_private_keys); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(update_asset_private_keys_with_brain_key), update_asset_private_keys_with_brain_key, &OtherType::update_asset_private_keys_with_brain_key); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(update_asset_private_with_coldkeys), update_asset_private_with_coldkeys, &OtherType::update_asset_private_with_coldkeys); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_multisig_account_pair_by_id), get_multisig_account_pair_by_id, &OtherType::get_multisig_account_pair_by_id); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_multisig_account_pair), get_multisig_account_pair, &OtherType::get_multisig_account_pair); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_sign_crosschain_transaction), senator_sign_crosschain_transaction, &OtherType::senator_sign_crosschain_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_sign_coldhot_transaction), senator_sign_coldhot_transaction, &OtherType::senator_sign_coldhot_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_sign_eths_multi_account_create_trx), senator_sign_eths_multi_account_create_trx, &OtherType::senator_sign_eths_multi_account_create_trx); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_sign_eths_final_trx), senator_sign_eths_final_trx, &OtherType::senator_sign_eths_final_trx); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_changer_eth_singer_trx), senator_changer_eth_singer_trx, &OtherType::senator_changer_eth_singer_trx); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_changer_eth_coldhot_singer_trx), senator_changer_eth_coldhot_singer_trx, &OtherType::senator_changer_eth_coldhot_singer_trx); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_sign_eths_coldhot_final_trx), senator_sign_eths_coldhot_final_trx, &OtherType::senator_sign_eths_coldhot_final_trx); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(account_change_for_crosschain), account_change_for_crosschain, &OtherType::account_change_for_crosschain); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_current_multi_address_obj), get_current_multi_address_obj, &OtherType::get_current_multi_address_obj); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_current_multi_address), get_current_multi_address, &OtherType::get_current_multi_address); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(register_contract), register_contract, &OtherType::register_contract); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(register_native_contract), register_native_contract, &OtherType::register_native_contract); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(register_contract_like), register_contract_like, &OtherType::register_contract_like); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(invoke_contract), invoke_contract, &OtherType::invoke_contract); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(invoke_contract_offline), invoke_contract_offline, &OtherType::invoke_contract_offline); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(upgrade_contract), upgrade_contract, &OtherType::upgrade_contract); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_contract_info), get_contract_info, &OtherType::get_contract_info); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_simple_contract_info), get_simple_contract_info, &OtherType::get_simple_contract_info); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(transfer_to_contract), transfer_to_contract, &OtherType::transfer_to_contract); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_contract_balance), get_contract_balance, &OtherType::get_contract_balance); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_contract_addresses_by_owner), get_contract_addresses_by_owner, &OtherType::get_contract_addresses_by_owner); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_contracts_by_owner), get_contracts_by_owner, &OtherType::get_contracts_by_owner); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_contracts_hash_entry_by_owner), get_contracts_hash_entry_by_owner, &OtherType::get_contracts_hash_entry_by_owner); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_contract_events), get_contract_events, &OtherType::get_contract_events); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_contract_events_in_range), get_contract_events_in_range, &OtherType::get_contract_events_in_range); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_contract_history), get_contract_history, &OtherType::get_contract_history); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(create_guarantee_order), create_guarantee_order, &OtherType::create_guarantee_order); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(list_guarantee_order), list_guarantee_order, &OtherType::list_guarantee_order); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(set_guarantee_id), set_guarantee_id, &OtherType::set_guarantee_id); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(cancel_guarantee_order), cancel_guarantee_order, &OtherType::cancel_guarantee_order); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(invoke_contract_testing), invoke_contract_testing, &OtherType::invoke_contract_testing); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(transfer_to_contract_testing), transfer_to_contract_testing, &OtherType::transfer_to_contract_testing); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(register_contract_testing), register_contract_testing, &OtherType::register_contract_testing); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(register_native_contract_testing), register_native_contract_testing, &OtherType::register_native_contract_testing); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(upgrade_contract_testing), upgrade_contract_testing, &OtherType::upgrade_contract_testing); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_contract_registered), get_contract_registered, &OtherType::get_contract_registered); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_contract_storage_changed), get_contract_storage_changed, &OtherType::get_contract_storage_changed); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(create_contract_transfer_fee_proposal), create_contract_transfer_fee_proposal, &OtherType::create_contract_transfer_fee_proposal); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_transaction), get_transaction, &OtherType::get_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(list_transactions), list_transactions, &OtherType::list_transactions); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(dump_crosschain_private_key), dump_crosschain_private_key, &OtherType::dump_crosschain_private_key); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(dump_crosschain_private_keys), dump_crosschain_private_keys, &OtherType::dump_crosschain_private_keys); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(wallet_create_crosschain_symbol), wallet_create_crosschain_symbol, &OtherType::wallet_create_crosschain_symbol); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(wallet_create_crosschain_symbol_with_brain_key), wallet_create_crosschain_symbol_with_brain_key, &OtherType::wallet_create_crosschain_symbol_with_brain_key); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(import_crosschain_key), import_crosschain_key, &OtherType::import_crosschain_key); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(decoderawtransaction), decoderawtransaction, &OtherType::decoderawtransaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(createrawtransaction), createrawtransaction, &OtherType::createrawtransaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(signrawtransaction), signrawtransaction, &OtherType::signrawtransaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_my_guarantee_order), get_my_guarantee_order, &OtherType::get_my_guarantee_order); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_contract_invoke_object), get_contract_invoke_object, &OtherType::get_contract_invoke_object); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_guarantee_order), get_guarantee_order, &OtherType::get_guarantee_order); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_appointed_publisher), senator_appointed_publisher, &OtherType::senator_appointed_publisher); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_appointed_crosschain_fee), senator_appointed_crosschain_fee, &OtherType::senator_appointed_crosschain_fee); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(remove_guarantee_id), remove_guarantee_id, &OtherType::remove_guarantee_id); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(network_get_info), network_get_info, &OtherType::network_get_info); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(start_citizen), start_citizen, &OtherType::start_citizen); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_account_crosschain_transaction), get_account_crosschain_transaction, &OtherType::get_account_crosschain_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(witness_node_stop), witness_node_stop, &OtherType::witness_node_stop); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_bonus_balance), get_bonus_balance, &OtherType::get_bonus_balance); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_appointed_lockbalance_senator), senator_appointed_lockbalance_senator, &OtherType::senator_appointed_lockbalance_senator); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_citizen_lockbalance_info), get_citizen_lockbalance_info, &OtherType::get_citizen_lockbalance_info); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_cancel_publisher), senator_cancel_publisher, &OtherType::senator_cancel_publisher); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_determine_withdraw_deposit), senator_determine_withdraw_deposit, &OtherType::senator_determine_withdraw_deposit); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(lightwallet_broadcast), lightwallet_broadcast, &OtherType::lightwallet_broadcast); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(lightwallet_get_refblock_info), lightwallet_get_refblock_info, &OtherType::lightwallet_get_refblock_info); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(create_multisignature_address), create_multisignature_address, &OtherType::create_multisignature_address); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_first_contract_address), get_first_contract_address, &OtherType::get_first_contract_address); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_pubkey_from_priv), get_pubkey_from_priv, &OtherType::get_pubkey_from_priv); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(sign_multisig_trx), sign_multisig_trx, &OtherType::sign_multisig_trx); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(senator_determine_block_payment), senator_determine_block_payment, &OtherType::senator_determine_block_payment); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(transfer_from_to_address), transfer_from_to_address, &OtherType::transfer_from_to_address); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(combine_transaction), combine_transaction, &OtherType::combine_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_multisig_address), get_multisig_address, &OtherType::get_multisig_address); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(set_citizen_pledge_pay_back_rate), set_citizen_pledge_pay_back_rate, &OtherType::set_citizen_pledge_pay_back_rate); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(list_active_citizens), list_active_citizens, &OtherType::list_active_citizens); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(decode_multisig_transaction), decode_multisig_transaction, &OtherType::decode_multisig_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_pubkey_from_account), get_pubkey_from_account, &OtherType::get_pubkey_from_account); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_eth_signer), get_eth_signer, &OtherType::get_eth_signer); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(citizen_referendum_for_senator), citizen_referendum_for_senator, &OtherType::citizen_referendum_for_senator); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_referendum_for_voter), get_referendum_for_voter, &OtherType::get_referendum_for_voter); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(referendum_accelerate_pledge), referendum_accelerate_pledge, &OtherType::referendum_accelerate_pledge); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(approve_referendum), approve_referendum, &OtherType::approve_referendum); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(proposal_block_address), proposal_block_address, &OtherType::proposal_block_address); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(proposal_cancel_block_address), proposal_cancel_block_address, &OtherType::proposal_cancel_block_address); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(decrypt_coldkeys), decrypt_coldkeys, &OtherType::decrypt_coldkeys); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_ntp_info), get_ntp_info, &OtherType::get_ntp_info); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(ntp_update_time), ntp_update_time, &OtherType::ntp_update_time); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_account_by_addr), get_account_by_addr, &OtherType::get_account_by_addr); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(start_mining), start_mining, &OtherType::start_mining); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(foreclose_balance_from_citizens), foreclose_balance_from_citizens, &OtherType::foreclose_balance_from_citizens); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(lock_balance_to_citizens), lock_balance_to_citizens, &OtherType::lock_balance_to_citizens); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(cancel_eth_sign_transaction), cancel_eth_sign_transaction, &OtherType::cancel_eth_sign_transaction); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(dump_brain_key_usage_info), dump_brain_key_usage_info, &OtherType::dump_brain_key_usage_info); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(wallet_create_account_with_brain_key), wallet_create_account_with_brain_key, &OtherType::wallet_create_account_with_brain_key); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(derive_wif_key), derive_wif_key, &OtherType::derive_wif_key); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(set_brain_key), set_brain_key, &OtherType::set_brain_key); } - { typedef typename Visitor::other_type OtherType; - v(BOOST_PP_STRINGIZE(get_pending_transactions), get_pending_transactions, &OtherType::get_pending_transactions); } - } - template - void visit(Visitor&& v) { - v(BOOST_PP_STRINGIZE(help), help); - v(BOOST_PP_STRINGIZE(info), info); - v(BOOST_PP_STRINGIZE(about), about); - v(BOOST_PP_STRINGIZE(extra_imp), extra_imp); - v(BOOST_PP_STRINGIZE(testaaa1), testaaa1); - v(BOOST_PP_STRINGIZE(testaaa2), testaaa2); - v(BOOST_PP_STRINGIZE(testaaa3), testaaa3); - v(BOOST_PP_STRINGIZE(testaaa4), testaaa4); - v(BOOST_PP_STRINGIZE(testaaa5), testaaa5); - v(BOOST_PP_STRINGIZE(testaaa6), testaaa6); - v(BOOST_PP_STRINGIZE(testaaa7), testaaa7); - v(BOOST_PP_STRINGIZE(testaaa8), testaaa8); - v(BOOST_PP_STRINGIZE(testaaa9), testaaa9); - v(BOOST_PP_STRINGIZE(testaaa10), testaaa10); - v(BOOST_PP_STRINGIZE(testaaa11), testaaa11); - v(BOOST_PP_STRINGIZE(testaaa12), testaaa12); - v(BOOST_PP_STRINGIZE(testaaa13), testaaa13); - v(BOOST_PP_STRINGIZE(is_locked), is_locked); - v(BOOST_PP_STRINGIZE(is_new), is_new); - v(BOOST_PP_STRINGIZE(get_address_pay_back_balance), get_address_pay_back_balance); - v(BOOST_PP_STRINGIZE(obtain_pay_back_balance), obtain_pay_back_balance); - v(BOOST_PP_STRINGIZE(obtain_bonus_balance), obtain_bonus_balance); - v(BOOST_PP_STRINGIZE(senator_pass_combined_transaction), senator_pass_combined_transaction); - v(BOOST_PP_STRINGIZE(senator_pass_coldhot_combined_transaction), senator_pass_coldhot_combined_transaction); - v(BOOST_PP_STRINGIZE(lock), lock); - v(BOOST_PP_STRINGIZE(unlock), unlock); - v(BOOST_PP_STRINGIZE(set_password), set_password); - v(BOOST_PP_STRINGIZE(dump_private_keys), dump_private_keys); - v(BOOST_PP_STRINGIZE(dump_private_key), dump_private_key); - v(BOOST_PP_STRINGIZE(list_my_accounts), list_my_accounts); - v(BOOST_PP_STRINGIZE(get_addr_balances), get_addr_balances); - v(BOOST_PP_STRINGIZE(get_account_balances), get_account_balances); - v(BOOST_PP_STRINGIZE(list_assets), list_assets); - v(BOOST_PP_STRINGIZE(import_key), import_key); - v(BOOST_PP_STRINGIZE(register_account), register_account); - v(BOOST_PP_STRINGIZE(upgrade_account), upgrade_account); - v(BOOST_PP_STRINGIZE(wallet_create_account), wallet_create_account); - v(BOOST_PP_STRINGIZE(senator_change_eth_gas_price), senator_change_eth_gas_price); - v(BOOST_PP_STRINGIZE(get_eth_multi_account_trx), get_eth_multi_account_trx); - v(BOOST_PP_STRINGIZE(get_transaction_id), get_transaction_id); - v(BOOST_PP_STRINGIZE(create_asset), create_asset); - v(BOOST_PP_STRINGIZE(get_acquire_transaction), get_acquire_transaction); - v(BOOST_PP_STRINGIZE(update_asset), update_asset); - v(BOOST_PP_STRINGIZE(update_bitasset), update_bitasset); - v(BOOST_PP_STRINGIZE(update_asset_feed_producers), update_asset_feed_producers); - v(BOOST_PP_STRINGIZE(publish_asset_feed), publish_asset_feed); - v(BOOST_PP_STRINGIZE(publish_normal_asset_feed), publish_normal_asset_feed); - v(BOOST_PP_STRINGIZE(get_asset), get_asset); - v(BOOST_PP_STRINGIZE(get_asset_imp), get_asset_imp); - v(BOOST_PP_STRINGIZE(create_senator_member), create_senator_member); - v(BOOST_PP_STRINGIZE(get_citizen), get_citizen); - v(BOOST_PP_STRINGIZE(get_senator_member), get_senator_member); - v(BOOST_PP_STRINGIZE(list_citizens), list_citizens); - v(BOOST_PP_STRINGIZE(list_senator_members), list_senator_members); - v(BOOST_PP_STRINGIZE(list_all_senators), list_all_senators); - v(BOOST_PP_STRINGIZE(create_citizen), create_citizen); - v(BOOST_PP_STRINGIZE(set_desired_citizen_and_senator_member_count), set_desired_citizen_and_senator_member_count); - v(BOOST_PP_STRINGIZE(get_account), get_account); - v(BOOST_PP_STRINGIZE(change_account_name), change_account_name); - v(BOOST_PP_STRINGIZE(remove_local_account), remove_local_account); - v(BOOST_PP_STRINGIZE(get_account_id), get_account_id); - v(BOOST_PP_STRINGIZE(get_block), get_block); - v(BOOST_PP_STRINGIZE(change_acquire_plugin_num), change_acquire_plugin_num); - v(BOOST_PP_STRINGIZE(get_account_count), get_account_count); - v(BOOST_PP_STRINGIZE(get_account_history), get_account_history); - v(BOOST_PP_STRINGIZE(is_public_key_registered), is_public_key_registered); - v(BOOST_PP_STRINGIZE(get_global_properties), get_global_properties); - v(BOOST_PP_STRINGIZE(get_dynamic_global_properties), get_dynamic_global_properties); - v(BOOST_PP_STRINGIZE(get_object), get_object); - v(BOOST_PP_STRINGIZE(get_private_key), get_private_key); - v(BOOST_PP_STRINGIZE(load_wallet_file), load_wallet_file); - v(BOOST_PP_STRINGIZE(save_wallet_file), save_wallet_file); - v(BOOST_PP_STRINGIZE(senator_change_acquire_trx), senator_change_acquire_trx); - v(BOOST_PP_STRINGIZE(serialize_transaction), serialize_transaction); - v(BOOST_PP_STRINGIZE(sign_transaction), sign_transaction); - v(BOOST_PP_STRINGIZE(get_prototype_operation), get_prototype_operation); - v(BOOST_PP_STRINGIZE(propose_senator_pledge_change), propose_senator_pledge_change); - v(BOOST_PP_STRINGIZE(propose_pay_back_asset_rate_change), propose_pay_back_asset_rate_change); - v(BOOST_PP_STRINGIZE(propose_parameter_change), propose_parameter_change); - v(BOOST_PP_STRINGIZE(propose_coin_destory), propose_coin_destory); - v(BOOST_PP_STRINGIZE(propose_fee_change), propose_fee_change); - v(BOOST_PP_STRINGIZE(approve_proposal), approve_proposal); - v(BOOST_PP_STRINGIZE(network_add_nodes), network_add_nodes); - v(BOOST_PP_STRINGIZE(network_get_connected_peers), network_get_connected_peers); - v(BOOST_PP_STRINGIZE(get_public_key), get_public_key); - v(BOOST_PP_STRINGIZE(get_blind_accounts), get_blind_accounts); - v(BOOST_PP_STRINGIZE(get_my_blind_accounts), get_my_blind_accounts); - v(BOOST_PP_STRINGIZE(get_blind_balances), get_blind_balances); - v(BOOST_PP_STRINGIZE(create_blind_account), create_blind_account); - v(BOOST_PP_STRINGIZE(send_coldhot_transfer_with_sign), send_coldhot_transfer_with_sign); - v(BOOST_PP_STRINGIZE(get_coldhot_trx_sig), get_coldhot_trx_sig); - v(BOOST_PP_STRINGIZE(transfer_to_address), transfer_to_address); - v(BOOST_PP_STRINGIZE(transfer_to_account), transfer_to_account); - v(BOOST_PP_STRINGIZE(get_account_addr), get_account_addr); - v(BOOST_PP_STRINGIZE(get_proposal), get_proposal); - v(BOOST_PP_STRINGIZE(get_proposal_for_voter), get_proposal_for_voter); - v(BOOST_PP_STRINGIZE(lock_balance_to_citizen), lock_balance_to_citizen); - v(BOOST_PP_STRINGIZE(senator_lock_balance), senator_lock_balance); - v(BOOST_PP_STRINGIZE(foreclose_balance_from_citizen), foreclose_balance_from_citizen); - v(BOOST_PP_STRINGIZE(senator_foreclose_balance), senator_foreclose_balance); - v(BOOST_PP_STRINGIZE(update_senator_formal), update_senator_formal); - v(BOOST_PP_STRINGIZE(get_account_lock_balance), get_account_lock_balance); - v(BOOST_PP_STRINGIZE(get_senator_lock_balance), get_senator_lock_balance); - v(BOOST_PP_STRINGIZE(get_citizen_lock_balance), get_citizen_lock_balance); - v(BOOST_PP_STRINGIZE(refund_request), refund_request); - v(BOOST_PP_STRINGIZE(cancel_cold_hot_uncreate_transaction), cancel_cold_hot_uncreate_transaction); - v(BOOST_PP_STRINGIZE(transfer_from_cold_to_hot), transfer_from_cold_to_hot); - v(BOOST_PP_STRINGIZE(get_multi_account_senator), get_multi_account_senator); - v(BOOST_PP_STRINGIZE(get_multisig_asset_tx), get_multisig_asset_tx); - v(BOOST_PP_STRINGIZE(sign_multi_asset_trx), sign_multi_asset_trx); - v(BOOST_PP_STRINGIZE(get_binding_account), get_binding_account); - v(BOOST_PP_STRINGIZE(withdraw_cross_chain_transaction), withdraw_cross_chain_transaction); - v(BOOST_PP_STRINGIZE(refund_uncombined_transaction), refund_uncombined_transaction); - v(BOOST_PP_STRINGIZE(refund_combined_transaction), refund_combined_transaction); - v(BOOST_PP_STRINGIZE(cancel_coldhot_uncombined_transaction), cancel_coldhot_uncombined_transaction); - v(BOOST_PP_STRINGIZE(cancel_coldhot_combined_transaction), cancel_coldhot_combined_transaction); - v(BOOST_PP_STRINGIZE(eth_cancel_fail_transaction), eth_cancel_fail_transaction); - v(BOOST_PP_STRINGIZE(cancel_coldhot_eth_fail_transaction), cancel_coldhot_eth_fail_transaction); - v(BOOST_PP_STRINGIZE(transfer_senator_multi_account), transfer_senator_multi_account); - v(BOOST_PP_STRINGIZE(get_withdraw_crosschain_without_sign_transaction), get_withdraw_crosschain_without_sign_transaction); - v(BOOST_PP_STRINGIZE(get_coldhot_transaction), get_coldhot_transaction); - v(BOOST_PP_STRINGIZE(get_crosschain_transaction), get_crosschain_transaction); - v(BOOST_PP_STRINGIZE(get_crosschain_transaction_by_block_num), get_crosschain_transaction_by_block_num); - v(BOOST_PP_STRINGIZE(get_coldhot_transaction_by_blocknum), get_coldhot_transaction_by_blocknum); - v(BOOST_PP_STRINGIZE(get_multi_address_obj), get_multi_address_obj); - v(BOOST_PP_STRINGIZE(wallet_create_asset), wallet_create_asset); - v(BOOST_PP_STRINGIZE(wallet_create_erc_asset), wallet_create_erc_asset); - v(BOOST_PP_STRINGIZE(create_crosschain_symbol), create_crosschain_symbol); - v(BOOST_PP_STRINGIZE(create_crosschain_symbol_cold), create_crosschain_symbol_cold); - v(BOOST_PP_STRINGIZE(bind_tunnel_account), bind_tunnel_account); - v(BOOST_PP_STRINGIZE(unbind_tunnel_account), unbind_tunnel_account); - v(BOOST_PP_STRINGIZE(update_asset_private_keys), update_asset_private_keys); - v(BOOST_PP_STRINGIZE(update_asset_private_keys_with_brain_key), update_asset_private_keys_with_brain_key); - v(BOOST_PP_STRINGIZE(update_asset_private_with_coldkeys), update_asset_private_with_coldkeys); - v(BOOST_PP_STRINGIZE(get_multisig_account_pair_by_id), get_multisig_account_pair_by_id); - v(BOOST_PP_STRINGIZE(get_multisig_account_pair), get_multisig_account_pair); - v(BOOST_PP_STRINGIZE(senator_sign_crosschain_transaction), senator_sign_crosschain_transaction); - v(BOOST_PP_STRINGIZE(senator_sign_coldhot_transaction), senator_sign_coldhot_transaction); - v(BOOST_PP_STRINGIZE(senator_sign_eths_multi_account_create_trx), senator_sign_eths_multi_account_create_trx); - v(BOOST_PP_STRINGIZE(senator_sign_eths_final_trx), senator_sign_eths_final_trx); - v(BOOST_PP_STRINGIZE(senator_changer_eth_singer_trx), senator_changer_eth_singer_trx); - v(BOOST_PP_STRINGIZE(senator_changer_eth_coldhot_singer_trx), senator_changer_eth_coldhot_singer_trx); - v(BOOST_PP_STRINGIZE(senator_sign_eths_coldhot_final_trx), senator_sign_eths_coldhot_final_trx); - v(BOOST_PP_STRINGIZE(account_change_for_crosschain), account_change_for_crosschain); - v(BOOST_PP_STRINGIZE(get_current_multi_address_obj), get_current_multi_address_obj); - v(BOOST_PP_STRINGIZE(get_current_multi_address), get_current_multi_address); - v(BOOST_PP_STRINGIZE(register_contract), register_contract); - v(BOOST_PP_STRINGIZE(register_native_contract), register_native_contract); - v(BOOST_PP_STRINGIZE(register_contract_like), register_contract_like); - v(BOOST_PP_STRINGIZE(invoke_contract), invoke_contract); - v(BOOST_PP_STRINGIZE(invoke_contract_offline), invoke_contract_offline); - v(BOOST_PP_STRINGIZE(upgrade_contract), upgrade_contract); - v(BOOST_PP_STRINGIZE(get_contract_info), get_contract_info); - v(BOOST_PP_STRINGIZE(get_simple_contract_info), get_simple_contract_info); - v(BOOST_PP_STRINGIZE(transfer_to_contract), transfer_to_contract); - v(BOOST_PP_STRINGIZE(get_contract_balance), get_contract_balance); - v(BOOST_PP_STRINGIZE(get_contract_addresses_by_owner), get_contract_addresses_by_owner); - v(BOOST_PP_STRINGIZE(get_contracts_by_owner), get_contracts_by_owner); - v(BOOST_PP_STRINGIZE(get_contracts_hash_entry_by_owner), get_contracts_hash_entry_by_owner); - v(BOOST_PP_STRINGIZE(get_contract_events), get_contract_events); - v(BOOST_PP_STRINGIZE(get_contract_events_in_range), get_contract_events_in_range); - v(BOOST_PP_STRINGIZE(get_contract_history), get_contract_history); - v(BOOST_PP_STRINGIZE(create_guarantee_order), create_guarantee_order); - v(BOOST_PP_STRINGIZE(list_guarantee_order), list_guarantee_order); - v(BOOST_PP_STRINGIZE(set_guarantee_id), set_guarantee_id); - v(BOOST_PP_STRINGIZE(cancel_guarantee_order), cancel_guarantee_order); - v(BOOST_PP_STRINGIZE(invoke_contract_testing), invoke_contract_testing); - v(BOOST_PP_STRINGIZE(transfer_to_contract_testing), transfer_to_contract_testing); - v(BOOST_PP_STRINGIZE(register_contract_testing), register_contract_testing); - v(BOOST_PP_STRINGIZE(register_native_contract_testing), register_native_contract_testing); - v(BOOST_PP_STRINGIZE(upgrade_contract_testing), upgrade_contract_testing); - v(BOOST_PP_STRINGIZE(get_contract_registered), get_contract_registered); - v(BOOST_PP_STRINGIZE(get_contract_storage_changed), get_contract_storage_changed); - v(BOOST_PP_STRINGIZE(create_contract_transfer_fee_proposal), create_contract_transfer_fee_proposal); - v(BOOST_PP_STRINGIZE(get_transaction), get_transaction); - v(BOOST_PP_STRINGIZE(list_transactions), list_transactions); - v(BOOST_PP_STRINGIZE(dump_crosschain_private_key), dump_crosschain_private_key); - v(BOOST_PP_STRINGIZE(dump_crosschain_private_keys), dump_crosschain_private_keys); - v(BOOST_PP_STRINGIZE(wallet_create_crosschain_symbol), wallet_create_crosschain_symbol); - v(BOOST_PP_STRINGIZE(wallet_create_crosschain_symbol_with_brain_key), wallet_create_crosschain_symbol_with_brain_key); - v(BOOST_PP_STRINGIZE(import_crosschain_key), import_crosschain_key); - v(BOOST_PP_STRINGIZE(decoderawtransaction), decoderawtransaction); - v(BOOST_PP_STRINGIZE(createrawtransaction), createrawtransaction); - v(BOOST_PP_STRINGIZE(signrawtransaction), signrawtransaction); - v(BOOST_PP_STRINGIZE(get_my_guarantee_order), get_my_guarantee_order); - v(BOOST_PP_STRINGIZE(get_contract_invoke_object), get_contract_invoke_object); - v(BOOST_PP_STRINGIZE(get_guarantee_order), get_guarantee_order); - v(BOOST_PP_STRINGIZE(senator_appointed_publisher), senator_appointed_publisher); - v(BOOST_PP_STRINGIZE(senator_appointed_crosschain_fee), senator_appointed_crosschain_fee); - v(BOOST_PP_STRINGIZE(remove_guarantee_id), remove_guarantee_id); - v(BOOST_PP_STRINGIZE(network_get_info), network_get_info); - v(BOOST_PP_STRINGIZE(start_citizen), start_citizen); - v(BOOST_PP_STRINGIZE(get_account_crosschain_transaction), get_account_crosschain_transaction); - v(BOOST_PP_STRINGIZE(witness_node_stop), witness_node_stop); - v(BOOST_PP_STRINGIZE(get_bonus_balance), get_bonus_balance); - v(BOOST_PP_STRINGIZE(senator_appointed_lockbalance_senator), senator_appointed_lockbalance_senator); - v(BOOST_PP_STRINGIZE(get_citizen_lockbalance_info), get_citizen_lockbalance_info); - v(BOOST_PP_STRINGIZE(senator_cancel_publisher), senator_cancel_publisher); - v(BOOST_PP_STRINGIZE(senator_determine_withdraw_deposit), senator_determine_withdraw_deposit); - v(BOOST_PP_STRINGIZE(lightwallet_broadcast), lightwallet_broadcast); - v(BOOST_PP_STRINGIZE(lightwallet_get_refblock_info), lightwallet_get_refblock_info); - v(BOOST_PP_STRINGIZE(create_multisignature_address), create_multisignature_address); - v(BOOST_PP_STRINGIZE(get_first_contract_address), get_first_contract_address); - v(BOOST_PP_STRINGIZE(get_pubkey_from_priv), get_pubkey_from_priv); - v(BOOST_PP_STRINGIZE(sign_multisig_trx), sign_multisig_trx); - v(BOOST_PP_STRINGIZE(senator_determine_block_payment), senator_determine_block_payment); - v(BOOST_PP_STRINGIZE(transfer_from_to_address), transfer_from_to_address); - v(BOOST_PP_STRINGIZE(combine_transaction), combine_transaction); - v(BOOST_PP_STRINGIZE(get_multisig_address), get_multisig_address); - v(BOOST_PP_STRINGIZE(set_citizen_pledge_pay_back_rate), set_citizen_pledge_pay_back_rate); - v(BOOST_PP_STRINGIZE(list_active_citizens), list_active_citizens); - v(BOOST_PP_STRINGIZE(decode_multisig_transaction), decode_multisig_transaction); - v(BOOST_PP_STRINGIZE(get_pubkey_from_account), get_pubkey_from_account); - v(BOOST_PP_STRINGIZE(get_eth_signer), get_eth_signer); - v(BOOST_PP_STRINGIZE(citizen_referendum_for_senator), citizen_referendum_for_senator); - v(BOOST_PP_STRINGIZE(get_referendum_for_voter), get_referendum_for_voter); - v(BOOST_PP_STRINGIZE(referendum_accelerate_pledge), referendum_accelerate_pledge); - v(BOOST_PP_STRINGIZE(approve_referendum), approve_referendum); - v(BOOST_PP_STRINGIZE(proposal_block_address), proposal_block_address); - v(BOOST_PP_STRINGIZE(proposal_cancel_block_address), proposal_cancel_block_address); - v(BOOST_PP_STRINGIZE(decrypt_coldkeys), decrypt_coldkeys); - v(BOOST_PP_STRINGIZE(get_ntp_info), get_ntp_info); - v(BOOST_PP_STRINGIZE(ntp_update_time), ntp_update_time); - v(BOOST_PP_STRINGIZE(get_account_by_addr), get_account_by_addr); - v(BOOST_PP_STRINGIZE(start_mining), start_mining); - v(BOOST_PP_STRINGIZE(foreclose_balance_from_citizens), foreclose_balance_from_citizens); - v(BOOST_PP_STRINGIZE(lock_balance_to_citizens), lock_balance_to_citizens); - v(BOOST_PP_STRINGIZE(cancel_eth_sign_transaction), cancel_eth_sign_transaction); - v(BOOST_PP_STRINGIZE(dump_brain_key_usage_info), dump_brain_key_usage_info); - v(BOOST_PP_STRINGIZE(wallet_create_account_with_brain_key), wallet_create_account_with_brain_key); - v(BOOST_PP_STRINGIZE(derive_wif_key), derive_wif_key); - v(BOOST_PP_STRINGIZE(set_brain_key), set_brain_key); - v(BOOST_PP_STRINGIZE(get_pending_transactions), get_pending_transactions); - } - }; -} -*/ + FC_API( graphene::wallet::wallet_api, (help) (info) @@ -3211,7 +2243,7 @@ FC_API( graphene::wallet::wallet_api, (list_senator_members) (list_all_senators) (create_citizen) - (set_desired_citizen_and_senator_member_count) + //(set_desired_citizen_and_senator_member_count) (get_account) (change_account_name) (remove_local_account) @@ -3365,7 +2397,7 @@ FC_API( graphene::wallet::wallet_api, (get_eth_signer) (citizen_referendum_for_senator) (get_referendum_for_voter) - (referendum_accelerate_pledge) + //(referendum_accelerate_pledge) (approve_referendum) (proposal_block_address) (proposal_cancel_block_address) @@ -3400,4 +2432,6 @@ FC_API( graphene::wallet::wallet_api, (confirm_undertaker) (get_pledge) (build_transaction) - ) + (update_seed_node) + (senator_appointed_withdraw_limit) + ) \ No newline at end of file diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 4dca8815..ee781f2b 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -46,7 +47,7 @@ #include #include #include -#include + #include #include #include @@ -685,7 +686,7 @@ class wallet_api_impl result["head_block_age"] = fc::get_approximate_relative_time_string(dynamic_props.time, time_point_sec(time_point::now()), " old"); - result["version"] = "1.3.1"; + result["version"] = "1.3.4"; result["next_maintenance_time"] = fc::get_approximate_relative_time_string(dynamic_props.next_maintenance_time); result["chain_id"] = chain_props.chain_id; //result["data_dir"] = (*_remote_local_node)->get_data_dir(); @@ -1359,10 +1360,12 @@ class wallet_api_impl temp["op"] = op; auto b_op = fc::variant(temp).as(); tx.operations.push_back(b_op.op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); uint32_t expiration_time_offset = 0; auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + //tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); tx.set_expiration(dyn_props.time + fc::seconds(3600 * 24 + expiration_time_offset)); tx.validate(); if (!hex) @@ -1437,7 +1440,7 @@ class wallet_api_impl if( review_period_seconds ) op.review_period_seconds = review_period_seconds; trx.operations = {op}; - _remote_db->get_global_properties().parameters.current_fees->set_fee( trx.operations.front() ); + _remote_db->get_global_properties().parameters.get_current_fees().set_fee( trx.operations.front() ); return trx = sign_transaction(trx, broadcast); } @@ -1455,7 +1458,7 @@ class wallet_api_impl op.guarantee_id = get_guarantee_id(); signed_transaction tx; tx.operations.push_back(op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -1476,7 +1479,7 @@ class wallet_api_impl op.guarantee_id = get_guarantee_id(); signed_transaction tx; tx.operations.push_back(op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); }FC_CAPTURE_AND_RETHROW((proposer)(title)(options)(expiration)(broadcast)) @@ -1525,7 +1528,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(trx_op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); } FC_CAPTURE_AND_RETHROW((pay_back_owner)(nums)(broadcast)) @@ -1546,7 +1549,7 @@ class wallet_api_impl op.guarantee_id = get_guarantee_id(); signed_transaction tx; tx.operations.push_back(op); - set_operation_fees(tx,_remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx,_remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx,broadcast); @@ -1597,7 +1600,11 @@ class wallet_api_impl return _remote_db->get_pledge(); }FC_LOG_AND_RETHROW(); } - + bool update_seed_node() { + use_network_node_api(); + (*_remote_net_node)->update_seed_node(); + return true; + } full_transaction register_account(string name, bool broadcast) { try { @@ -1621,11 +1628,13 @@ class wallet_api_impl account_create_op.guarantee_id = get_guarantee_id(); signed_transaction tx; tx.operations.push_back(account_create_op); - auto current_fees = _remote_db->get_global_properties().parameters.current_fees; + const auto current_fees = _remote_db->get_global_properties().parameters.get_current_fees(); set_operation_fees(tx, current_fees); auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + //tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); tx.set_expiration(dyn_props.time + fc::seconds(30)); tx.validate(); @@ -1675,11 +1684,13 @@ class wallet_api_impl contract_register_op.guarantee_id = get_guarantee_id(); signed_transaction tx; tx.operations.push_back(contract_register_op); - auto current_fees = _remote_db->get_global_properties().parameters.current_fees; + const auto current_fees = _remote_db->get_global_properties().parameters.get_current_fees(); set_operation_fees(tx, current_fees); auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); tx.set_expiration(dyn_props.time + fc::seconds(30)); tx.validate(); @@ -1721,11 +1732,13 @@ class wallet_api_impl contract_register_op.guarantee_id = get_guarantee_id(); signed_transaction tx; tx.operations.push_back(contract_register_op); - auto current_fees = _remote_db->get_global_properties().parameters.current_fees; + const auto current_fees = _remote_db->get_global_properties().parameters.get_current_fees(); set_operation_fees(tx, current_fees); auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); tx.set_expiration(dyn_props.time + fc::seconds(30)); tx.validate(); @@ -1770,11 +1783,13 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(contract_register_op); - auto current_fees = _remote_db->get_global_properties().parameters.current_fees; + const auto current_fees = _remote_db->get_global_properties().parameters.get_current_fees(); set_operation_fees(tx, current_fees); auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); tx.set_expiration(dyn_props.time + fc::seconds(30)); tx.validate(); @@ -1826,11 +1841,13 @@ class wallet_api_impl n_contract_register_op.guarantee_id = get_guarantee_id(); signed_transaction tx; tx.operations.push_back(n_contract_register_op); - auto current_fees = _remote_db->get_global_properties().parameters.current_fees; + const auto current_fees = _remote_db->get_global_properties().parameters.get_current_fees(); set_operation_fees(tx, current_fees); auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); tx.set_expiration(dyn_props.time + fc::seconds(30)); tx.validate(); @@ -1868,11 +1885,13 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(n_contract_register_op); - auto current_fees = _remote_db->get_global_properties().parameters.current_fees; + const auto current_fees = _remote_db->get_global_properties().parameters.get_current_fees(); set_operation_fees(tx, current_fees); auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); tx.set_expiration(dyn_props.time + fc::seconds(30)); tx.validate(); @@ -1955,11 +1974,13 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(contract_invoke_op); - auto current_fees = _remote_db->get_global_properties().parameters.current_fees; + const auto current_fees = _remote_db->get_global_properties().parameters.get_current_fees(); set_operation_fees(tx, current_fees); auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); tx.set_expiration(dyn_props.time + fc::seconds(30)); tx.validate(); @@ -2041,11 +2062,13 @@ class wallet_api_impl contract_invoke_op.guarantee_id = get_guarantee_id(); signed_transaction tx; tx.operations.push_back(contract_invoke_op); - auto current_fees = _remote_db->get_global_properties().parameters.current_fees; + const auto current_fees = _remote_db->get_global_properties().parameters.get_current_fees(); set_operation_fees(tx, current_fees); auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); tx.set_expiration(dyn_props.time + fc::seconds(30)); tx.validate(); @@ -2125,11 +2148,13 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(contract_invoke_op); - auto current_fees = _remote_db->get_global_properties().parameters.current_fees; + const auto current_fees = _remote_db->get_global_properties().parameters.get_current_fees(); set_operation_fees(tx, current_fees); auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); tx.set_expiration(dyn_props.time + fc::seconds(30)); tx.validate(); signed_transaction signed_tx(tx); @@ -2180,11 +2205,13 @@ class wallet_api_impl contract_upgrade_op.guarantee_id = get_guarantee_id(); signed_transaction tx; tx.operations.push_back(contract_upgrade_op); - auto current_fees = _remote_db->get_global_properties().parameters.current_fees; + const auto current_fees = _remote_db->get_global_properties().parameters.get_current_fees(); set_operation_fees(tx, current_fees); auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); tx.set_expiration(dyn_props.time + fc::seconds(30)); tx.validate(); @@ -2431,11 +2458,13 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(contract_upgrade_op); - auto current_fees = _remote_db->get_global_properties().parameters.current_fees; + const auto current_fees = _remote_db->get_global_properties().parameters.get_current_fees(); set_operation_fees(tx, current_fees); auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); tx.set_expiration(dyn_props.time + fc::seconds(600)); tx.validate(); @@ -2494,11 +2523,13 @@ class wallet_api_impl transfer_to_contract_op.guarantee_id = get_guarantee_id(); signed_transaction tx; tx.operations.push_back(transfer_to_contract_op); - auto current_fees = _remote_db->get_global_properties().parameters.current_fees; + const auto current_fees = _remote_db->get_global_properties().parameters.get_current_fees(); set_operation_fees(tx, current_fees); auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); tx.set_expiration(dyn_props.time + fc::seconds(30)); tx.validate(); @@ -2533,11 +2564,13 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(transfer_to_contract_op); - auto current_fees = _remote_db->get_global_properties().parameters.current_fees; + const auto current_fees = _remote_db->get_global_properties().parameters.get_current_fees(); set_operation_fees(tx, current_fees); auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); tx.set_expiration(dyn_props.time + fc::seconds(30)); tx.validate(); @@ -2580,7 +2613,7 @@ class wallet_api_impl current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); signed_transaction trx; trx.operations.emplace_back(prop_op); - set_operation_fees(trx, current_params.current_fees); + set_operation_fees(trx, current_params.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); @@ -2626,13 +2659,15 @@ class wallet_api_impl tx.operations.push_back( account_create_op ); - auto current_fees = _remote_db->get_global_properties().parameters.current_fees; + const auto current_fees = _remote_db->get_global_properties().parameters.get_current_fees(); set_operation_fees( tx, current_fees ); vector paying_keys = registrar_account_object.active.get_keys(); auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block( dyn_props.head_block_id ); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block( dyn_props.head_block_id ); tx.set_expiration( dyn_props.time + fc::seconds(30) ); tx.validate(); @@ -2666,7 +2701,7 @@ class wallet_api_impl op.account_to_upgrade = account_obj.get_id(); op.upgrade_to_lifetime_member = true; tx.operations = {op}; - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees ); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees() ); tx.validate(); return sign_transaction( tx, broadcast ); @@ -2689,7 +2724,7 @@ class wallet_api_impl signed_transaction trx; trx.operations.push_back(op); - set_operation_fees(trx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(trx, _remote_db->get_global_properties().parameters.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); }FC_CAPTURE_AND_RETHROW((account)(asset_orign)(asset_target)(symbol)(broadcast)) @@ -2706,7 +2741,7 @@ class wallet_api_impl signed_transaction trx; trx.operations.push_back(op); - set_operation_fees(trx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(trx, _remote_db->get_global_properties().parameters.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); @@ -2793,12 +2828,14 @@ class wallet_api_impl tx.operations.push_back( account_create_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); vector paying_keys = registrar_account_object.active.get_keys(); auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block( dyn_props.head_block_id ); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block( dyn_props.head_block_id ); tx.set_expiration( dyn_props.time + fc::seconds(30) ); tx.validate(); @@ -2944,7 +2981,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( create_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -2972,7 +3009,7 @@ class wallet_api_impl op.core_fee_paid = core_fee_paid; signed_transaction tx; tx.operations.push_back(op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -3011,7 +3048,7 @@ class wallet_api_impl op.erc_address = erc_real_address; signed_transaction tx; tx.operations.push_back(op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -3035,7 +3072,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( update_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -3056,7 +3093,7 @@ class wallet_api_impl full_transaction tx; tx.operations.push_back( update_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -3080,7 +3117,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( update_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -3102,7 +3139,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( publish_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -3127,7 +3164,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(publish_op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -3152,7 +3189,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( fund_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -3174,7 +3211,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( reserve_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -3195,7 +3232,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( settle_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -3216,7 +3253,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( settle_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -3234,7 +3271,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( whitelist_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -3268,7 +3305,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(guard_member_create_op); - set_operation_fees( tx, get_global_properties().parameters.current_fees); + set_operation_fees( tx, get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -3296,7 +3333,7 @@ class wallet_api_impl prop_op.proposed_ops.emplace_back(guard_create_op); //prop_op.review_period_seconds = 100; tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -3324,7 +3361,7 @@ class wallet_api_impl //prop_op.type = vote_id_type::committee; //prop_op.review_period_seconds = 0; tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -3368,7 +3405,7 @@ class wallet_api_impl op.new_options = acct.options; signed_transaction tx; tx.operations.push_back(op); - set_operation_fees(tx, get_global_properties().parameters.current_fees); + set_operation_fees(tx, get_global_properties().parameters.get_current_fees()); tx.validate(); full_transaction res= sign_transaction(tx, broadcast); @@ -3431,7 +3468,7 @@ class wallet_api_impl prop_op.fee_paying_account = get_account(account).addr; prop_op.proposed_ops.emplace_back(publisher_appointed_op); tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); }FC_CAPTURE_AND_RETHROW((account)(publisher)(symbol)(expiration_time)(broadcast)) @@ -3457,7 +3494,7 @@ class wallet_api_impl prop_op.fee_paying_account = get_account(account).addr; prop_op.proposed_ops.emplace_back(publisher_appointed_op); tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); }FC_CAPTURE_AND_RETHROW((account)(publisher)(symbol)(expiration_time)(broadcast)) @@ -3484,11 +3521,40 @@ class wallet_api_impl prop_op.proposed_ops.emplace_back(publisher_appointed_op); //prop_op.type = vote_id_type::witness; tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); }FC_CAPTURE_AND_RETHROW((account)(gas_price)(symbol)(expiration_time)(broadcast)) } + full_transaction senator_appointed_withdraw_limit(const string& account, const share_type limit, const string& symbol, int64_t expiration_time, bool broadcast /* = true */) + { + try { + FC_ASSERT(!is_locked()); + withdraw_limit_modify_operation op; + auto wallfacer_member_account = get_guard_member(account); + const chain_parameters& current_params = get_global_properties().parameters; + op.asset_symbol = symbol; + op.withdraw_limit = limit; + + auto publisher_appointed_op = operation(op); + current_params.current_fees->set_fee(publisher_appointed_op); + signed_transaction tx; + proposal_create_operation prop_op; + prop_op.expiration_time = fc::time_point_sec(time_point::now()) + fc::seconds(expiration_time); + prop_op.proposer = get_account(account).get_id(); + prop_op.fee_paying_account = get_account(account).addr; + prop_op.proposed_ops.emplace_back(publisher_appointed_op); + tx.operations.push_back(prop_op); + set_operation_fees(tx, current_params.get_current_fees()); + tx.validate(); + return sign_transaction(tx, broadcast); + + + + }FC_CAPTURE_AND_RETHROW((account)(limit)(symbol)(expiration_time)(broadcast)) + } + + full_transaction senator_appointed_crosschain_fee(const string& account, const share_type fee, const string& symbol, int64_t expiration_time, bool broadcast) { try { @@ -3510,7 +3576,7 @@ class wallet_api_impl prop_op.proposed_ops.emplace_back(publisher_appointed_op); //prop_op.type = vote_id_type::witness; tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); }FC_CAPTURE_AND_RETHROW((account)(fee)(symbol)(expiration_time)(broadcast)) @@ -3536,7 +3602,7 @@ class wallet_api_impl prop_op.proposed_ops.emplace_back(publisher_appointed_op); //prop_op.type = vote_id_type::witness; tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); }FC_CAPTURE_AND_RETHROW((account)(lockbalance)(expiration_time)(broadcast)) @@ -3559,7 +3625,7 @@ class wallet_api_impl prop_op.fee_paying_account = get_account(account).addr; prop_op.proposed_ops.emplace_back(determine_op); tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); }FC_CAPTURE_AND_RETHROW((account)(blocks_pays)(expiration_time)(broadcast)) @@ -3582,7 +3648,7 @@ class wallet_api_impl prop_op.type = vote_id_type::senator; current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); }FC_CAPTURE_AND_RETHROW((account)(block_addr)(expiration_time)(broadcast)) @@ -3610,7 +3676,7 @@ class wallet_api_impl prop_op.type = vote_id_type::senator; current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -3628,7 +3694,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(op); - set_operation_fees(tx, get_global_properties().parameters.current_fees); + set_operation_fees(tx, get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -3647,7 +3713,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(op); - set_operation_fees(tx, get_global_properties().parameters.current_fees); + set_operation_fees(tx, get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); }FC_CAPTURE_AND_RETHROW((account)(addr)(balance)(broadcast)) @@ -3680,7 +3746,7 @@ class wallet_api_impl prop_op.type = vote_id_type::senator; current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -3705,7 +3771,7 @@ class wallet_api_impl prop_op.type = vote_id_type::senator; current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); }FC_CAPTURE_AND_RETHROW((account)(block_addr)(expiration_time)(broadcast)) @@ -3731,7 +3797,7 @@ class wallet_api_impl prop_op.proposed_ops.emplace_back(publisher_appointed_op); //prop_op.type = vote_id_type::witness; tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); }FC_CAPTURE_AND_RETHROW((account)(can)(expiration_time)(broadcast)) @@ -3766,7 +3832,7 @@ class wallet_api_impl op.guarantee_id = get_guarantee_id(); signed_transaction tx; tx.operations.push_back(op); - set_operation_fees(tx, get_global_properties().parameters.current_fees); + set_operation_fees(tx, get_global_properties().parameters.get_current_fees()); tx.validate(); sign_transaction(tx,broadcast); result[pubkey] = op.multisignature; @@ -3888,7 +3954,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(miner_create_op); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); _wallet.pending_miner_registrations[owner_account] = key_to_wif(active_private_key); @@ -3915,7 +3981,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( witness_update_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees ); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees() ); tx.validate(); return sign_transaction( tx, broadcast ); @@ -3966,7 +4032,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees ); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees() ); tx.validate(); return sign_transaction( tx, broadcast ); @@ -4031,7 +4097,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( update_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees ); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees() ); tx.validate(); return sign_transaction( tx, broadcast ); @@ -4089,7 +4155,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( vesting_balance_withdraw_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees ); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees() ); tx.validate(); return sign_transaction( tx, broadcast ); @@ -4116,7 +4182,7 @@ class wallet_api_impl current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); signed_transaction trx; trx.operations.emplace_back(prop_op); - set_operation_fees(trx, current_params.current_fees); + set_operation_fees(trx, current_params.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); }FC_CAPTURE_AND_RETHROW((proposer)(trxid)(exception_time)(broadcast)) @@ -4135,7 +4201,7 @@ class wallet_api_impl signed_transaction trx; trx.operations.push_back(op); - set_operation_fees(trx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(trx, _remote_db->get_global_properties().parameters.get_current_fees()); trx.validate(); return sign_transaction(trx,broadcast); @@ -4167,7 +4233,7 @@ class wallet_api_impl current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); signed_transaction trx; trx.operations.emplace_back(prop_op); - set_operation_fees(trx, current_params.current_fees); + set_operation_fees(trx, current_params.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); @@ -4198,7 +4264,7 @@ class wallet_api_impl current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); signed_transaction trx; trx.operations.emplace_back(prop_op); - set_operation_fees(trx, current_params.current_fees); + set_operation_fees(trx, current_params.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); @@ -4227,7 +4293,7 @@ class wallet_api_impl current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); signed_transaction trx; trx.operations.emplace_back(prop_op); - set_operation_fees(trx, current_params.current_fees); + set_operation_fees(trx, current_params.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); @@ -4256,7 +4322,7 @@ class wallet_api_impl current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); signed_transaction trx; trx.operations.emplace_back(prop_op); - set_operation_fees(trx, current_params.current_fees); + set_operation_fees(trx, current_params.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); @@ -4286,7 +4352,7 @@ class wallet_api_impl current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); signed_transaction trx; trx.operations.emplace_back(prop_op); - set_operation_fees(trx, current_params.current_fees); + set_operation_fees(trx, current_params.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); @@ -4315,7 +4381,7 @@ class wallet_api_impl current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); signed_transaction trx; trx.operations.emplace_back(prop_op); - set_operation_fees(trx, current_params.current_fees); + set_operation_fees(trx, current_params.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); @@ -4343,7 +4409,7 @@ class wallet_api_impl current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); signed_transaction trx; trx.operations.emplace_back(prop_op); - set_operation_fees(trx, current_params.current_fees); + set_operation_fees(trx, current_params.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); @@ -4373,7 +4439,7 @@ class wallet_api_impl current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); signed_transaction trx; trx.operations.emplace_back(prop_op); - set_operation_fees(trx, current_params.current_fees); + set_operation_fees(trx, current_params.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); } @@ -4402,7 +4468,7 @@ class wallet_api_impl current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); signed_transaction trx; trx.operations.emplace_back(prop_op); - set_operation_fees(trx, current_params.current_fees); + set_operation_fees(trx, current_params.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); } @@ -4430,7 +4496,7 @@ class wallet_api_impl current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); signed_transaction trx; trx.operations.emplace_back(prop_op); - set_operation_fees(trx, current_params.current_fees); + set_operation_fees(trx, current_params.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); @@ -4542,7 +4608,7 @@ class wallet_api_impl op.signature = key->sign_compact(fc::sha256::hash(op.new_address_hot + op.new_address_cold)); signed_transaction trx; trx.operations.emplace_back(op); - set_operation_fees(trx, get_global_properties().parameters.current_fees); + set_operation_fees(trx, get_global_properties().parameters.get_current_fees()); trx.validate(); auto res = sign_transaction(trx, broadcast); return res; @@ -4569,7 +4635,7 @@ class wallet_api_impl op.signature = key->sign_compact(fc::sha256::hash(op.new_address_hot + op.new_address_cold)); signed_transaction trx; trx.operations.emplace_back(op); - set_operation_fees(trx, get_global_properties().parameters.current_fees); + set_operation_fees(trx, get_global_properties().parameters.get_current_fees()); trx.validate(); auto res = sign_transaction(trx, broadcast); return res; @@ -4651,7 +4717,7 @@ class wallet_api_impl signed_transaction trx; trx.operations.emplace_back(op); - set_operation_fees(trx, get_global_properties().parameters.current_fees); + set_operation_fees(trx, get_global_properties().parameters.get_current_fees()); trx.validate(); auto res= sign_transaction(trx,broadcast); boost::filesystem::remove(tmpf); @@ -4703,7 +4769,7 @@ class wallet_api_impl current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); signed_transaction trx; trx.operations.emplace_back(prop_op); - set_operation_fees(trx, current_params.current_fees); + set_operation_fees(trx, current_params.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); @@ -4754,7 +4820,7 @@ class wallet_api_impl signed_transaction trx; trx.operations.emplace_back(op); - set_operation_fees(trx, get_global_properties().parameters.current_fees); + set_operation_fees(trx, get_global_properties().parameters.get_current_fees()); trx.validate(); return sign_transaction(trx,broadcast); }FC_CAPTURE_AND_RETHROW((account)(id)(broadcast)) @@ -4787,7 +4853,7 @@ class wallet_api_impl signed_transaction trx; trx.operations.emplace_back(prop_op); - set_operation_fees(trx, current_params.current_fees); + set_operation_fees(trx, current_params.get_current_fees()); trx.validate(); return sign_transaction(trx,broadcast); @@ -4846,7 +4912,7 @@ class wallet_api_impl op.tunnel_signature = script; //signature of tunnel address. signed_transaction trx; trx.operations.emplace_back(op); - set_operation_fees(trx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(trx, _remote_db->get_global_properties().parameters.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); }FC_CAPTURE_AND_RETHROW((link_account)(tunnel_account)(script)(symbol)(broadcast)) @@ -4904,7 +4970,7 @@ class wallet_api_impl crosschain->create_signature(prk_ptr, transfer_tunnel_account, op.tunnel_signature); signed_transaction trx; trx.operations.emplace_back(op); - set_operation_fees(trx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(trx, _remote_db->get_global_properties().parameters.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); @@ -4939,7 +5005,7 @@ class wallet_api_impl op.tunnel_signature = script; signed_transaction trx; trx.operations.emplace_back(op); - set_operation_fees(trx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(trx, _remote_db->get_global_properties().parameters.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); @@ -4987,7 +5053,7 @@ class wallet_api_impl crosschain->create_signature(prk_ptr, tunnel_account, op.tunnel_signature); signed_transaction trx; trx.operations.emplace_back(op); - set_operation_fees(trx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(trx, _remote_db->get_global_properties().parameters.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); }FC_CAPTURE_AND_RETHROW((link_account)(tunnel_account)(symbol)(broadcast)) @@ -5030,7 +5096,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( account_update_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -5064,7 +5130,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( account_update_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -5095,7 +5161,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( account_update_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -5121,7 +5187,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back( account_update_op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -5215,7 +5281,9 @@ class wallet_api_impl uint32_t expiration_time_offset = 0; auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); flat_set
approving_key_set; for (const authority& a : other_auths) { @@ -5297,7 +5365,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(op); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction( tx, broadcast ); @@ -5318,7 +5386,7 @@ class wallet_api_impl signed_transaction trx; trx.operations = {op}; - set_operation_fees( trx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( trx, _remote_db->get_global_properties().parameters.get_current_fees()); trx.validate(); idump((broadcast)); @@ -5515,7 +5583,7 @@ class wallet_api_impl signed_transaction transaction; transaction.operations.push_back(tx_op); - set_operation_fees(transaction, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(transaction, _remote_db->get_global_properties().parameters.get_current_fees()); transaction.validate(); sign_transaction(transaction, true); } @@ -5666,7 +5734,7 @@ class wallet_api_impl tx_op.coldhot_transfer_sign = siging; signed_transaction transaction; transaction.operations.push_back(tx_op); - set_operation_fees(transaction, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(transaction, _remote_db->get_global_properties().parameters.get_current_fees()); transaction.validate(); sign_transaction(transaction, true); } @@ -5783,7 +5851,7 @@ class wallet_api_impl tx_op.coldhot_transfer_sign = siging; signed_transaction transaction; transaction.operations.push_back(tx_op); - set_operation_fees(transaction, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(transaction, _remote_db->get_global_properties().parameters.get_current_fees()); transaction.validate(); sign_transaction(transaction, true); @@ -5849,7 +5917,7 @@ class wallet_api_impl trx_op.guard_address = account_obj.addr; signed_transaction transaction; transaction.operations.push_back(trx_op); - set_operation_fees(transaction, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(transaction, _remote_db->get_global_properties().parameters.get_current_fees()); transaction.validate(); sign_transaction(transaction, true); @@ -5948,7 +6016,7 @@ class wallet_api_impl current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); signed_transaction transaction; transaction.operations.push_back(prop_op); - set_operation_fees(transaction, current_params.current_fees); + set_operation_fees(transaction, current_params.get_current_fees()); transaction.validate(); sign_transaction(transaction, true); } @@ -5993,7 +6061,7 @@ class wallet_api_impl current_params.current_fees->set_fee(prop_op.proposed_ops.back().op); signed_transaction transaction; transaction.operations.push_back(prop_op); - set_operation_fees(transaction, current_params.current_fees); + set_operation_fees(transaction, current_params.get_current_fees()); transaction.validate(); sign_transaction(transaction, true); } @@ -6036,7 +6104,7 @@ class wallet_api_impl trx_op.guard_address = account_obj.addr; signed_transaction transaction; transaction.operations.push_back(trx_op); - set_operation_fees(transaction, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(transaction, _remote_db->get_global_properties().parameters.get_current_fees()); transaction.validate(); sign_transaction(transaction, true); } @@ -6073,7 +6141,7 @@ class wallet_api_impl trx_op.guard_address = account_obj.addr; signed_transaction transaction; transaction.operations.push_back(trx_op); - set_operation_fees(transaction, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(transaction, _remote_db->get_global_properties().parameters.get_current_fees()); transaction.validate(); sign_transaction(transaction, true); // } @@ -6132,7 +6200,7 @@ class wallet_api_impl trx_op.guard_address = account_obj.addr; signed_transaction transaction; transaction.operations.push_back(trx_op); - set_operation_fees(transaction, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(transaction, _remote_db->get_global_properties().parameters.get_current_fees()); transaction.validate(); sign_transaction(transaction, true); } @@ -6176,7 +6244,7 @@ class wallet_api_impl trx_op.guard_address = account_obj.addr; signed_transaction transaction; transaction.operations.push_back(trx_op); - set_operation_fees(transaction, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(transaction, _remote_db->get_global_properties().parameters.get_current_fees()); transaction.validate(); sign_transaction(transaction, true); @@ -6216,7 +6284,7 @@ class wallet_api_impl op.fee_paying_account = get_object(order_id).seller; op.order = order_id; trx.operations = {op}; - set_operation_fees( trx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( trx, _remote_db->get_global_properties().parameters.get_current_fees()); trx.validate(); return sign_transaction(trx, broadcast); @@ -6258,7 +6326,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -6296,7 +6364,7 @@ class wallet_api_impl op.crosschain_account = multi_to_account; signed_transaction tx; tx.operations.push_back(op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); }FC_CAPTURE_AND_RETHROW((multi_account)(amount)(asset_symbol)(multi_to_account)(memo)) @@ -6331,7 +6399,7 @@ class wallet_api_impl } FC_ASSERT(tx.operations.size() <= 100, "should less than 100 operations."); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); }FC_CAPTURE_AND_RETHROW((lock_account)(lockbalances)(broadcast)) @@ -6359,7 +6427,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(lb_op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -6387,7 +6455,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(guard_lb_op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -6422,7 +6490,7 @@ class wallet_api_impl } FC_ASSERT(tx.operations.size() <= 100, "should less than 100 operations."); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); }FC_CAPTURE_AND_RETHROW((foreclose_account)(foreclose_balances)(broadcast)) @@ -6451,7 +6519,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(fcb_op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -6479,7 +6547,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(guard_fcb_op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -6522,10 +6590,12 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(u_op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); uint32_t expiration_time_offset = 0; auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); tx.set_expiration(dyn_props.time + fc::seconds(3600 * 24 + expiration_time_offset)); tx.validate(); auto json_str = fc::json::to_string(tx); @@ -6555,10 +6625,12 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(u_op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); uint32_t expiration_time_offset = 0; auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); tx.set_expiration(dyn_props.time + fc::seconds(3600 * 24 + expiration_time_offset)); tx.validate(); auto json_str = fc::json::to_string(tx); @@ -6588,11 +6660,13 @@ class wallet_api_impl } signed_transaction tx; tx.operations.push_back(xfer_op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); uint32_t expiration_time_offset = 0; auto dyn_props = get_dynamic_global_properties(); - tx.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM > 0 ? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM : 0); + tx.set_reference_block(ref_block_header->previous); + //tx.set_reference_block(dyn_props.head_block_id); tx.set_expiration(dyn_props.time + fc::seconds(3600*24 + expiration_time_offset)); tx.validate(); auto json_str = fc::json::to_string(tx); @@ -6655,7 +6729,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(xfer_op); - set_operation_fees(tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -6681,7 +6755,9 @@ class wallet_api_impl auto dyn_props = get_dynamic_global_properties(); transaction tmp; - tmp.set_reference_block(dyn_props.head_block_id); + auto ref_block_header = _remote_db->get_block_header(dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM>0? dyn_props.head_block_number - GRAPHENE_DELAY_TRX_REFER_BLOCK_NUM:0); + tmp.set_reference_block(ref_block_header->previous); + //tmp.set_reference_block(dyn_props.head_block_id); auto res = fc::to_string(tmp.ref_block_num); res += "," + fc::to_string(tmp.ref_block_prefix); @@ -6722,7 +6798,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(xfer_op); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -6752,7 +6828,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(issue_op); - set_operation_fees(tx,_remote_db->get_global_properties().parameters.current_fees); + set_operation_fees(tx,_remote_db->get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -6998,7 +7074,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -7032,7 +7108,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -7065,7 +7141,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -7106,7 +7182,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -7120,7 +7196,7 @@ class wallet_api_impl bool broadcast = false) { const chain_parameters& current_params = get_global_properties().parameters; - const fee_schedule_type& current_fees = *(current_params.current_fees); + const fee_schedule_type& current_fees = (current_params.get_current_fees()); flat_map< int, fee_parameters > fee_map; fee_map.reserve( current_fees.parameters.size() ); @@ -7173,7 +7249,7 @@ class wallet_api_impl new_fees.scale = scale; chain_parameters new_params = current_params; - new_params.current_fees = new_fees; + new_params.get_mutable_fees() = new_fees; committee_member_update_global_parameters_operation update_op; update_op.new_parameters = new_params; @@ -7188,7 +7264,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(prop_op); - set_operation_fees(tx, current_params.current_fees); + set_operation_fees(tx, current_params.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); @@ -7222,7 +7298,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(update_op); - set_operation_fees(tx, get_global_properties().parameters.current_fees); + set_operation_fees(tx, get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); } @@ -7245,7 +7321,7 @@ class wallet_api_impl signed_transaction tx; tx.operations.push_back(update_op); - set_operation_fees(tx, get_global_properties().parameters.current_fees); + set_operation_fees(tx, get_global_properties().parameters.get_current_fees()); tx.validate(); return sign_transaction(tx, broadcast); } @@ -8407,7 +8483,9 @@ fc::uint128_t wallet_api::get_pledge() const { return my->get_pledge(); } - +bool wallet_api::update_seed_node() { + return my->update_seed_node(); +} fc::ecc::private_key wallet_api::derive_private_key(const std::string& prefix_string, int sequence_number) const { return detail::derive_private_key( prefix_string, sequence_number ); @@ -10415,9 +10493,11 @@ std::string getwalletcommandinfo(std::string command) { return ret; } -string wallet_api::gethelp(const string& method)const +string wallet_api::gethelp(const string& method) { fc::api tmp; + fc::local_api_connection tmp_a; + tmp.register_api(tmp_a); //std::stringstream ss; //ss << "\n"; @@ -10789,7 +10869,7 @@ vector< signed_transaction > wallet_api_impl::import_balance( string name_or_id, tx.operations.reserve( ctx.ops.size() ); for( const balance_claim_operation& op : ctx.ops ) tx.operations.emplace_back( op ); - set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees ); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees() ); tx.validate(); signed_transaction signed_tx = sign_transaction( tx, false ); for( const address& addr : ctx.addrs ) @@ -10895,6 +10975,10 @@ full_transaction wallet_api::senator_appointed_crosschain_fee(const string& acco { return my->senator_appointed_crosschain_fee(account,fee,symbol, expiration_time,broadcast); } +full_transaction wallet_api::senator_appointed_withdraw_limit(const string& account, const share_type limit, const string& symbol, int64_t expiration_time, bool broadcast /* = true */) +{ + return my->senator_appointed_withdraw_limit(account,limit, symbol,expiration_time,broadcast); +} full_transaction wallet_api::senator_change_eth_gas_price(const string& account, const string& gas_price, const string& symbol, int64_t expiration_time, bool broadcast) { return my->senator_change_eth_gas_price(account, gas_price, symbol, expiration_time, broadcast); @@ -11105,7 +11189,7 @@ blind_confirmation wallet_api::transfer_from_blind( string from_blind_account_ke transfer_from_blind_operation from_blind; - auto fees = my->_remote_db->get_global_properties().parameters.current_fees; + auto fees = my->_remote_db->get_global_properties().parameters.get_current_fees(); fc::optional asset_obj = get_asset(symbol); FC_ASSERT(asset_obj.valid(), "Could not find asset matching ${asset}", ("asset", symbol)); auto amount = asset_obj->amount_from_string(amount_in); @@ -11184,7 +11268,7 @@ blind_confirmation wallet_api::blind_transfer_help( string from_key_or_label, blind_transfer_operation blind_tr; blind_tr.outputs.resize(2); - auto fees = my->_remote_db->get_global_properties().parameters.current_fees; + auto fees = my->_remote_db->get_global_properties().parameters.get_current_fees(); auto amount = asset_obj->amount_from_string(amount_in); @@ -11407,7 +11491,7 @@ blind_confirmation wallet_api::transfer_to_blind( string from_account_id_or_name [&]( const blind_output& a, const blind_output& b ){ return a.commitment < b.commitment; } ); confirm.trx.operations.push_back( bop ); - my->set_operation_fees( confirm.trx, my->_remote_db->get_global_properties().parameters.current_fees); + my->set_operation_fees( confirm.trx, my->_remote_db->get_global_properties().parameters.get_current_fees()); confirm.trx.validate(); confirm.trx = sign_transaction(confirm.trx, broadcast); diff --git a/programs/build_helpers/member_enumerator.cpp b/programs/build_helpers/member_enumerator.cpp index 631fd715..d4ddaa71 100644 --- a/programs/build_helpers/member_enumerator.cpp +++ b/programs/build_helpers/member_enumerator.cpp @@ -28,7 +28,7 @@ #include #include #include -#include + #include using namespace graphene::chain; diff --git a/programs/cli_wallet/main.cpp b/programs/cli_wallet/main.cpp index 626d0401..0b2bdfe0 100644 --- a/programs/cli_wallet/main.cpp +++ b/programs/cli_wallet/main.cpp @@ -34,7 +34,7 @@ #include #include #include -#include + #include #include diff --git a/programs/genesis_util/genesis_update.cpp b/programs/genesis_util/genesis_update.cpp index 268608c4..19f8df60 100644 --- a/programs/genesis_util/genesis_update.cpp +++ b/programs/genesis_util/genesis_update.cpp @@ -30,7 +30,7 @@ #include #include #include -#include + #include #include diff --git a/programs/js_operation_serializer/main.cpp b/programs/js_operation_serializer/main.cpp index 6691bc1f..5e732ac1 100644 --- a/programs/js_operation_serializer/main.cpp +++ b/programs/js_operation_serializer/main.cpp @@ -37,7 +37,7 @@ #include #include #include -#include + #include #include diff --git a/programs/size_checker/main.cpp b/programs/size_checker/main.cpp index de071cfc..b0db788d 100644 --- a/programs/size_checker/main.cpp +++ b/programs/size_checker/main.cpp @@ -23,7 +23,7 @@ */ #include -#include + #include #include diff --git a/programs/witness_node/main.cpp b/programs/witness_node/main.cpp index 1cdfcb27..f97b6578 100644 --- a/programs/witness_node/main.cpp +++ b/programs/witness_node/main.cpp @@ -232,6 +232,11 @@ int main(int argc, char** argv) { node->startup(); node->startup_plugins(); + node->chain_database()->broad_trxs.connect([&](const deque& b) { + for (const auto& one_trx : b){ + node->p2p_node()->broadcast_transaction(one_trx); + } }); + node->add_seed_node(); auto chain_types = node->get_crosschain_chain_types(); for (auto& chain_type : chain_types) { diff --git a/tests/common/database_fixture.cpp b/tests/common/database_fixture.cpp index 9f9a652f..175a2c1d 100644 --- a/tests/common/database_fixture.cpp +++ b/tests/common/database_fixture.cpp @@ -584,7 +584,7 @@ void database_fixture::change_fees( ) { const chain_parameters& current_chain_params = db.get_global_properties().parameters; - const fee_schedule& current_fees = *(current_chain_params.current_fees); + const fee_schedule& current_fees = (current_chain_params.get_mutable_fees()); flat_map< int, fee_parameters > fee_map; fee_map.reserve( current_fees.parameters.size() ); @@ -601,7 +601,7 @@ void database_fixture::change_fees( new_fees.scale = new_scale; chain_parameters new_chain_params = current_chain_params; - new_chain_params.current_fees = new_fees; + new_chain_params.get_mutable_fees() = new_fees; db.modify(db.get_global_properties(), [&](global_property_object& p) { p.parameters = new_chain_params; @@ -934,7 +934,7 @@ void database_fixture::enable_fees() { db.modify(global_property_id_type()(db), [](global_property_object& gpo) { - gpo.parameters.current_fees = fee_schedule::get_default(); + gpo.parameters.get_mutable_fees() = fee_schedule::get_default(); }); } @@ -950,7 +950,7 @@ void database_fixture::upgrade_to_lifetime_member( const account_object& account account_upgrade_operation op; op.account_to_upgrade = account.get_id(); op.upgrade_to_lifetime_member = true; - op.fee = db.get_global_properties().parameters.current_fees->calculate_fee(op); + op.fee = db.get_global_properties().parameters.get_current_fees().calculate_fee(op); trx.operations = {op}; db.push_transaction(trx, ~0); FC_ASSERT( op.account_to_upgrade(db).is_lifetime_member() );