Merge remote-tracking branch 'origin/develop' into HEAD
This commit is contained in:
commit
d1d11d4aba
72 changed files with 257 additions and 189 deletions
|
|
@ -18,7 +18,7 @@ build:
|
|||
- rm -rf build
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake ..
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
- make -j$(nproc)
|
||||
artifacts:
|
||||
untracked: true
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
# Defines BitShares library target.
|
||||
project( BitShares )
|
||||
# Defines Peerplays library target.
|
||||
project( Peerplays )
|
||||
cmake_minimum_required( VERSION 2.8.12 )
|
||||
|
||||
set( BLOCKCHAIN_NAME "BitShares" )
|
||||
set( BLOCKCHAIN_NAME "Peerplays" )
|
||||
|
||||
set( CLI_CLIENT_EXECUTABLE_NAME graphene_client )
|
||||
set( GUI_CLIENT_EXECUTABLE_NAME BitShares )
|
||||
set( GUI_CLIENT_EXECUTABLE_NAME Peerplays )
|
||||
set( CUSTOM_URL_SCHEME "gcs" )
|
||||
set( INSTALLER_APP_ID "68ad7005-8eee-49c9-95ce-9eed97e5b347" )
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ ENDIF()
|
|||
|
||||
if( WIN32 )
|
||||
|
||||
message( STATUS "Configuring BitShares on WIN32")
|
||||
message( STATUS "Configuring Peerplays on WIN32")
|
||||
set( DB_VERSION 60 )
|
||||
set( BDB_STATIC_LIBS 1 )
|
||||
|
||||
|
|
@ -103,20 +103,13 @@ if( WIN32 )
|
|||
SET(TCL_LIBRARY ${TCL_LIBS})
|
||||
|
||||
else( WIN32 ) # Apple AND Linux
|
||||
|
||||
find_library(READLINE_LIBRARIES NAMES readline)
|
||||
find_path(READLINE_INCLUDE_DIR readline/readline.h)
|
||||
#if(NOT READLINE_INCLUDE_DIR OR NOT READLINE_LIBRARIES)
|
||||
# MESSAGE(FATAL_ERROR "Could not find lib readline.")
|
||||
#endif()
|
||||
|
||||
if( APPLE )
|
||||
# Apple Specific Options Here
|
||||
message( STATUS "Configuring BitShares on OS X" )
|
||||
message( STATUS "Configuring Peerplays on OS X" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -stdlib=libc++ -Wall" )
|
||||
else( APPLE )
|
||||
# Linux Specific Options Here
|
||||
message( STATUS "Configuring BitShares on Linux" )
|
||||
message( STATUS "Configuring Peerplays on Linux" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wall" )
|
||||
set( rt_library rt )
|
||||
#set( pthread_library pthread)
|
||||
|
|
@ -135,7 +128,7 @@ else( WIN32 ) # Apple AND Linux
|
|||
endif( APPLE )
|
||||
|
||||
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-memcmp -Wno-parentheses -Wno-terminate -Wno-invalid-offsetof -Wno-sign-compare" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-memcmp -Wno-parentheses -Wno-terminate -Wno-invalid-offsetof" )
|
||||
elseif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
|
||||
if( CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.0.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.0.0 )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-partial-specialization" )
|
||||
|
|
@ -154,7 +147,7 @@ else( WIN32 ) # Apple AND Linux
|
|||
|
||||
endif( WIN32 )
|
||||
|
||||
set(ENABLE_COVERAGE_TESTING FALSE CACHE BOOL "Build BitShares for code coverage analysis")
|
||||
set(ENABLE_COVERAGE_TESTING FALSE CACHE BOOL "Build Peerplays for code coverage analysis")
|
||||
|
||||
if(ENABLE_COVERAGE_TESTING)
|
||||
SET(CMAKE_CXX_FLAGS "--coverage ${CMAKE_CXX_FLAGS}")
|
||||
|
|
@ -163,13 +156,13 @@ endif()
|
|||
add_subdirectory( libraries )
|
||||
|
||||
|
||||
set(BUILD_BITSHARES_PROGRAMS TRUE CACHE BOOL "Build bitshares executables (witness node, cli wallet, etc)")
|
||||
set(BUILD_PEERPLAYS_PROGRAMS TRUE CACHE BOOL "Build peerplays executables (witness node, cli wallet, etc)")
|
||||
add_subdirectory( programs )
|
||||
|
||||
set(BUILD_BITSHARES_TESTS TRUE CACHE BOOL "Build bitshares unit tests")
|
||||
if( BUILD_BITSHARES_TESTS )
|
||||
set(BUILD_PEERPLAYS_TESTS TRUE CACHE BOOL "Build peerplays unit tests")
|
||||
if( BUILD_PEERPLAYS_TESTS )
|
||||
add_subdirectory( tests )
|
||||
endif( BUILD_BITSHARES_TESTS )
|
||||
endif( BUILD_PEERPLAYS_TESTS )
|
||||
|
||||
|
||||
if (ENABLE_INSTALLER)
|
||||
|
|
@ -191,18 +184,18 @@ set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
|
|||
set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
|
||||
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||
set(CPACK_PACKAGE_DESCRIPTION "A client for the BitShares network")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A client for the BitShares network")
|
||||
set(CPACK_PACKAGE_DESCRIPTION "A client for the Peerplays network")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A client for the Peerplays network")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "BitShares ${CPACK_PACKAGE_VERSION}")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Peerplays ${CPACK_PACKAGE_VERSION}")
|
||||
|
||||
if(WIN32)
|
||||
SET(CPACK_GENERATOR "ZIP;NSIS")
|
||||
set(CPACK_PACKAGE_NAME "BitShares") # override above
|
||||
set(CPACK_PACKAGE_NAME "Peerplays") # override above
|
||||
set(CPACK_NSIS_EXECUTABLES_DIRECTORY .)
|
||||
set(CPACK_NSIS_PACKAGE_NAME "BitShares v${CPACK_PACKAGE_VERSION}")
|
||||
set(CPACK_NSIS_PACKAGE_NAME "Peerplays v${CPACK_PACKAGE_VERSION}")
|
||||
set(CPACK_NSIS_DISPLAY_NAME "${CPACK_NSIS_PACKAGE_NAME}")
|
||||
set(CPACK_NSIS_DEFINES " !define MUI_STARTMENUPAGE_DEFAULTFOLDER \\\"BitShares\\\"")
|
||||
set(CPACK_NSIS_DEFINES " !define MUI_STARTMENUPAGE_DEFAULTFOLDER \\\"Peerplays\\\"")
|
||||
# it seems like windows zip files usually don't have a single directory inside them, unix tgz frequently do
|
||||
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
|
||||
|
||||
|
|
@ -220,3 +213,4 @@ endif(LINUX)
|
|||
|
||||
include(CPack)
|
||||
endif(ENABLE_INSTALLER)
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@
|
|||
#include <graphene/chain/tournament_object.hpp>
|
||||
|
||||
#include <fc/crypto/hex.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <fc/rpc/api_connection.hpp>
|
||||
#include <fc/thread/future.hpp>
|
||||
|
||||
|
|
@ -580,7 +579,10 @@ namespace graphene { namespace app {
|
|||
{
|
||||
FC_ASSERT( _app.chain_database() );
|
||||
const auto& db = *_app.chain_database();
|
||||
FC_ASSERT( limit <= 100 );
|
||||
FC_ASSERT( limit <= api_limit_get_account_history,
|
||||
"Number of querying accounts can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_get_account_history) );
|
||||
|
||||
vector<operation_history_object> result;
|
||||
account_id_type account;
|
||||
try {
|
||||
|
|
@ -628,7 +630,10 @@ namespace graphene { namespace app {
|
|||
{
|
||||
FC_ASSERT( _app.chain_database() );
|
||||
const auto& db = *_app.chain_database();
|
||||
FC_ASSERT( limit <= 100 );
|
||||
FC_ASSERT( limit <= api_limit_get_account_history_operations,
|
||||
"Number of querying history accounts can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_get_account_history_operations) );
|
||||
|
||||
vector<operation_history_object> result;
|
||||
account_id_type account;
|
||||
try {
|
||||
|
|
@ -668,7 +673,10 @@ namespace graphene { namespace app {
|
|||
{
|
||||
FC_ASSERT( _app.chain_database() );
|
||||
const auto& db = *_app.chain_database();
|
||||
FC_ASSERT(limit <= 100);
|
||||
FC_ASSERT( limit <= api_limit_get_relative_account_history,
|
||||
"Number of querying accounts can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_get_relative_account_history) );
|
||||
|
||||
vector<operation_history_object> result;
|
||||
account_id_type account;
|
||||
try {
|
||||
|
|
@ -805,7 +813,9 @@ namespace graphene { namespace app {
|
|||
asset_api::~asset_api() { }
|
||||
|
||||
vector<account_asset_balance> asset_api::get_asset_holders( std::string asset, uint32_t start, uint32_t limit ) const {
|
||||
FC_ASSERT(limit <= 100);
|
||||
FC_ASSERT( limit <= api_limit_get_asset_holders,
|
||||
"Number of querying asset holder accounts can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_get_asset_holders) );
|
||||
|
||||
asset_id_type asset_id = database_api.get_asset_id_from_string( asset );
|
||||
const auto& bal_idx = _db.get_index_type< account_balance_index >().indices().get< by_asset_balance >();
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@
|
|||
#include <graphene/utilities/key_conversion.hpp>
|
||||
#include <graphene/chain/worker_evaluator.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <fc/io/fstream.hpp>
|
||||
#include <fc/rpc/api_connection.hpp>
|
||||
#include <fc/rpc/websocket_api.hpp>
|
||||
|
|
@ -80,7 +78,7 @@ namespace detail {
|
|||
auto nathan_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("nathan")));
|
||||
dlog("Allocating all stake to ${key}", ("key", utilities::key_to_wif(nathan_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.current_fees = std::make_shared<fee_schedule>(fee_schedule::get_default());
|
||||
initial_state.initial_active_witnesses = GRAPHENE_DEFAULT_MIN_WITNESS_COUNT;
|
||||
initial_state.initial_timestamp = time_point_sec(time_point::now().sec_since_epoch() /
|
||||
initial_state.initial_parameters.block_interval *
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <graphene/chain/pts_address.hpp>
|
||||
|
||||
#include <fc/bloom_filter.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <fc/crypto/hex.hpp>
|
||||
#include <fc/rpc/api_connection.hpp>
|
||||
|
|
@ -235,6 +234,18 @@ class database_api_impl : public std::enable_shared_from_this<database_api_impl>
|
|||
vector<offer_history_object> get_offer_history_by_item(const offer_history_id_type lower_id, const nft_id_type item, uint32_t limit) const;
|
||||
vector<offer_history_object> get_offer_history_by_bidder(const offer_history_id_type lower_id, const account_id_type bidder_account_id, uint32_t limit) const;
|
||||
|
||||
|
||||
uint32_t api_limit_get_lower_bound_symbol = 100;
|
||||
uint32_t api_limit_get_limit_orders = 300;
|
||||
uint32_t api_limit_get_limit_orders_by_account = 101;
|
||||
uint32_t api_limit_get_order_book = 50;
|
||||
uint32_t api_limit_all_offers_count = 100;
|
||||
uint32_t api_limit_lookup_accounts = 1000;
|
||||
uint32_t api_limit_lookup_witness_accounts = 1000;
|
||||
uint32_t api_limit_lookup_committee_member_accounts = 1000;
|
||||
uint32_t api_limit_get_trade_history = 100;
|
||||
uint32_t api_limit_get_trade_history_by_sequence = 100;
|
||||
|
||||
// Account Role
|
||||
vector<account_role_object> get_account_roles_by_owner(account_id_type owner) const;
|
||||
|
||||
|
|
@ -878,7 +889,9 @@ map<string,account_id_type> database_api::lookup_accounts(const string& lower_bo
|
|||
|
||||
map<string,account_id_type> database_api_impl::lookup_accounts(const string& lower_bound_name, uint32_t limit)const
|
||||
{
|
||||
FC_ASSERT( limit <= 1000 );
|
||||
FC_ASSERT( limit <= api_limit_lookup_accounts,
|
||||
"Number of querying accounts can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_lookup_accounts) );
|
||||
const auto& accounts_by_name = _db.get_index_type<account_index>().indices().get<by_name>();
|
||||
map<string,account_id_type> result;
|
||||
|
||||
|
|
@ -1086,7 +1099,9 @@ vector<asset_object> database_api::list_assets(const string& lower_bound_symbol,
|
|||
|
||||
vector<asset_object> database_api_impl::list_assets(const string& lower_bound_symbol, uint32_t limit)const
|
||||
{
|
||||
FC_ASSERT( limit <= 100 );
|
||||
FC_ASSERT( limit <= api_limit_get_lower_bound_symbol,
|
||||
"Number of querying accounts can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_get_lower_bound_symbol) );
|
||||
const auto& assets_by_symbol = _db.get_index_type<asset_index>().indices().get<by_symbol>();
|
||||
vector<asset_object> result;
|
||||
result.reserve(limit);
|
||||
|
|
@ -1536,7 +1551,9 @@ order_book database_api::get_order_book( const string& base, const string& quote
|
|||
order_book database_api_impl::get_order_book( const string& base, const string& quote, unsigned limit )const
|
||||
{
|
||||
using boost::multiprecision::uint128_t;
|
||||
FC_ASSERT( limit <= 50 );
|
||||
FC_ASSERT( limit <= api_limit_get_order_book,
|
||||
"Number of querying accounts can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_get_order_book) );
|
||||
|
||||
order_book result;
|
||||
result.base = base;
|
||||
|
|
@ -1598,7 +1615,9 @@ vector<market_trade> database_api_impl::get_trade_history( const string& base,
|
|||
fc::time_point_sec stop,
|
||||
unsigned limit )const
|
||||
{
|
||||
FC_ASSERT( limit <= 100 );
|
||||
FC_ASSERT( limit <= api_limit_get_trade_history,
|
||||
"Number of querying accounts can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_get_trade_history) );
|
||||
|
||||
auto assets = lookup_asset_symbols( {base, quote} );
|
||||
FC_ASSERT( assets[0], "Invalid base asset symbol: ${s}", ("s",base) );
|
||||
|
|
@ -1717,7 +1736,9 @@ map<string, witness_id_type> database_api::lookup_witness_accounts(const string&
|
|||
|
||||
map<string, witness_id_type> database_api_impl::lookup_witness_accounts(const string& lower_bound_name, uint32_t limit)const
|
||||
{
|
||||
FC_ASSERT( limit <= 1000 );
|
||||
FC_ASSERT( limit <= api_limit_lookup_witness_accounts,
|
||||
"Number of querying accounts can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_lookup_witness_accounts) );
|
||||
const auto& witnesses_by_id = _db.get_index_type<witness_index>().indices().get<by_id>();
|
||||
|
||||
// we want to order witnesses by account name, but that name is in the account object
|
||||
|
|
@ -1793,7 +1814,9 @@ map<string, committee_member_id_type> database_api::lookup_committee_member_acco
|
|||
|
||||
map<string, committee_member_id_type> database_api_impl::lookup_committee_member_accounts(const string& lower_bound_name, uint32_t limit)const
|
||||
{
|
||||
FC_ASSERT( limit <= 1000 );
|
||||
FC_ASSERT( limit <= api_limit_lookup_committee_member_accounts,
|
||||
"Number of querying accounts can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_lookup_committee_member_accounts) );
|
||||
const auto& committee_members_by_id = _db.get_index_type<committee_member_index>().indices().get<by_id>();
|
||||
|
||||
// we want to order committee_members by account name, but that name is in the account object
|
||||
|
|
@ -2913,7 +2936,9 @@ vector<offer_object> database_api::list_offers(const offer_id_type lower_id, uin
|
|||
|
||||
vector<offer_object> database_api_impl::list_offers(const offer_id_type lower_id, uint32_t limit) const
|
||||
{
|
||||
FC_ASSERT( limit <= 100 );
|
||||
FC_ASSERT( limit <= api_limit_all_offers_count,
|
||||
"Number of querying offers can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_all_offers_count) );
|
||||
const auto& offers_idx = _db.get_index_type<offer_index>().indices().get<by_id>();
|
||||
vector<offer_object> result;
|
||||
result.reserve(limit);
|
||||
|
|
@ -2933,7 +2958,9 @@ vector<offer_object> database_api::list_sell_offers(const offer_id_type lower_id
|
|||
|
||||
vector<offer_object> database_api_impl::list_sell_offers(const offer_id_type lower_id, uint32_t limit) const
|
||||
{
|
||||
FC_ASSERT( limit <= 100 );
|
||||
FC_ASSERT( limit <= api_limit_all_offers_count,
|
||||
"Number of querying offers can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_all_offers_count) );
|
||||
const auto& offers_idx = _db.get_index_type<offer_index>().indices().get<by_id>();
|
||||
vector<offer_object> result;
|
||||
result.reserve(limit);
|
||||
|
|
@ -2959,7 +2986,9 @@ vector<offer_object> database_api::list_buy_offers(const offer_id_type lower_id,
|
|||
|
||||
vector<offer_object> database_api_impl::list_buy_offers(const offer_id_type lower_id, uint32_t limit) const
|
||||
{
|
||||
FC_ASSERT( limit <= 100 );
|
||||
FC_ASSERT( limit <= api_limit_all_offers_count,
|
||||
"Number of querying offers can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_all_offers_count) );
|
||||
const auto& offers_idx = _db.get_index_type<offer_index>().indices().get<by_id>();
|
||||
vector<offer_object> result;
|
||||
result.reserve(limit);
|
||||
|
|
@ -2986,7 +3015,9 @@ vector<offer_history_object> database_api::list_offer_history(const offer_histor
|
|||
|
||||
vector<offer_history_object> database_api_impl::list_offer_history(const offer_history_id_type lower_id, uint32_t limit) const
|
||||
{
|
||||
FC_ASSERT( limit <= 100 );
|
||||
FC_ASSERT( limit <= api_limit_all_offers_count,
|
||||
"Number of querying offers can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_all_offers_count) );
|
||||
const auto& oh_idx = _db.get_index_type<offer_history_index>().indices().get<by_id>();
|
||||
vector<offer_history_object> result;
|
||||
result.reserve(limit);
|
||||
|
|
@ -3006,7 +3037,9 @@ vector<offer_object> database_api::get_offers_by_issuer(const offer_id_type lowe
|
|||
|
||||
vector<offer_object> database_api_impl::get_offers_by_issuer(const offer_id_type lower_id, const account_id_type issuer_account_id, uint32_t limit) const
|
||||
{
|
||||
FC_ASSERT( limit <= 100 );
|
||||
FC_ASSERT( limit <= api_limit_all_offers_count,
|
||||
"Number of querying offers can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_all_offers_count) );
|
||||
const auto& offers_idx = _db.get_index_type<offer_index>().indices().get<by_id>();
|
||||
vector<offer_object> result;
|
||||
result.reserve(limit);
|
||||
|
|
@ -3030,7 +3063,9 @@ vector<offer_object> database_api::get_offers_by_item(const offer_id_type lower_
|
|||
|
||||
vector<offer_object> database_api_impl::get_offers_by_item(const offer_id_type lower_id, const nft_id_type item, uint32_t limit) const
|
||||
{
|
||||
FC_ASSERT( limit <= 100 );
|
||||
FC_ASSERT( limit <= api_limit_all_offers_count,
|
||||
"Number of querying offers can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_all_offers_count) );
|
||||
const auto& offers_idx = _db.get_index_type<offer_index>().indices().get<by_id>();
|
||||
vector<offer_object> result;
|
||||
result.reserve(limit);
|
||||
|
|
@ -3065,7 +3100,9 @@ vector<offer_history_object> database_api::get_offer_history_by_bidder(const off
|
|||
|
||||
vector<offer_history_object> database_api_impl::get_offer_history_by_issuer(const offer_history_id_type lower_id, const account_id_type issuer_account_id, uint32_t limit) const
|
||||
{
|
||||
FC_ASSERT( limit <= 100 );
|
||||
FC_ASSERT( limit <= api_limit_all_offers_count,
|
||||
"Number of querying offers can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_all_offers_count) );
|
||||
const auto& oh_idx = _db.get_index_type<offer_history_index>().indices().get<by_id>();
|
||||
vector<offer_history_object> result;
|
||||
result.reserve(limit);
|
||||
|
|
@ -3086,7 +3123,9 @@ vector<offer_history_object> database_api_impl::get_offer_history_by_issuer(cons
|
|||
|
||||
vector<offer_history_object> database_api_impl::get_offer_history_by_item(const offer_history_id_type lower_id, const nft_id_type item, uint32_t limit) const
|
||||
{
|
||||
FC_ASSERT( limit <= 100 );
|
||||
FC_ASSERT( limit <= api_limit_all_offers_count,
|
||||
"Number of querying offers can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_all_offers_count) );
|
||||
const auto& oh_idx = _db.get_index_type<offer_history_index>().indices().get<by_id>();
|
||||
vector<offer_history_object> result;
|
||||
result.reserve(limit);
|
||||
|
|
@ -3108,7 +3147,9 @@ vector<offer_history_object> database_api_impl::get_offer_history_by_item(const
|
|||
|
||||
vector<offer_history_object> database_api_impl::get_offer_history_by_bidder(const offer_history_id_type lower_id, const account_id_type bidder_account_id, uint32_t limit) const
|
||||
{
|
||||
FC_ASSERT( limit <= 100 );
|
||||
FC_ASSERT( limit <= api_limit_all_offers_count,
|
||||
"Number of querying offers can not be greater than ${configured_limit}",
|
||||
("configured_limit", api_limit_all_offers_count) );
|
||||
const auto& oh_idx = _db.get_index_type<offer_history_index>().indices().get<by_id>();
|
||||
vector<offer_history_object> result;
|
||||
result.reserve(limit);
|
||||
|
|
|
|||
|
|
@ -150,6 +150,9 @@ namespace graphene { namespace app {
|
|||
fc::time_point_sec start, fc::time_point_sec end )const;
|
||||
vector<account_balance_object> list_core_accounts()const;
|
||||
flat_set<uint32_t> get_market_history_buckets()const;
|
||||
uint32_t api_limit_get_account_history_operations = 100;
|
||||
uint32_t api_limit_get_account_history = 100;
|
||||
uint32_t api_limit_get_relative_account_history = 100;
|
||||
private:
|
||||
application& _app;
|
||||
graphene::app::database_api database_api;
|
||||
|
|
@ -354,6 +357,7 @@ namespace graphene { namespace app {
|
|||
*/
|
||||
vector<asset_holders> get_all_asset_holders() const;
|
||||
|
||||
uint32_t api_limit_get_asset_holders = 100;
|
||||
private:
|
||||
graphene::app::application& _app;
|
||||
graphene::chain::database& _db;
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ add_library( graphene_chain
|
|||
protocol/assert.cpp
|
||||
protocol/account.cpp
|
||||
protocol/transfer.cpp
|
||||
protocol/chain_parameters.cpp
|
||||
protocol/committee_member.cpp
|
||||
protocol/witness.cpp
|
||||
protocol/market.cpp
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <graphene/chain/account_evaluator.hpp>
|
||||
#include <graphene/chain/buyback.hpp>
|
||||
#include <graphene/chain/buyback_object.hpp>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
#define DEFAULT_LOGGER "betting"
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <graphene/chain/betting_market_evaluator.hpp>
|
||||
#include <graphene/chain/betting_market_object.hpp>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
#include <graphene/chain/block_database.hpp>
|
||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
||||
#include <fc/io/raw.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
namespace graphene { namespace chain {
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@
|
|||
#include <graphene/chain/protocol/vote.hpp>
|
||||
#include <graphene/chain/transaction_evaluation_state.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
namespace graphene { namespace chain {
|
||||
|
||||
void_result committee_member_create_evaluator::do_evaluate( const committee_member_create_operation& op )
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@
|
|||
#include <graphene/chain/fba_accumulator_id.hpp>
|
||||
#include <graphene/chain/hardfork.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
namespace graphene { namespace chain {
|
||||
|
||||
void_result transfer_to_blind_evaluator::do_evaluate( const transfer_to_blind_operation& o )
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include "db_balance.cpp"
|
||||
#include "db_bet.cpp"
|
||||
#include "db_block.cpp"
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@
|
|||
#include <graphene/chain/witness_schedule_object.hpp>
|
||||
#include <fc/crypto/digest.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
namespace {
|
||||
|
||||
|
|
|
|||
|
|
@ -34,8 +34,6 @@
|
|||
#include <graphene/chain/son_object.hpp>
|
||||
#include <graphene/chain/son_proposal_object.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <ctime>
|
||||
#include <algorithm>
|
||||
|
||||
|
|
@ -68,7 +66,7 @@ const dynamic_global_property_object& database::get_dynamic_global_properties()
|
|||
|
||||
const fee_schedule& database::current_fee_schedule()const
|
||||
{
|
||||
return get_global_properties().parameters.current_fees;
|
||||
return std::ref( *get_global_properties().parameters.current_fees );
|
||||
}
|
||||
|
||||
time_point_sec database::head_block_time()const
|
||||
|
|
|
|||
|
|
@ -104,7 +104,6 @@
|
|||
|
||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <fc/uint128.hpp>
|
||||
#include <fc/crypto/digest.hpp>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
#include <boost/multiprecision/integer.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <fc/uint128.hpp>
|
||||
|
||||
#include <graphene/chain/database.hpp>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
#include <graphene/chain/fork_database.hpp>
|
||||
#include <graphene/chain/exceptions.hpp>
|
||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
namespace graphene { namespace chain {
|
||||
fork_database::fork_database()
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
#include <graphene/chain/genesis_state.hpp>
|
||||
|
||||
// these are required to serialize a genesis_state
|
||||
#include <fc/smart_ref_impl.hpp> // required for gcc in release mode
|
||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
||||
|
||||
namespace graphene { namespace chain {
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
#pragma once
|
||||
#include <memory>
|
||||
#include <graphene/chain/protocol/base.hpp>
|
||||
#include <graphene/chain/protocol/ext.hpp>
|
||||
#include <graphene/chain/protocol/types.hpp>
|
||||
#include <fc/smart_ref_fwd.hpp>
|
||||
|
||||
#include <graphene/chain/hardfork.hpp>
|
||||
#include <../hardfork.d/GPOS.hf>
|
||||
|
|
@ -72,8 +72,13 @@ namespace graphene { namespace chain {
|
|||
|
||||
struct chain_parameters
|
||||
{
|
||||
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);
|
||||
/** using a smart ref breaks the circular dependency created between operations and the fee schedule */
|
||||
smart_ref<fee_schedule> current_fees; ///< current schedule of fees
|
||||
std::shared_ptr<fee_schedule> current_fees; ///< current schedule of 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
|
||||
|
|
@ -207,6 +212,8 @@ namespace graphene { namespace chain {
|
|||
inline uint16_t maximum_son_count()const {
|
||||
return extensions.value.maximum_son_count.valid() ? *extensions.value.maximum_son_count : GRAPHENE_DEFAULT_MAX_SONS;
|
||||
}
|
||||
private:
|
||||
static void safe_copy(chain_parameters& to, const chain_parameters& from);
|
||||
};
|
||||
|
||||
} } // graphene::chain
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
#pragma once
|
||||
#include <fc/smart_ref_fwd.hpp>
|
||||
#include <graphene/chain/protocol/operations.hpp>
|
||||
|
||||
namespace graphene { namespace chain {
|
||||
|
|
@ -84,6 +83,10 @@ namespace graphene { namespace chain {
|
|||
|
||||
} } // graphene::chain
|
||||
|
||||
namespace fc {
|
||||
template<> struct get_typename<std::shared_ptr<graphene::chain::fee_schedule>> { static const char* name() { return "shared_ptr<fee_schedule>"; } };
|
||||
}
|
||||
|
||||
FC_REFLECT_TYPENAME( graphene::chain::fee_parameters )
|
||||
FC_REFLECT( graphene::chain::fee_schedule, (parameters)(scale) )
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@
|
|||
#include <fc/io/raw_fwd.hpp>
|
||||
#include <fc/uint128.hpp>
|
||||
#include <fc/static_variant.hpp>
|
||||
#include <fc/smart_ref_fwd.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <graphene/chain/protocol/market.hpp>
|
||||
|
||||
#include <fc/uint128.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
namespace graphene { namespace chain {
|
||||
void_result limit_order_create_evaluator::do_evaluate(const limit_order_create_operation& op)
|
||||
|
|
|
|||
|
|
@ -32,8 +32,6 @@
|
|||
#include <graphene/chain/exceptions.hpp>
|
||||
#include <graphene/chain/hardfork.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
namespace graphene { namespace chain {
|
||||
|
||||
struct proposal_operation_hardfork_visitor
|
||||
|
|
|
|||
92
libraries/chain/protocol/chain_parameters.cpp
Normal file
92
libraries/chain/protocol/chain_parameters.cpp
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
#include <graphene/chain/protocol/chain_parameters.hpp>
|
||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
||||
|
||||
namespace graphene { namespace chain {
|
||||
chain_parameters::chain_parameters() {
|
||||
current_fees = std::make_shared<fee_schedule>();
|
||||
}
|
||||
|
||||
// copy constructor
|
||||
chain_parameters::chain_parameters(const chain_parameters& other)
|
||||
{
|
||||
current_fees = std::make_shared<fee_schedule>(*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<fee_schedule>(*other.current_fees);
|
||||
safe_copy(*this, other);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// copies the easy stuff
|
||||
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_witness_count = from.maximum_witness_count;
|
||||
to.maximum_committee_count = from.maximum_committee_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.witness_pay_per_block = from.witness_pay_per_block;
|
||||
to.witness_pay_vesting_seconds = from.witness_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.witness_schedule_algorithm= from.witness_schedule_algorithm;
|
||||
to.min_round_delay = from.min_round_delay;
|
||||
to.max_round_delay = from.max_round_delay;
|
||||
to.min_time_per_commit_move = from.min_time_per_commit_move;
|
||||
to.max_time_per_commit_move = from.max_time_per_commit_move;
|
||||
to.min_time_per_reveal_move = from.min_time_per_reveal_move;
|
||||
to.max_time_per_reveal_move = from.max_time_per_reveal_move;
|
||||
to.rake_fee_percentage = from.rake_fee_percentage;
|
||||
to.maximum_registration_deadline = from.maximum_registration_deadline;
|
||||
to.maximum_players_in_tournament = from.maximum_players_in_tournament;
|
||||
to.maximum_tournament_whitelist_length = from.maximum_tournament_whitelist_length;
|
||||
to.maximum_tournament_start_time_in_future= from.maximum_tournament_start_time_in_future;
|
||||
to.maximum_tournament_start_delay = from.maximum_tournament_start_delay;
|
||||
to.maximum_tournament_number_of_wins = from.maximum_tournament_number_of_wins;
|
||||
to.extensions = from.extensions;
|
||||
}
|
||||
|
||||
// move constructor
|
||||
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;
|
||||
}
|
||||
}}
|
||||
|
|
@ -21,7 +21,6 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
||||
#include <graphene/chain/protocol/committee_member.hpp>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,17 +23,6 @@
|
|||
*/
|
||||
#include <algorithm>
|
||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
namespace fc
|
||||
{
|
||||
// explicitly instantiate the smart_ref, gcc fails to instantiate it in some release builds
|
||||
//template graphene::chain::fee_schedule& smart_ref<graphene::chain::fee_schedule>::operator=(smart_ref<graphene::chain::fee_schedule>&&);
|
||||
//template graphene::chain::fee_schedule& smart_ref<graphene::chain::fee_schedule>::operator=(U&&);
|
||||
//template graphene::chain::fee_schedule& smart_ref<graphene::chain::fee_schedule>::operator=(const smart_ref&);
|
||||
//template smart_ref<graphene::chain::fee_schedule>::smart_ref();
|
||||
//template const graphene::chain::fee_schedule& smart_ref<graphene::chain::fee_schedule>::operator*() const;
|
||||
}
|
||||
|
||||
#include <fc/io/raw.hpp>
|
||||
|
||||
|
|
@ -41,10 +30,6 @@ namespace fc
|
|||
|
||||
namespace graphene { namespace chain {
|
||||
|
||||
typedef fc::smart_ref<fee_schedule> smart_fee_schedule;
|
||||
|
||||
static smart_fee_schedule tmp;
|
||||
|
||||
fee_schedule::fee_schedule()
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <graphene/chain/protocol/operations.hpp>
|
||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
||||
#include <fc/io/raw.hpp>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
*/
|
||||
#include <graphene/chain/protocol/operations.hpp>
|
||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <fc/io/raw.hpp>
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <graphene/chain/protocol/balance.hpp>
|
||||
#include <graphene/chain/protocol/buyback.hpp>
|
||||
#include <graphene/chain/protocol/fba.hpp>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
||||
#include <fc/io/raw.hpp>
|
||||
#include <fc/bitutil.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <algorithm>
|
||||
#include <fc/io/raw.hpp>
|
||||
|
||||
|
|
@ -106,6 +105,7 @@ void transaction::get_required_authorities( flat_set<account_id_type>& active,
|
|||
|
||||
|
||||
|
||||
const flat_set<public_key_type> empty_keyset;
|
||||
|
||||
struct sign_state
|
||||
{
|
||||
|
|
@ -231,7 +231,7 @@ struct sign_state
|
|||
|
||||
sign_state( const flat_set<public_key_type>& sigs,
|
||||
const std::function<const authority*(account_id_type)>& a,
|
||||
const flat_set<public_key_type>& keys = flat_set<public_key_type>() )
|
||||
const flat_set<public_key_type>& keys = empty_keyset )
|
||||
:get_active(a),available_keys(keys)
|
||||
{
|
||||
for( const auto& key : sigs )
|
||||
|
|
@ -446,7 +446,7 @@ void signed_transaction::verify_authority(
|
|||
bool ignore_custom_operation_required_auths,
|
||||
uint32_t max_recursion )const
|
||||
{ try {
|
||||
graphene::chain::verify_authority( operations, get_signature_keys( chain_id ), get_active, get_owner, get_custom, max_recursion );
|
||||
graphene::chain::verify_authority( operations, get_signature_keys( chain_id ), get_active, get_owner, get_custom, ignore_custom_operation_required_auths, max_recursion );
|
||||
} FC_CAPTURE_AND_RETHROW( (*this) ) }
|
||||
|
||||
} } // graphene::chain
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@
|
|||
#include <graphene/chain/worker_object.hpp>
|
||||
|
||||
#include <fc/io/raw.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::balance_object )
|
||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::block_summary_object )
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ namespace graphene { namespace chain {
|
|||
[&m, &exc](ObjectType& o) mutable {
|
||||
try {
|
||||
m(o);
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception& e) {
|
||||
exc = std::current_exception();
|
||||
elog("Exception while modifying object: ${e} -- object may be corrupted",
|
||||
("e", e));
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#include <fc/filesystem.hpp>
|
||||
#include <fc/smart_ref_impl.hpp> // required for gcc in release mode
|
||||
#include <fc/string.hpp>
|
||||
#include <fc/io/fstream.hpp>
|
||||
#include <fc/io/json.hpp>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit fb27454cdf1626e5e108e42848bd1bcfe60c9540
|
||||
Subproject commit 0e9259486cb04a90ec709750143cc5be1da474ff
|
||||
|
|
@ -70,7 +70,6 @@
|
|||
#include <fc/crypto/rand.hpp>
|
||||
#include <fc/network/rate_limiting.hpp>
|
||||
#include <fc/network/ip.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <graphene/net/node.hpp>
|
||||
#include <graphene/net/peer_database.hpp>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <graphene/chain/transaction_evaluation_state.hpp>
|
||||
#include <graphene/chain/hardfork.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <fc/thread/thread.hpp>
|
||||
|
||||
namespace graphene { namespace account_history {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include <graphene/chain/operation_history_object.hpp>
|
||||
#include <graphene/chain/transaction_evaluation_state.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <fc/thread/thread.hpp>
|
||||
|
||||
namespace graphene { namespace accounts_list {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
#include <fc/optional.hpp>
|
||||
#include <fc/variant_object.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <graphene/app/application.hpp>
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <graphene/chain/operation_history_object.hpp>
|
||||
#include <graphene/chain/transaction_evaluation_state.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <fc/thread/thread.hpp>
|
||||
|
||||
namespace graphene { namespace affiliate_stats {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
#include <fc/filesystem.hpp>
|
||||
#include <fc/optional.hpp>
|
||||
#include <fc/variant_object.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <graphene/app/application.hpp>
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@
|
|||
|
||||
#include <boost/algorithm/string/case_conv.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <fc/thread/thread.hpp>
|
||||
|
||||
#include <boost/polymorphic_cast.hpp>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
#include <fc/filesystem.hpp>
|
||||
#include <fc/optional.hpp>
|
||||
#include <fc/variant_object.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <graphene/app/application.hpp>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
#include <graphene/utilities/key_conversion.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <fc/thread/thread.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@
|
|||
#include <fc/network/http/websocket.hpp>
|
||||
#include <fc/rpc/websocket_api.hpp>
|
||||
#include <fc/api.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
|
||||
namespace graphene { namespace delayed_node {
|
||||
namespace bpo = boost::program_options;
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@
|
|||
|
||||
#include <graphene/es_objects/es_objects.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <graphene/chain/proposal_object.hpp>
|
||||
#include <graphene/chain/balance_object.hpp>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
|
||||
#include <graphene/utilities/key_conversion.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <fc/thread/thread.hpp>
|
||||
|
||||
#include <graphene/chain/market_object.hpp>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
|
||||
#include <graphene/utilities/key_conversion.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <fc/thread/thread.hpp>
|
||||
|
||||
#include <graphene/chain/market_object.hpp>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
||||
|
||||
#include <fc/thread/thread.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
namespace graphene { namespace market_history {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include <fc/crypto/base58.hpp>
|
||||
#include <fc/crypto/sha256.hpp>
|
||||
#include <graphene/peerplays_sidechain/bitcoin/bitcoin_address.hpp>
|
||||
#include <graphene/peerplays_sidechain/bitcoin/bitcoin_script.hpp>
|
||||
#include <graphene/peerplays_sidechain/bitcoin/segwit_addr.hpp>
|
||||
|
|
@ -99,7 +100,7 @@ bool bitcoin_address::is_p2pk() const {
|
|||
parse_hex(address);
|
||||
return true;
|
||||
}
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -121,7 +122,7 @@ bool bitcoin_address::is_p2pkh() const {
|
|||
return true;
|
||||
}
|
||||
return false;
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -134,7 +135,7 @@ bool bitcoin_address::is_p2sh() const {
|
|||
return true;
|
||||
}
|
||||
return false;
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -269,7 +270,7 @@ void btc_weighted_multisig_address::create_redeem_script(const std::vector<std::
|
|||
|
||||
redeem_script_ = builder;
|
||||
|
||||
fc::sha256 sh = fc::sha256::hash(redeem_script_);
|
||||
fc::sha256 sh = fc::sha256::hash(redeem_script_.data(), redeem_script_.size());
|
||||
raw_address = bytes(sh.data(), sh.data() + sh.data_size());
|
||||
}
|
||||
|
||||
|
|
@ -323,7 +324,7 @@ void btc_one_or_m_of_n_multisig_address::create_redeem_script(const fc::ecc::pub
|
|||
builder << op::CHECKMULTISIG;
|
||||
builder << op::ENDIF;
|
||||
redeem_script_ = builder;
|
||||
fc::sha256 sh = fc::sha256::hash(redeem_script_);
|
||||
fc::sha256 sh = fc::sha256::hash(redeem_script_.data(), redeem_script_.size());
|
||||
raw_address = bytes(sh.data(), sh.data() + sh.data_size());
|
||||
}
|
||||
void btc_one_or_m_of_n_multisig_address::create_witness_script() {
|
||||
|
|
@ -384,7 +385,7 @@ void btc_one_or_weighted_multisig_address::create_redeem_script(const fc::ecc::p
|
|||
builder << op::GREATERTHANOREQUAL;
|
||||
builder << op::ENDIF;
|
||||
redeem_script_ = builder;
|
||||
fc::sha256 sh = fc::sha256::hash(redeem_script_);
|
||||
fc::sha256 sh = fc::sha256::hash(redeem_script_.data(), redeem_script_.size());
|
||||
raw_address = bytes(sh.data(), sh.data() + sh.data_size());
|
||||
}
|
||||
|
||||
|
|
@ -448,7 +449,7 @@ void btc_timelocked_one_or_weighted_multisig_address::create_redeem_script(const
|
|||
builder << op::GREATERTHANOREQUAL;
|
||||
builder << op::ENDIF;
|
||||
redeem_script_ = builder;
|
||||
fc::sha256 sh = fc::sha256::hash(redeem_script_);
|
||||
fc::sha256 sh = fc::sha256::hash(redeem_script_.data(), redeem_script_.size());
|
||||
raw_address = bytes(sh.data(), sh.data() + sh.data_size());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@
|
|||
#include <boost/range/algorithm_ext/insert.hpp>
|
||||
|
||||
#include <fc/log/logger.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <graphene/chain/proposal_object.hpp>
|
||||
#include <graphene/chain/protocol/transfer.hpp>
|
||||
#include <graphene/chain/sidechain_address_object.hpp>
|
||||
|
|
@ -356,7 +354,7 @@ void peerplays_sidechain_plugin_impl::heartbeat_loop() {
|
|||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
return true;
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending heartbeat failed with exception ${e}", ("e", e.what()));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -468,7 +466,7 @@ void peerplays_sidechain_plugin_impl::approve_proposals() {
|
|||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
return true;
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending approval failed with exception ${e}", ("e", e.what()));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -544,7 +542,7 @@ void peerplays_sidechain_plugin_impl::create_son_down_proposals() {
|
|||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
return true;
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending son down proposal failed with exception ${e}", ("e", e.what()));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -579,7 +577,7 @@ void peerplays_sidechain_plugin_impl::create_son_deregister_proposals() {
|
|||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
return true;
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending son deregister proposal failed with exception ${e}", ("e", e.what()));
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#include <graphene/peerplays_sidechain/sidechain_net_handler.hpp>
|
||||
|
||||
#include <fc/log/logger.hpp>
|
||||
#include <fc/smart_ref_fwd.hpp>
|
||||
#include <graphene/chain/chain_property_object.hpp>
|
||||
#include <graphene/chain/proposal_object.hpp>
|
||||
|
||||
|
|
@ -138,7 +137,7 @@ bool sidechain_net_handler::approve_proposal(const proposal_id_type &proposal_id
|
|||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
return true;
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending approval from ${son_id} for proposal ${proposal_id} failed with exception ${e}",
|
||||
("son_id", son_id)("proposal_id", proposal_id)("e", e.what()));
|
||||
return false;
|
||||
|
|
@ -205,7 +204,7 @@ void sidechain_net_handler::sidechain_event_data_received(const sidechain_event_
|
|||
database.push_transaction(trx, database::validation_steps::skip_block_size_check);
|
||||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending son wallet deposit create operation by ${son} failed with exception ${e}", ("son", son_id)("e", e.what()));
|
||||
}
|
||||
}
|
||||
|
|
@ -247,7 +246,7 @@ void sidechain_net_handler::sidechain_event_data_received(const sidechain_event_
|
|||
database.push_transaction(trx, database::validation_steps::skip_block_size_check);
|
||||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending son wallet withdraw create operation by ${son} failed with exception ${e}", ("son", son_id)("e", e.what()));
|
||||
}
|
||||
}
|
||||
|
|
@ -460,7 +459,7 @@ void sidechain_net_handler::process_sidechain_transactions() {
|
|||
database.push_transaction(trx, database::validation_steps::skip_block_size_check);
|
||||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending proposal for sidechain transaction sign operation failed with exception ${e}", ("e", e.what()));
|
||||
}
|
||||
});
|
||||
|
|
@ -495,7 +494,7 @@ void sidechain_net_handler::send_sidechain_transactions() {
|
|||
database.push_transaction(trx, database::validation_steps::skip_block_size_check);
|
||||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending proposal for sidechain transaction send operation failed with exception ${e}", ("e", e.what()));
|
||||
}
|
||||
});
|
||||
|
|
@ -560,7 +559,7 @@ void sidechain_net_handler::settle_sidechain_transactions() {
|
|||
database.push_transaction(trx, database::validation_steps::skip_block_size_check);
|
||||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending proposal for sidechain transaction settle operation failed with exception ${e}", ("e", e.what()));
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -940,7 +940,7 @@ sidechain_net_handler_bitcoin::sidechain_net_handler_bitcoin(peerplays_sidechain
|
|||
fc::http::connection conn;
|
||||
try {
|
||||
conn.connect_to(fc::ip::endpoint(fc::ip::address(ip), rpc_port));
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("No BTC node running at ${ip} or wrong rpc port: ${port}", ("ip", ip)("port", rpc_port));
|
||||
FC_ASSERT(false);
|
||||
}
|
||||
|
|
@ -1324,7 +1324,7 @@ void sidechain_net_handler_bitcoin::process_primary_wallet() {
|
|||
database.push_transaction(trx, database::validation_steps::skip_block_size_check);
|
||||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending proposal for son wallet update operation failed with exception ${e}", ("e", e.what()));
|
||||
return;
|
||||
}
|
||||
|
|
@ -1375,7 +1375,7 @@ void sidechain_net_handler_bitcoin::process_sidechain_addresses() {
|
|||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
return true;
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending proposal for deposit sidechain transaction create operation failed with exception ${e}", ("e", e.what()));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1420,7 +1420,7 @@ bool sidechain_net_handler_bitcoin::process_deposit(const son_wallet_deposit_obj
|
|||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
return true;
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending proposal for deposit sidechain transaction create operation failed with exception ${e}", ("e", e.what()));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1464,7 +1464,7 @@ bool sidechain_net_handler_bitcoin::process_withdrawal(const son_wallet_withdraw
|
|||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
return true;
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending proposal for withdraw sidechain transaction create operation failed with exception ${e}", ("e", e.what()));
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,10 @@
|
|||
#include <fc/crypto/hex.hpp>
|
||||
#include <fc/log/logger.hpp>
|
||||
#include <fc/network/ip.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <graphene/chain/account_object.hpp>
|
||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
||||
#include <graphene/chain/protocol/son_wallet.hpp>
|
||||
#include <graphene/chain/son_info.hpp>
|
||||
#include <graphene/chain/son_wallet_object.hpp>
|
||||
|
|
@ -149,7 +151,7 @@ void sidechain_net_handler_peerplays::process_sidechain_addresses() {
|
|||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
return true;
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending transaction for update deposit address operation failed with exception ${e}", ("e", e.what()));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -203,7 +205,7 @@ bool sidechain_net_handler_peerplays::process_deposit(const son_wallet_deposit_o
|
|||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
return true;
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sending proposal for deposit sidechain transaction create operation failed with exception ${e}", ("e", e.what()));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -254,7 +256,7 @@ std::string sidechain_net_handler_peerplays::send_sidechain_transaction(const si
|
|||
if (plugin.app().p2p_node())
|
||||
plugin.app().p2p_node()->broadcast(net::trx_message(trx));
|
||||
return trx.id().str();
|
||||
} catch (fc::exception e) {
|
||||
} catch (fc::exception &e) {
|
||||
elog("Sidechain transaction failed with exception ${e}", ("e", e.what()));
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include <boost/range/algorithm_ext/insert.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <fc/thread/thread.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
|
|
|||
|
|
@ -84,7 +84,6 @@
|
|||
#include <graphene/wallet/api_documentation.hpp>
|
||||
#include <graphene/wallet/reflect_util.hpp>
|
||||
#include <graphene/debug_witness/debug_api.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#ifndef WIN32
|
||||
# include <sys/types.h>
|
||||
|
|
@ -662,10 +661,10 @@ public:
|
|||
return ob.template as<T>( GRAPHENE_MAX_NESTED_OBJECTS );
|
||||
}
|
||||
|
||||
void set_operation_fees( signed_transaction& tx, const fee_schedule& s )
|
||||
void set_operation_fees( signed_transaction& tx, std::shared_ptr<fee_schedule> s )
|
||||
{
|
||||
for( auto& op : tx.operations )
|
||||
s.set_fee(op);
|
||||
s->set_fee(op);
|
||||
}
|
||||
|
||||
variant info() const
|
||||
|
|
@ -1307,8 +1306,7 @@ public:
|
|||
|
||||
tx.operations.push_back( account_create_op );
|
||||
|
||||
auto current_fees = _remote_db->get_global_properties().parameters.current_fees;
|
||||
set_operation_fees( tx, current_fees );
|
||||
set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees );
|
||||
|
||||
vector<public_key_type> paying_keys = registrar_account_object.active.get_keys();
|
||||
|
||||
|
|
@ -3496,7 +3494,7 @@ public:
|
|||
new_fees.scale = scale;
|
||||
|
||||
chain_parameters new_params = current_params;
|
||||
new_params.current_fees = new_fees;
|
||||
new_params.current_fees = std::make_shared<fee_schedule>(new_fees);
|
||||
|
||||
committee_member_update_global_parameters_operation update_op;
|
||||
update_op.new_parameters = new_params;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
#include <graphene/chain/account_object.hpp>
|
||||
#include <graphene/chain/balance_object.hpp>
|
||||
#include <graphene/chain/committee_member_object.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <iostream>
|
||||
|
||||
using namespace graphene::chain;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include <fc/rpc/cli.hpp>
|
||||
#include <fc/rpc/http_api.hpp>
|
||||
#include <fc/rpc/websocket_api.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <graphene/app/api.hpp>
|
||||
#include <graphene/chain/config.hpp>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <fc/io/fstream.hpp>
|
||||
#include <fc/io/json.hpp>
|
||||
#include <fc/io/stdio.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <graphene/app/api.hpp>
|
||||
#include <graphene/chain/protocol/address.hpp>
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@
|
|||
#include <graphene/chain/sidechain_address_object.hpp>
|
||||
#include <graphene/chain/sidechain_transaction_object.hpp>
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <iostream>
|
||||
|
||||
using namespace graphene::chain;
|
||||
|
|
@ -128,7 +127,6 @@ struct js_name<fc::array<T,N>>
|
|||
template<size_t N> struct js_name<fc::array<char,N>> { static std::string name(){ return "bytes "+ fc::to_string(N); }; };
|
||||
template<size_t N> struct js_name<fc::array<uint8_t,N>> { static std::string name(){ return "bytes "+ fc::to_string(N); }; };
|
||||
template<typename T> struct js_name< fc::optional<T> > { static std::string name(){ return "optional " + js_name<T>::name(); } };
|
||||
template<typename T> struct js_name< fc::smart_ref<T> > { static std::string name(){ return js_name<T>::name(); } };
|
||||
template<> struct js_name< object_id_type > { static std::string name(){ return "object_id_type"; } };
|
||||
template<typename T> struct js_name< fc::flat_set<T> > { static std::string name(){ return "set " + js_name<T>::name(); } };
|
||||
template<typename T> struct js_name< std::vector<T> > { static std::string name(){ return "array " + js_name<T>::name(); } };
|
||||
|
|
@ -256,14 +254,6 @@ struct serializer<std::vector<T>,false>
|
|||
static void generate() {}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct serializer<fc::smart_ref<T>,false>
|
||||
{
|
||||
static void init() {
|
||||
serializer<T>::init(); }
|
||||
static void generate() {}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct serializer<std::vector<operation>,false>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
*/
|
||||
|
||||
#include <fc/io/json.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <fc/variant.hpp>
|
||||
#include <fc/variant_object.hpp>
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <graphene/affiliate_stats/affiliate_stats_plugin.hpp>
|
||||
#include <graphene/market_history/market_history_plugin.hpp>
|
||||
#include <fc/thread/thread.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <boost/filesystem/path.hpp>
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
#include <graphene/utilities/tempdir.hpp>
|
||||
|
||||
#include <fc/crypto/digest.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
|
||||
|
|
|
|||
|
|
@ -1877,10 +1877,11 @@ BOOST_AUTO_TEST_CASE(event_group_delete_test_not_existed_event_group)
|
|||
try
|
||||
{
|
||||
CREATE_ICE_HOCKEY_BETTING_MARKET(false, 0);
|
||||
event_group_id_type nhl_id = nhl.id;
|
||||
delete_event_group(nhl_id);
|
||||
|
||||
delete_event_group(nhl.id);
|
||||
|
||||
BOOST_CHECK_THROW(delete_event_group(nhl.id), fc::exception);
|
||||
BOOST_CHECK_THROW(delete_event_group(nhl_id), fc::exception);
|
||||
} FC_LOG_AND_RETHROW()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
#include <fc/crypto/base58.hpp>
|
||||
|
||||
#include <fc/crypto/aes.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef _WIN32_WINNT
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
#include "cli_fixture.hpp"
|
||||
|
||||
#include <fc/crypto/aes.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <graphene/utilities/tempdir.hpp>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
*/
|
||||
#include "cli_fixture.hpp"
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <fc/string.hpp>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@
|
|||
#include <graphene/utilities/tempdir.hpp>
|
||||
|
||||
#include <fc/crypto/digest.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
|
|
@ -721,7 +720,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.current_fees = std::make_shared<fee_schedule>(new_fees);
|
||||
|
||||
db.modify(db.get_global_properties(), [&](global_property_object& p) {
|
||||
p.parameters = new_chain_params;
|
||||
|
|
@ -1048,7 +1047,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.current_fees = std::make_shared<fee_schedule>(fee_schedule::get_default());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
#include <graphene/app/application.hpp>
|
||||
#include <graphene/chain/database.hpp>
|
||||
#include <fc/io/json.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <graphene/chain/operation_history_object.hpp>
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <fc/io/fstream.hpp>
|
||||
#include <fc/io/json.hpp>
|
||||
#include <fc/io/stdio.hpp>
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
|
||||
#include <graphene/app/api.hpp>
|
||||
#include <graphene/chain/protocol/protocol.hpp>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <fc/uint128.hpp>
|
||||
|
||||
#include <graphene/chain/hardfork.hpp>
|
||||
|
|
@ -334,7 +333,7 @@ BOOST_AUTO_TEST_CASE( cashback_test )
|
|||
upgrade_to_lifetime_member(rog_id);
|
||||
|
||||
BOOST_TEST_MESSAGE("Enable fees");
|
||||
const auto& fees = db.get_global_properties().parameters.current_fees;
|
||||
const auto& fees = *db.get_global_properties().parameters.current_fees;
|
||||
|
||||
#define CustomRegisterActor(actor_name, registrar_name, referrer_name, referrer_rate) \
|
||||
{ \
|
||||
|
|
@ -346,7 +345,7 @@ BOOST_AUTO_TEST_CASE( cashback_test )
|
|||
op.options.memo_key = actor_name ## _private_key.get_public_key(); \
|
||||
op.active = authority(1, public_key_type(actor_name ## _private_key.get_public_key()), 1); \
|
||||
op.owner = op.active; \
|
||||
op.fee = fees->calculate_fee(op); \
|
||||
op.fee = fees.calculate_fee(op); \
|
||||
trx.operations = {op}; \
|
||||
sign( trx, registrar_name ## _private_key ); \
|
||||
actor_name ## _id = PUSH_TX( db, trx ).operation_results.front().get<object_id_type>(); \
|
||||
|
|
@ -372,10 +371,10 @@ BOOST_AUTO_TEST_CASE( cashback_test )
|
|||
CustomAuditActor( pleb ); \
|
||||
}
|
||||
|
||||
int64_t reg_fee = fees->get< account_create_operation >().premium_fee;
|
||||
int64_t xfer_fee = fees->get< transfer_operation >().fee;
|
||||
int64_t upg_an_fee = fees->get< account_upgrade_operation >().membership_annual_fee;
|
||||
int64_t upg_lt_fee = fees->get< account_upgrade_operation >().membership_lifetime_fee;
|
||||
int64_t reg_fee = fees.get< account_create_operation >().premium_fee;
|
||||
int64_t xfer_fee = fees.get< transfer_operation >().fee;
|
||||
int64_t upg_an_fee = fees.get< account_upgrade_operation >().membership_annual_fee;
|
||||
int64_t upg_lt_fee = fees.get< account_upgrade_operation >().membership_lifetime_fee;
|
||||
// all percentages here are cut from whole pie!
|
||||
uint64_t network_pct = 20 * P1;
|
||||
uint64_t lt_pct = 375 * P100 / 1000;
|
||||
|
|
@ -582,7 +581,7 @@ BOOST_AUTO_TEST_CASE( account_create_fee_scaling )
|
|||
auto accounts_per_scale = db.get_global_properties().parameters.accounts_per_fee_scale;
|
||||
db.modify(global_property_id_type()(db), [](global_property_object& gpo)
|
||||
{
|
||||
gpo.parameters.current_fees = fee_schedule::get_default();
|
||||
gpo.parameters.current_fees = std::make_shared<fee_schedule>(fee_schedule::get_default());
|
||||
gpo.parameters.current_fees->get<account_create_operation>().basic_fee = 1;
|
||||
});
|
||||
|
||||
|
|
@ -1004,8 +1003,9 @@ BOOST_AUTO_TEST_CASE( issue_429_test )
|
|||
// make sure the database requires our fee to be nonzero
|
||||
enable_fees();
|
||||
|
||||
auto fees_to_pay = db.get_global_properties().parameters.current_fees->get<asset_create_operation>();
|
||||
|
||||
const auto& fees = *db.get_global_properties().parameters.current_fees;
|
||||
auto fees_to_pay = fees.get<asset_create_operation>();
|
||||
|
||||
{
|
||||
signed_transaction tx;
|
||||
asset_create_operation op;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include "../common/database_fixture.hpp"
|
||||
|
||||
#include <fc/smart_ref_impl.hpp>
|
||||
#include <fc/crypto/digest.hpp>
|
||||
|
||||
using namespace graphene::app;
|
||||
|
|
|
|||
Loading…
Reference in a new issue