Ref #1506: Isolate chain/protocol to its own library
This commit is contained in:
parent
d54cc47a4f
commit
14f627c014
183 changed files with 1686 additions and 1468 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,3 +1,5 @@
|
||||||
|
build*/
|
||||||
|
|
||||||
*.a
|
*.a
|
||||||
*.sw*
|
*.sw*
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,3 +8,4 @@ add_subdirectory( utilities )
|
||||||
add_subdirectory( app )
|
add_subdirectory( app )
|
||||||
add_subdirectory( plugins )
|
add_subdirectory( plugins )
|
||||||
add_subdirectory( wallet )
|
add_subdirectory( wallet )
|
||||||
|
add_subdirectory( protocol )
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
#include <graphene/chain/get_config.hpp>
|
#include <graphene/chain/get_config.hpp>
|
||||||
#include <graphene/utilities/key_conversion.hpp>
|
#include <graphene/utilities/key_conversion.hpp>
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
#include <graphene/chain/confidential_object.hpp>
|
#include <graphene/chain/confidential_object.hpp>
|
||||||
#include <graphene/chain/market_object.hpp>
|
#include <graphene/chain/market_object.hpp>
|
||||||
#include <graphene/chain/transaction_object.hpp>
|
#include <graphene/chain/transaction_object.hpp>
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,10 @@
|
||||||
#include <graphene/app/application.hpp>
|
#include <graphene/app/application.hpp>
|
||||||
#include <graphene/app/plugin.hpp>
|
#include <graphene/app/plugin.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
#include <graphene/chain/db_with.hpp>
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/chain/genesis_state.hpp>
|
||||||
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
|
#include <graphene/protocol/types.hpp>
|
||||||
|
|
||||||
#include <graphene/egenesis/egenesis.hpp>
|
#include <graphene/egenesis/egenesis.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@
|
||||||
|
|
||||||
#include <graphene/app/database_api.hpp>
|
#include <graphene/app/database_api.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
#include <graphene/chain/protocol/confidential.hpp>
|
#include <graphene/protocol/confidential.hpp>
|
||||||
|
|
||||||
#include <graphene/market_history/market_history_plugin.hpp>
|
#include <graphene/market_history/market_history_plugin.hpp>
|
||||||
#include <graphene/accounts_list/accounts_list_plugin.hpp>
|
#include <graphene/accounts_list/accounts_list_plugin.hpp>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include <graphene/app/full_account.hpp>
|
#include <graphene/app/full_account.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@
|
||||||
#include <graphene/chain/account_object.hpp>
|
#include <graphene/chain/account_object.hpp>
|
||||||
#include <graphene/chain/vesting_balance_object.hpp>
|
#include <graphene/chain/vesting_balance_object.hpp>
|
||||||
#include <graphene/chain/market_evaluator.hpp>
|
#include <graphene/chain/market_evaluator.hpp>
|
||||||
|
#include <graphene/chain/market_object.hpp>
|
||||||
|
#include <graphene/chain/proposal_object.hpp>
|
||||||
#include <graphene/chain/withdraw_permission_object.hpp>
|
#include <graphene/chain/withdraw_permission_object.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace app {
|
namespace graphene { namespace app {
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <graphene/app/plugin.hpp>
|
#include <graphene/app/plugin.hpp>
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace app {
|
namespace graphene { namespace app {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ set_source_files_properties( "${CMAKE_CURRENT_BINARY_DIR}/include/graphene/chain
|
||||||
add_dependencies( build_hardfork_hpp cat-parts )
|
add_dependencies( build_hardfork_hpp cat-parts )
|
||||||
|
|
||||||
file(GLOB HEADERS "include/graphene/chain/*.hpp")
|
file(GLOB HEADERS "include/graphene/chain/*.hpp")
|
||||||
file(GLOB PROTOCOL_HEADERS "include/graphene/chain/protocol/*.hpp")
|
|
||||||
|
|
||||||
if( GRAPHENE_DISABLE_UNITY_BUILD )
|
if( GRAPHENE_DISABLE_UNITY_BUILD )
|
||||||
set( GRAPHENE_DB_FILES
|
set( GRAPHENE_DB_FILES
|
||||||
|
|
@ -36,42 +35,10 @@ add_library( graphene_chain
|
||||||
${GRAPHENE_DB_FILES}
|
${GRAPHENE_DB_FILES}
|
||||||
fork_database.cpp
|
fork_database.cpp
|
||||||
|
|
||||||
protocol/types.cpp
|
|
||||||
protocol/address.cpp
|
|
||||||
protocol/authority.cpp
|
|
||||||
protocol/asset.cpp
|
|
||||||
protocol/assert.cpp
|
|
||||||
protocol/account.cpp
|
|
||||||
protocol/transfer.cpp
|
|
||||||
protocol/chain_parameters.cpp
|
|
||||||
protocol/committee_member.cpp
|
|
||||||
protocol/witness.cpp
|
|
||||||
protocol/market.cpp
|
|
||||||
protocol/proposal.cpp
|
|
||||||
protocol/withdraw_permission.cpp
|
|
||||||
protocol/asset_ops.cpp
|
|
||||||
protocol/lottery_ops.cpp
|
|
||||||
protocol/memo.cpp
|
|
||||||
protocol/worker.cpp
|
|
||||||
protocol/custom.cpp
|
|
||||||
protocol/operations.cpp
|
|
||||||
protocol/transaction.cpp
|
|
||||||
protocol/block.cpp
|
|
||||||
protocol/fee_schedule.cpp
|
|
||||||
protocol/confidential.cpp
|
|
||||||
protocol/vote.cpp
|
|
||||||
protocol/tournament.cpp
|
|
||||||
protocol/small_ops.cpp
|
|
||||||
protocol/custom_permission.cpp
|
|
||||||
protocol/custom_account_authority.cpp
|
|
||||||
protocol/offer.cpp
|
|
||||||
|
|
||||||
genesis_state.cpp
|
genesis_state.cpp
|
||||||
get_config.cpp
|
get_config.cpp
|
||||||
exceptions.cpp
|
exceptions.cpp
|
||||||
|
|
||||||
pts_address.cpp
|
|
||||||
|
|
||||||
evaluator.cpp
|
evaluator.cpp
|
||||||
balance_evaluator.cpp
|
balance_evaluator.cpp
|
||||||
account_evaluator.cpp
|
account_evaluator.cpp
|
||||||
|
|
@ -105,35 +72,12 @@ add_library( graphene_chain
|
||||||
|
|
||||||
is_authorized_asset.cpp
|
is_authorized_asset.cpp
|
||||||
|
|
||||||
protocol/sport.cpp
|
|
||||||
sport_evaluator.cpp
|
|
||||||
protocol/event_group.cpp
|
|
||||||
event_group_evaluator.cpp
|
|
||||||
event_group_object.cpp
|
|
||||||
protocol/event.cpp
|
|
||||||
event_evaluator.cpp
|
|
||||||
event_object.cpp
|
|
||||||
protocol/betting_market.cpp
|
|
||||||
betting_market_evaluator.cpp
|
|
||||||
betting_market_object.cpp
|
|
||||||
betting_market_group_object.cpp
|
|
||||||
custom_permission_evaluator.cpp
|
|
||||||
custom_account_authority_evaluator.cpp
|
|
||||||
|
|
||||||
affiliate_payout.cpp
|
|
||||||
|
|
||||||
offer_object.cpp
|
|
||||||
offer_evaluator.cpp
|
|
||||||
nft_evaluator.cpp
|
|
||||||
protocol/nft.cpp
|
|
||||||
|
|
||||||
${HEADERS}
|
${HEADERS}
|
||||||
${PROTOCOL_HEADERS}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/include/graphene/chain/hardfork.hpp"
|
"${CMAKE_CURRENT_BINARY_DIR}/include/graphene/chain/hardfork.hpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
add_dependencies( graphene_chain build_hardfork_hpp )
|
add_dependencies( graphene_chain build_hardfork_hpp )
|
||||||
target_link_libraries( graphene_chain fc graphene_db )
|
target_link_libraries( graphene_chain fc graphene_db graphene_protocol )
|
||||||
target_include_directories( graphene_chain
|
target_include_directories( graphene_chain
|
||||||
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include" )
|
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include" )
|
||||||
|
|
||||||
|
|
@ -149,4 +93,3 @@ INSTALL( TARGETS
|
||||||
ARCHIVE DESTINATION lib
|
ARCHIVE DESTINATION lib
|
||||||
)
|
)
|
||||||
INSTALL( FILES ${HEADERS} DESTINATION "include/graphene/chain" )
|
INSTALL( FILES ${HEADERS} DESTINATION "include/graphene/chain" )
|
||||||
INSTALL( FILES ${PROTOCOL_HEADERS} DESTINATION "include/graphene/chain/protocol" )
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include <graphene/chain/block_database.hpp>
|
#include <graphene/chain/block_database.hpp>
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
#include <fc/io/raw.hpp>
|
#include <fc/io/raw.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <graphene/chain/protocol/buyback.hpp>
|
#include <graphene/protocol/buyback.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
#include <graphene/chain/exceptions.hpp>
|
#include <graphene/chain/exceptions.hpp>
|
||||||
#include <graphene/chain/hardfork.hpp>
|
#include <graphene/chain/hardfork.hpp>
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,8 @@
|
||||||
#include <graphene/chain/committee_member_object.hpp>
|
#include <graphene/chain/committee_member_object.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
#include <graphene/chain/account_object.hpp>
|
#include <graphene/chain/account_object.hpp>
|
||||||
#include <graphene/chain/hardfork.hpp>
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
#include <graphene/protocol/vote.hpp>
|
||||||
#include <graphene/chain/protocol/vote.hpp>
|
|
||||||
#include <graphene/chain/transaction_evaluation_state.hpp>
|
#include <graphene/chain/transaction_evaluation_state.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
@ -42,7 +41,7 @@ object_id_type committee_member_create_evaluator::do_apply( const committee_memb
|
||||||
{ try {
|
{ try {
|
||||||
vote_id_type vote_id;
|
vote_id_type vote_id;
|
||||||
db().modify(db().get_global_properties(), [&vote_id](global_property_object& p) {
|
db().modify(db().get_global_properties(), [&vote_id](global_property_object& p) {
|
||||||
vote_id = get_next_vote_id(p, vote_id_type::committee);
|
vote_id = vote_id_type(vote_id_type::committee, p.next_available_vote_id++);
|
||||||
});
|
});
|
||||||
|
|
||||||
const auto& new_del_object = db().create<committee_member_object>( [&]( committee_member_object& obj ){
|
const auto& new_del_object = db().create<committee_member_object>( [&]( committee_member_object& obj ){
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include <graphene/chain/exceptions.hpp>
|
#include <graphene/chain/exceptions.hpp>
|
||||||
#include <graphene/chain/protocol/confidential.hpp>
|
#include <graphene/protocol/confidential.hpp>
|
||||||
#include <graphene/chain/confidential_evaluator.hpp>
|
#include <graphene/chain/confidential_evaluator.hpp>
|
||||||
#include <graphene/chain/confidential_object.hpp>
|
#include <graphene/chain/confidential_object.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
|
|
|
||||||
|
|
@ -36,11 +36,10 @@
|
||||||
#include <graphene/chain/proposal_object.hpp>
|
#include <graphene/chain/proposal_object.hpp>
|
||||||
#include <graphene/chain/transaction_object.hpp>
|
#include <graphene/chain/transaction_object.hpp>
|
||||||
#include <graphene/chain/witness_object.hpp>
|
#include <graphene/chain/witness_object.hpp>
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
|
||||||
#include <graphene/chain/exceptions.hpp>
|
#include <graphene/chain/exceptions.hpp>
|
||||||
#include <graphene/chain/evaluator.hpp>
|
#include <graphene/chain/evaluator.hpp>
|
||||||
#include <graphene/chain/witness_schedule_object.hpp>
|
|
||||||
#include <fc/crypto/digest.hpp>
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,6 @@
|
||||||
#include <graphene/chain/offer_evaluator.hpp>
|
#include <graphene/chain/offer_evaluator.hpp>
|
||||||
#include <graphene/chain/nft_evaluator.hpp>
|
#include <graphene/chain/nft_evaluator.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
|
||||||
|
|
||||||
#include <fc/uint128.hpp>
|
#include <fc/uint128.hpp>
|
||||||
#include <fc/crypto/digest.hpp>
|
#include <fc/crypto/digest.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
#include <fc/uint128.hpp>
|
#include <fc/uint128.hpp>
|
||||||
|
|
||||||
|
#include <graphene/protocol/market.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
#include <graphene/chain/fba_accumulator_id.hpp>
|
#include <graphene/chain/fba_accumulator_id.hpp>
|
||||||
#include <graphene/chain/hardfork.hpp>
|
#include <graphene/chain/hardfork.hpp>
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,8 @@
|
||||||
#include <graphene/chain/witness_schedule_object.hpp>
|
#include <graphene/chain/witness_schedule_object.hpp>
|
||||||
#include <graphene/chain/special_authority_object.hpp>
|
#include <graphene/chain/special_authority_object.hpp>
|
||||||
#include <graphene/chain/operation_history_object.hpp>
|
#include <graphene/chain/operation_history_object.hpp>
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
|
||||||
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
|
|
||||||
#include <fc/io/fstream.hpp>
|
#include <fc/io/fstream.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,10 @@
|
||||||
|
|
||||||
#include <fc/container/flat.hpp>
|
#include <fc/container/flat.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/protocol/authority.hpp>
|
#include <graphene/protocol/authority.hpp>
|
||||||
#include <graphene/chain/protocol/operations.hpp>
|
#include <graphene/protocol/operations.hpp>
|
||||||
#include <graphene/chain/protocol/transaction.hpp>
|
#include <graphene/protocol/transaction.hpp>
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
|
||||||
#include <graphene/chain/withdraw_permission_object.hpp>
|
#include <graphene/chain/withdraw_permission_object.hpp>
|
||||||
#include <graphene/chain/worker_object.hpp>
|
#include <graphene/chain/worker_object.hpp>
|
||||||
#include <graphene/chain/confidential_object.hpp>
|
#include <graphene/chain/confidential_object.hpp>
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
#include <graphene/chain/game_object.hpp>
|
#include <graphene/chain/game_object.hpp>
|
||||||
#include <graphene/chain/betting_market_object.hpp>
|
#include <graphene/chain/betting_market_object.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
#include <graphene/chain/fba_object.hpp>
|
#include <graphene/chain/fba_object.hpp>
|
||||||
#include <graphene/chain/committee_member_object.hpp>
|
#include <graphene/chain/committee_member_object.hpp>
|
||||||
#include <graphene/chain/market_evaluator.hpp>
|
#include <graphene/chain/market_evaluator.hpp>
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
database& generic_evaluator::db()const { return trx_state->db(); }
|
database& generic_evaluator::db()const { return trx_state->db(); }
|
||||||
|
|
@ -56,7 +56,7 @@ database& generic_evaluator::db()const { return trx_state->db(); }
|
||||||
fee_paying_account = &account_id(d);
|
fee_paying_account = &account_id(d);
|
||||||
fee_paying_account_statistics = &fee_paying_account->statistics(d);
|
fee_paying_account_statistics = &fee_paying_account->statistics(d);
|
||||||
|
|
||||||
fee_asset = &fee.asset_id(d);
|
fee_asset = &asset_id_type(fee.asset_id)(d);
|
||||||
fee_asset_dyn_data = &fee_asset->dynamic_asset_data_id(d);
|
fee_asset_dyn_data = &fee_asset->dynamic_asset_data_id(d);
|
||||||
|
|
||||||
if( d.head_block_time() > HARDFORK_419_TIME )
|
if( d.head_block_time() > HARDFORK_419_TIME )
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,8 @@
|
||||||
|
|
||||||
#include <graphene/chain/genesis_state.hpp>
|
#include <graphene/chain/genesis_state.hpp>
|
||||||
|
|
||||||
// these are required to serialize a genesis_state
|
// this is required to serialize a genesis_state
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
|
|
||||||
#include <fc/io/raw.hpp>
|
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include <graphene/chain/get_config.hpp>
|
#include <graphene/chain/get_config.hpp>
|
||||||
#include <graphene/chain/config.hpp>
|
#include <graphene/chain/config.hpp>
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,13 +22,15 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/operations.hpp>
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
#include <graphene/chain/protocol/account.hpp>
|
#include <graphene/chain/types.hpp>
|
||||||
#include <boost/multi_index/composite_key.hpp>
|
#include <boost/multi_index/composite_key.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
class database;
|
class database;
|
||||||
|
class account_object;
|
||||||
|
class vesting_balance_object;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class account_statistics_object
|
* @class account_statistics_object
|
||||||
|
|
@ -541,6 +543,10 @@ namespace graphene { namespace chain {
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::account_object)
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::account_balance_object)
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::account_statistics_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::account_object,
|
FC_REFLECT_DERIVED( graphene::chain::account_object,
|
||||||
(graphene::db::object),
|
(graphene::db::object),
|
||||||
(membership_expiration_date)(registrar)(referrer)(lifetime_referrer)
|
(membership_expiration_date)(registrar)(referrer)(lifetime_referrer)
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/operations.hpp>
|
#include <graphene/protocol/operations.hpp>
|
||||||
#include <graphene/chain/evaluator.hpp>
|
#include <graphene/chain/evaluator.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/operations.hpp>
|
#include <graphene/protocol/operations.hpp>
|
||||||
#include <graphene/chain/evaluator.hpp>
|
#include <graphene/chain/evaluator.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,10 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/asset_ops.hpp>
|
||||||
#include <graphene/db/generic_index.hpp>
|
|
||||||
#include <graphene/db/flat_index.hpp>
|
|
||||||
#include <graphene/chain/protocol/asset_ops.hpp>
|
|
||||||
#include <boost/multi_index/composite_key.hpp>
|
#include <boost/multi_index/composite_key.hpp>
|
||||||
|
#include <graphene/db/generic_index.hpp>
|
||||||
|
#include <graphene/chain/types.hpp>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup prediction_market Prediction Market
|
* @defgroup prediction_market Prediction Market
|
||||||
|
|
@ -39,6 +38,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
class account_object;
|
||||||
|
class asset_bitasset_data_object;
|
||||||
class database;
|
class database;
|
||||||
class transaction_evaluation_state;
|
class transaction_evaluation_state;
|
||||||
using namespace graphene::db;
|
using namespace graphene::db;
|
||||||
|
|
@ -111,13 +112,13 @@ namespace graphene { namespace chain {
|
||||||
string amount_to_string(share_type amount)const;
|
string amount_to_string(share_type amount)const;
|
||||||
/// Convert an asset to a textual representation, i.e. "123.45"
|
/// Convert an asset to a textual representation, i.e. "123.45"
|
||||||
string amount_to_string(const asset& amount)const
|
string amount_to_string(const asset& amount)const
|
||||||
{ FC_ASSERT(amount.asset_id == id); return amount_to_string(amount.amount); }
|
{ FC_ASSERT(amount.asset_id == get_id()); return amount_to_string(amount.amount); }
|
||||||
/// Convert an asset to a textual representation with symbol, i.e. "123.45 USD"
|
/// Convert an asset to a textual representation with symbol, i.e. "123.45 USD"
|
||||||
string amount_to_pretty_string(share_type amount)const
|
string amount_to_pretty_string(share_type amount)const
|
||||||
{ return amount_to_string(amount) + " " + symbol; }
|
{ return amount_to_string(amount) + " " + symbol; }
|
||||||
/// Convert an asset to a textual representation with symbol, i.e. "123.45 USD"
|
/// Convert an asset to a textual representation with symbol, i.e. "123.45 USD"
|
||||||
string amount_to_pretty_string(const asset &amount)const
|
string amount_to_pretty_string(const asset &amount)const
|
||||||
{ FC_ASSERT(amount.asset_id == id); return amount_to_pretty_string(amount.amount); }
|
{ FC_ASSERT(amount.asset_id == get_id()); return amount_to_pretty_string(amount.amount); }
|
||||||
|
|
||||||
uint32_t get_issuer_num()const
|
uint32_t get_issuer_num()const
|
||||||
{ return issuer.instance.value; }
|
{ return issuer.instance.value; }
|
||||||
|
|
@ -513,6 +514,10 @@ namespace graphene { namespace chain {
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::asset_object)
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::asset_dynamic_data_object)
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::asset_bitasset_data_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::asset_dynamic_data_object, (graphene::db::object),
|
FC_REFLECT_DERIVED( graphene::chain::asset_dynamic_data_object, (graphene::db::object),
|
||||||
(current_supply)(sweeps_tickets_sold)(confidential_supply)(accumulated_fees)(fee_pool) )
|
(current_supply)(sweeps_tickets_sold)(confidential_supply)(accumulated_fees)(fee_pool) )
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/protocol/transaction.hpp>
|
#include <graphene/protocol/transaction.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
#include <graphene/chain/balance_object.hpp>
|
#include <graphene/chain/balance_object.hpp>
|
||||||
#include <graphene/chain/evaluator.hpp>
|
#include <graphene/chain/evaluator.hpp>
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,8 @@ namespace graphene { namespace chain {
|
||||||
using balance_index = generic_index<balance_object, balance_multi_index_type>;
|
using balance_index = generic_index<balance_object, balance_multi_index_type>;
|
||||||
} }
|
} }
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::balance_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::balance_object, (graphene::db::object),
|
FC_REFLECT_DERIVED( graphene::chain::balance_object, (graphene::db::object),
|
||||||
(owner)(balance)(vesting_policy)(last_claim_date) )
|
(owner)(balance)(vesting_policy)(last_claim_date) )
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,13 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <graphene/chain/protocol/block.hpp>
|
#include <graphene/protocol/block.hpp>
|
||||||
|
|
||||||
#include <fc/filesystem.hpp>
|
#include <fc/filesystem.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
class index_entry;
|
struct index_entry;
|
||||||
|
using namespace graphene::protocol;
|
||||||
|
|
||||||
class block_database
|
class block_database
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ namespace graphene { namespace chain {
|
||||||
|
|
||||||
} }
|
} }
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::block_summary_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::block_summary_object, (graphene::db::object), (block_id) )
|
FC_REFLECT_DERIVED( graphene::chain::block_summary_object, (graphene::db::object), (block_id) )
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
|
#include <graphene/db/object.hpp>
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
@ -65,6 +66,8 @@ class budget_record_object : public graphene::db::abstract_object<budget_record_
|
||||||
|
|
||||||
} }
|
} }
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::budget_record_object)
|
||||||
|
|
||||||
FC_REFLECT(graphene::chain::budget_record,
|
FC_REFLECT(graphene::chain::budget_record,
|
||||||
(time_since_last_budget)
|
(time_since_last_budget)
|
||||||
(from_initial_reserve)
|
(from_initial_reserve)
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/protocol/buyback.hpp>
|
#include <graphene/protocol/buyback.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
#include <graphene/db/object.hpp>
|
#include <graphene/db/object.hpp>
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
|
|
||||||
|
|
@ -64,6 +64,8 @@ typedef generic_index< buyback_object, buyback_multi_index_type > buyback_index;
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::buyback_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::buyback_object, (graphene::db::object), (asset_to_buy) )
|
FC_REFLECT_DERIVED( graphene::chain::buyback_object, (graphene::db::object), (asset_to_buy) )
|
||||||
|
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::buyback_object )
|
GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::buyback_object )
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,8 @@ class chain_property_object : public abstract_object<chain_property_object>
|
||||||
|
|
||||||
} }
|
} }
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::chain_property_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::chain_property_object, (graphene::db::object),
|
FC_REFLECT_DERIVED( graphene::chain::chain_property_object, (graphene::db::object),
|
||||||
(chain_id)
|
(chain_id)
|
||||||
(immutable_parameters)
|
(immutable_parameters)
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,10 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
|
||||||
#include <graphene/db/object.hpp>
|
#include <graphene/db/object.hpp>
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
|
#include <graphene/protocol/vote.hpp>
|
||||||
|
#include <graphene/chain/types.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
using namespace graphene::db;
|
using namespace graphene::db;
|
||||||
|
|
@ -71,6 +72,7 @@ namespace graphene { namespace chain {
|
||||||
using committee_member_index = generic_index<committee_member_object, committee_member_multi_index_type>;
|
using committee_member_index = generic_index<committee_member_object, committee_member_multi_index_type>;
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::committee_member_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::committee_member_object, (graphene::db::object),
|
FC_REFLECT_DERIVED( graphene::chain::committee_member_object, (graphene::db::object),
|
||||||
(committee_member_account)(vote_id)(total_votes)(url) )
|
(committee_member_account)(vote_id)(total_votes)(url) )
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,10 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/evaluator.hpp>
|
#include <graphene/chain/evaluator.hpp>
|
||||||
|
#include <graphene/chain/types.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
struct transfer_to_blind_operation;
|
|
||||||
struct transfer_from_blind_operation;
|
|
||||||
struct blind_transfer_operation;
|
|
||||||
|
|
||||||
class transfer_to_blind_evaluator : public evaluator<transfer_to_blind_evaluator>
|
class transfer_to_blind_evaluator : public evaluator<transfer_to_blind_evaluator>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/protocol/authority.hpp>
|
#include <graphene/protocol/authority.hpp>
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
|
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
|
|
||||||
|
|
@ -65,6 +65,7 @@ typedef generic_index<blinded_balance_object, blinded_balance_object_multi_index
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::blinded_balance_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::blinded_balance_object, (graphene::db::object),
|
FC_REFLECT_DERIVED( graphene::chain::blinded_balance_object, (graphene::db::object),
|
||||||
(commitment)(asset_id)(owner) )
|
(commitment)(asset_id)(owner) )
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <graphene/protocol/config.hpp>
|
||||||
|
|
||||||
#define GRAPHENE_SYMBOL "TEST"
|
#define GRAPHENE_SYMBOL "TEST"
|
||||||
#define GRAPHENE_ADDRESS_PREFIX "TEST"
|
#define GRAPHENE_ADDRESS_PREFIX "TEST"
|
||||||
|
|
||||||
|
|
@ -243,4 +245,4 @@
|
||||||
|
|
||||||
#define NFT_TOKEN_MIN_LENGTH 3
|
#define NFT_TOKEN_MIN_LENGTH 3
|
||||||
#define NFT_TOKEN_MAX_LENGTH 15
|
#define NFT_TOKEN_MAX_LENGTH 15
|
||||||
#define NFT_URI_MAX_LENGTH GRAPHENE_MAX_URL_LENGTH
|
#define NFT_URI_MAX_LENGTH GRAPHENE_MAX_URL_LENGTH
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/operations.hpp>
|
#include <graphene/protocol/operations.hpp>
|
||||||
#include <graphene/chain/evaluator.hpp>
|
#include <graphene/chain/evaluator.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/global_property_object.hpp>
|
#include <graphene/chain/global_property_object.hpp>
|
||||||
#include <graphene/chain/node_property_object.hpp>
|
#include <graphene/chain/node_property_object.hpp>
|
||||||
#include <graphene/chain/account_object.hpp>
|
#include <graphene/chain/account_object.hpp>
|
||||||
|
|
@ -49,6 +52,15 @@ namespace graphene { namespace chain {
|
||||||
using graphene::db::object;
|
using graphene::db::object;
|
||||||
class op_evaluator;
|
class op_evaluator;
|
||||||
class transaction_evaluation_state;
|
class transaction_evaluation_state;
|
||||||
|
class proposal_object;
|
||||||
|
class operation_history_object;
|
||||||
|
class chain_property_object;
|
||||||
|
class witness_schedule_object;
|
||||||
|
class witness_object;
|
||||||
|
class force_settlement_object;
|
||||||
|
class limit_order_object;
|
||||||
|
class collateral_bid_object;
|
||||||
|
class call_order_object;
|
||||||
|
|
||||||
struct budget_record;
|
struct budget_record;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,14 +24,17 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/exceptions.hpp>
|
#include <graphene/chain/exceptions.hpp>
|
||||||
#include <graphene/chain/transaction_evaluation_state.hpp>
|
#include <graphene/chain/transaction_evaluation_state.hpp>
|
||||||
#include <graphene/chain/protocol/operations.hpp>
|
#include <graphene/protocol/operations.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
class database;
|
class database;
|
||||||
struct signed_transaction;
|
|
||||||
class generic_evaluator;
|
class generic_evaluator;
|
||||||
class transaction_evaluation_state;
|
class transaction_evaluation_state;
|
||||||
|
class account_object;
|
||||||
|
class account_statistics_object;
|
||||||
|
class asset_object;
|
||||||
|
class asset_dynamic_data_object;
|
||||||
|
|
||||||
class generic_evaluator
|
class generic_evaluator
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <fc/exception/exception.hpp>
|
#include <fc/exception/exception.hpp>
|
||||||
#include <graphene/chain/protocol/protocol.hpp>
|
#include <graphene/protocol/exceptions.hpp>
|
||||||
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
|
#include <graphene/protocol/operations.hpp>
|
||||||
|
#include <graphene/chain/types.hpp>
|
||||||
|
|
||||||
#define GRAPHENE_ASSERT( expr, exc_type, FORMAT, ... ) \
|
#define GRAPHENE_ASSERT( expr, exc_type, FORMAT, ... ) \
|
||||||
FC_MULTILINE_MACRO_BEGIN \
|
FC_MULTILINE_MACRO_BEGIN \
|
||||||
|
|
@ -32,7 +35,6 @@
|
||||||
FC_THROW_EXCEPTION( exc_type, FORMAT, __VA_ARGS__ ); \
|
FC_THROW_EXCEPTION( exc_type, FORMAT, __VA_ARGS__ ); \
|
||||||
FC_MULTILINE_MACRO_END
|
FC_MULTILINE_MACRO_END
|
||||||
|
|
||||||
|
|
||||||
#define GRAPHENE_DECLARE_OP_BASE_EXCEPTIONS( op_name ) \
|
#define GRAPHENE_DECLARE_OP_BASE_EXCEPTIONS( op_name ) \
|
||||||
FC_DECLARE_DERIVED_EXCEPTION( \
|
FC_DECLARE_DERIVED_EXCEPTION( \
|
||||||
op_name ## _validate_exception, \
|
op_name ## _validate_exception, \
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/chain/types.hpp>
|
||||||
#include <graphene/db/object.hpp>
|
#include <graphene/db/object.hpp>
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
|
|
||||||
|
|
@ -49,6 +49,8 @@ class fba_accumulator_object : public graphene::db::abstract_object< fba_accumul
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::fba_accumulator_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::fba_accumulator_object, (graphene::db::object),
|
FC_REFLECT_DERIVED( graphene::chain::fba_accumulator_object, (graphene::db::object),
|
||||||
(accumulated_fba_fees)(designated_asset) )
|
(accumulated_fba_fees)(designated_asset) )
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,9 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/block.hpp>
|
#include <graphene/protocol/block.hpp>
|
||||||
|
|
||||||
|
#include <graphene/chain/types.hpp>
|
||||||
|
|
||||||
#include <boost/multi_index_container.hpp>
|
#include <boost/multi_index_container.hpp>
|
||||||
#include <boost/multi_index/member.hpp>
|
#include <boost/multi_index/member.hpp>
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,8 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/protocol/address.hpp>
|
#include <graphene/protocol/chain_parameters.hpp>
|
||||||
#include <graphene/chain/protocol/chain_parameters.hpp>
|
#include <graphene/chain/types.hpp>
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
|
||||||
#include <graphene/chain/immutable_chain_parameters.hpp>
|
#include <graphene/chain/immutable_chain_parameters.hpp>
|
||||||
|
|
||||||
#include <fc/crypto/sha256.hpp>
|
#include <fc/crypto/sha256.hpp>
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <fc/uint128.hpp>
|
#include <fc/uint128.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/protocol/chain_parameters.hpp>
|
#include <graphene/protocol/chain_parameters.hpp>
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/chain/types.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
#include <graphene/db/object.hpp>
|
#include <graphene/db/object.hpp>
|
||||||
|
|
||||||
|
|
@ -123,6 +123,9 @@ namespace graphene { namespace chain {
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::dynamic_global_property_object)
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::global_property_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::dynamic_global_property_object, (graphene::db::object),
|
FC_REFLECT_DERIVED( graphene::chain::dynamic_global_property_object, (graphene::db::object),
|
||||||
(head_block_number)
|
(head_block_number)
|
||||||
(head_block_id)
|
(head_block_id)
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <fc/container/flat.hpp>
|
#include <fc/container/flat.hpp>
|
||||||
#include <graphene/chain/protocol/operations.hpp>
|
#include <graphene/protocol/operations.hpp>
|
||||||
#include <graphene/chain/protocol/transaction.hpp>
|
#include <graphene/protocol/transaction.hpp>
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/evaluator.hpp>
|
#include <graphene/chain/evaluator.hpp>
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/chain/types.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
|
|
@ -31,9 +31,7 @@ namespace graphene { namespace chain {
|
||||||
class asset_object;
|
class asset_object;
|
||||||
class asset_bitasset_data_object;
|
class asset_bitasset_data_object;
|
||||||
class call_order_object;
|
class call_order_object;
|
||||||
struct call_order_update_operation;
|
class limit_order_object;
|
||||||
struct limit_order_cancel_operation;
|
|
||||||
struct limit_order_create_operation;
|
|
||||||
|
|
||||||
class limit_order_create_evaluator : public evaluator<limit_order_create_evaluator>
|
class limit_order_create_evaluator : public evaluator<limit_order_create_evaluator>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,10 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/protocol/asset.hpp>
|
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
#include <graphene/db/object.hpp>
|
#include <graphene/db/object.hpp>
|
||||||
|
#include <graphene/protocol/asset.hpp>
|
||||||
|
#include <graphene/chain/types.hpp>
|
||||||
|
|
||||||
#include <boost/multi_index/composite_key.hpp>
|
#include <boost/multi_index/composite_key.hpp>
|
||||||
|
|
||||||
|
|
@ -65,7 +65,6 @@ class limit_order_object : public abstract_object<limit_order_object>
|
||||||
asset amount_to_receive()const { return amount_for_sale() * sell_price; }
|
asset amount_to_receive()const { return amount_for_sale() * sell_price; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct by_id;
|
|
||||||
struct by_price;
|
struct by_price;
|
||||||
struct by_expiration;
|
struct by_expiration;
|
||||||
struct by_account;
|
struct by_account;
|
||||||
|
|
@ -205,6 +204,11 @@ typedef generic_index<force_settlement_object, force_settlement_object_multi_ind
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::limit_order_object)
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::call_order_object)
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::force_settlement_object)
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::collateral_bid_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::limit_order_object,
|
FC_REFLECT_DERIVED( graphene::chain::limit_order_object,
|
||||||
(graphene::db::object),
|
(graphene::db::object),
|
||||||
(expiration)(seller)(for_sale)(sell_price)(deferred_fee)
|
(expiration)(seller)(for_sale)(sell_price)(deferred_fee)
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,7 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include <graphene/protocol/operations.hpp>
|
||||||
#include <graphene/chain/protocol/operations.hpp>
|
|
||||||
#include <graphene/db/object.hpp>
|
#include <graphene/db/object.hpp>
|
||||||
|
|
||||||
#include <boost/multi_index/composite_key.hpp>
|
#include <boost/multi_index/composite_key.hpp>
|
||||||
|
|
@ -139,6 +138,9 @@ typedef generic_index<account_transaction_history_object, account_transaction_hi
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::operation_history_object)
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::account_transaction_history_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::operation_history_object, (graphene::chain::object),
|
FC_REFLECT_DERIVED( graphene::chain::operation_history_object, (graphene::chain::object),
|
||||||
(op)(result)(block_num)(trx_in_block)(op_in_trx)(virtual_op) )
|
(op)(result)(block_num)(trx_in_block)(op_in_trx)(virtual_op) )
|
||||||
FC_REFLECT_DERIVED( graphene::chain::account_transaction_history_object, (graphene::chain::object),
|
FC_REFLECT_DERIVED( graphene::chain::account_transaction_history_object, (graphene::chain::object),
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/protocol/operations.hpp>
|
#include <graphene/protocol/operations.hpp>
|
||||||
#include <graphene/chain/evaluator.hpp>
|
#include <graphene/chain/evaluator.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
#include <graphene/chain/transaction_evaluation_state.hpp>
|
#include <graphene/chain/transaction_evaluation_state.hpp>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/protocol/transaction.hpp>
|
#include <graphene/protocol/transaction.hpp>
|
||||||
#include <graphene/chain/transaction_evaluation_state.hpp>
|
#include <graphene/chain/transaction_evaluation_state.hpp>
|
||||||
|
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
|
|
@ -94,6 +94,8 @@ typedef generic_index<proposal_object, proposal_multi_index_container> proposal_
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::proposal_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::proposal_object, (graphene::chain::object),
|
FC_REFLECT_DERIVED( graphene::chain::proposal_object, (graphene::chain::object),
|
||||||
(expiration_time)(review_period_time)(proposed_transaction)(required_active_approvals)
|
(expiration_time)(review_period_time)(proposed_transaction)(required_active_approvals)
|
||||||
(available_active_approvals)(required_owner_approvals)(available_owner_approvals)
|
(available_active_approvals)(required_owner_approvals)(available_owner_approvals)
|
||||||
|
|
|
||||||
|
|
@ -1,535 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2015 Cryptonomex, Inc., and contributors.
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
#include <fc/container/flat_fwd.hpp>
|
|
||||||
#include <fc/io/varint.hpp>
|
|
||||||
#include <fc/io/enum_type.hpp>
|
|
||||||
#include <fc/crypto/sha224.hpp>
|
|
||||||
#include <fc/crypto/elliptic.hpp>
|
|
||||||
#include <fc/crypto/ripemd160.hpp>
|
|
||||||
#include <fc/reflect/reflect.hpp>
|
|
||||||
#include <fc/reflect/variant.hpp>
|
|
||||||
#include <fc/optional.hpp>
|
|
||||||
#include <fc/safe.hpp>
|
|
||||||
#include <fc/container/flat.hpp>
|
|
||||||
#include <fc/string.hpp>
|
|
||||||
#include <fc/io/datastream.hpp>
|
|
||||||
#include <fc/io/raw.hpp>
|
|
||||||
|
|
||||||
#include <graphene/chain/protocol/ext.hpp>
|
|
||||||
|
|
||||||
#include <fc/uint128.hpp>
|
|
||||||
#include <fc/static_variant.hpp>
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <vector>
|
|
||||||
#include <deque>
|
|
||||||
#include <cstdint>
|
|
||||||
#include <graphene/db/object_id.hpp>
|
|
||||||
#include <graphene/chain/protocol/config.hpp>
|
|
||||||
|
|
||||||
#define GRAPHENE_EXTERNAL_SERIALIZATION(ext, type) \
|
|
||||||
namespace fc { \
|
|
||||||
ext template void from_variant( const variant& v, type& vo, uint32_t max_depth ); \
|
|
||||||
ext template void to_variant( const type& v, variant& vo, uint32_t max_depth ); \
|
|
||||||
namespace raw { \
|
|
||||||
ext template void pack< datastream<size_t>, type >( datastream<size_t>& s, const type& tx, uint32_t _max_depth=FC_PACK_MAX_DEPTH ); \
|
|
||||||
ext template void pack< datastream<char*>, type >( datastream<char*>& s, const type& tx, uint32_t _max_depth=FC_PACK_MAX_DEPTH ); \
|
|
||||||
ext template void unpack< datastream<const char*>, type >( datastream<const char*>& s, type& tx, uint32_t _max_depth=FC_PACK_MAX_DEPTH ); \
|
|
||||||
} } // fc::raw
|
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
|
||||||
using namespace graphene::db;
|
|
||||||
|
|
||||||
using std::map;
|
|
||||||
using std::vector;
|
|
||||||
using std::unordered_map;
|
|
||||||
using std::string;
|
|
||||||
using std::deque;
|
|
||||||
using std::shared_ptr;
|
|
||||||
using std::weak_ptr;
|
|
||||||
using std::unique_ptr;
|
|
||||||
using std::set;
|
|
||||||
using std::pair;
|
|
||||||
using std::enable_shared_from_this;
|
|
||||||
using std::tie;
|
|
||||||
using std::make_pair;
|
|
||||||
|
|
||||||
using fc::variant_object;
|
|
||||||
using fc::variant;
|
|
||||||
using fc::enum_type;
|
|
||||||
using fc::optional;
|
|
||||||
using fc::unsigned_int;
|
|
||||||
using fc::time_point_sec;
|
|
||||||
using fc::time_point;
|
|
||||||
using fc::safe;
|
|
||||||
using fc::flat_map;
|
|
||||||
using fc::flat_set;
|
|
||||||
using fc::static_variant;
|
|
||||||
using fc::ecc::range_proof_type;
|
|
||||||
using fc::ecc::range_proof_info;
|
|
||||||
using fc::ecc::commitment_type;
|
|
||||||
struct void_t{};
|
|
||||||
|
|
||||||
typedef fc::ecc::private_key private_key_type;
|
|
||||||
typedef fc::sha256 chain_id_type;
|
|
||||||
|
|
||||||
enum asset_issuer_permission_flags
|
|
||||||
{
|
|
||||||
charge_market_fee = 0x01, /**< an issuer-specified percentage of all market trades in this asset is paid to the issuer */
|
|
||||||
white_list = 0x02, /**< accounts must be whitelisted in order to hold this asset */
|
|
||||||
override_authority = 0x04, /**< issuer may transfer asset back to himself */
|
|
||||||
transfer_restricted = 0x08, /**< require the issuer to be one party to every transfer */
|
|
||||||
disable_force_settle = 0x10, /**< disable force settling */
|
|
||||||
global_settle = 0x20, /**< allow the bitasset issuer to force a global settling -- this may be set in permissions, but not flags */
|
|
||||||
disable_confidential = 0x40, /**< allow the asset to be used with confidential transactions */
|
|
||||||
witness_fed_asset = 0x80, /**< allow the asset to be fed by witnesses */
|
|
||||||
committee_fed_asset = 0x100 /**< allow the asset to be fed by the committee */
|
|
||||||
};
|
|
||||||
const static uint32_t ASSET_ISSUER_PERMISSION_MASK = charge_market_fee|white_list|override_authority|transfer_restricted|disable_force_settle|global_settle|disable_confidential
|
|
||||||
|witness_fed_asset|committee_fed_asset;
|
|
||||||
const static uint32_t UIA_ASSET_ISSUER_PERMISSION_MASK = charge_market_fee|white_list|override_authority|transfer_restricted|disable_confidential;
|
|
||||||
|
|
||||||
enum reserved_spaces
|
|
||||||
{
|
|
||||||
relative_protocol_ids = 0,
|
|
||||||
protocol_ids = 1,
|
|
||||||
implementation_ids = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
inline bool is_relative( object_id_type o ){ return o.space() == 0; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* List all object types from all namespaces here so they can
|
|
||||||
* be easily reflected and displayed in debug output. If a 3rd party
|
|
||||||
* wants to extend the core code then they will have to change the
|
|
||||||
* packed_object::type field from enum_type to uint16 to avoid
|
|
||||||
* warnings when converting packed_objects to/from json.
|
|
||||||
*/
|
|
||||||
enum object_type
|
|
||||||
{
|
|
||||||
null_object_type,
|
|
||||||
base_object_type,
|
|
||||||
account_object_type,
|
|
||||||
asset_object_type,
|
|
||||||
force_settlement_object_type,
|
|
||||||
committee_member_object_type,
|
|
||||||
witness_object_type,
|
|
||||||
limit_order_object_type,
|
|
||||||
call_order_object_type,
|
|
||||||
custom_object_type,
|
|
||||||
proposal_object_type,
|
|
||||||
operation_history_object_type,
|
|
||||||
withdraw_permission_object_type,
|
|
||||||
vesting_balance_object_type,
|
|
||||||
worker_object_type,
|
|
||||||
balance_object_type,
|
|
||||||
tournament_object_type,
|
|
||||||
tournament_details_object_type,
|
|
||||||
match_object_type,
|
|
||||||
game_object_type,
|
|
||||||
sport_object_type,
|
|
||||||
event_group_object_type,
|
|
||||||
event_object_type,
|
|
||||||
betting_market_rules_object_type,
|
|
||||||
betting_market_group_object_type,
|
|
||||||
betting_market_object_type,
|
|
||||||
bet_object_type,
|
|
||||||
custom_permission_object_type,
|
|
||||||
custom_account_authority_object_type,
|
|
||||||
offer_object_type,
|
|
||||||
nft_metadata_type,
|
|
||||||
nft_object_type,
|
|
||||||
OBJECT_TYPE_COUNT ///< Sentry value which contains the number of different object types
|
|
||||||
};
|
|
||||||
|
|
||||||
enum impl_object_type
|
|
||||||
{
|
|
||||||
impl_global_property_object_type,
|
|
||||||
impl_dynamic_global_property_object_type,
|
|
||||||
impl_reserved0_object_type, // formerly index_meta_object_type, TODO: delete me
|
|
||||||
impl_asset_dynamic_data_type,
|
|
||||||
impl_asset_bitasset_data_type,
|
|
||||||
impl_account_balance_object_type,
|
|
||||||
impl_account_statistics_object_type,
|
|
||||||
impl_transaction_object_type,
|
|
||||||
impl_block_summary_object_type,
|
|
||||||
impl_account_transaction_history_object_type,
|
|
||||||
impl_blinded_balance_object_type,
|
|
||||||
impl_chain_property_object_type,
|
|
||||||
impl_witness_schedule_object_type,
|
|
||||||
impl_budget_record_object_type,
|
|
||||||
impl_special_authority_object_type,
|
|
||||||
impl_buyback_object_type,
|
|
||||||
impl_fba_accumulator_object_type,
|
|
||||||
impl_asset_dividend_data_type,
|
|
||||||
impl_pending_dividend_payout_balance_for_holder_object_type,
|
|
||||||
impl_distributed_dividend_balance_data_type,
|
|
||||||
impl_betting_market_position_object_type,
|
|
||||||
impl_global_betting_statistics_object_type,
|
|
||||||
impl_lottery_balance_object_type,
|
|
||||||
impl_sweeps_vesting_balance_object_type,
|
|
||||||
impl_offer_history_object_type
|
|
||||||
};
|
|
||||||
|
|
||||||
//typedef fc::unsigned_int object_id_type;
|
|
||||||
//typedef uint64_t object_id_type;
|
|
||||||
class account_object;
|
|
||||||
class committee_member_object;
|
|
||||||
class witness_object;
|
|
||||||
class asset_object;
|
|
||||||
class force_settlement_object;
|
|
||||||
class limit_order_object;
|
|
||||||
class call_order_object;
|
|
||||||
class custom_object;
|
|
||||||
class proposal_object;
|
|
||||||
class operation_history_object;
|
|
||||||
class withdraw_permission_object;
|
|
||||||
class vesting_balance_object;
|
|
||||||
class worker_object;
|
|
||||||
class balance_object;
|
|
||||||
class blinded_balance_object;
|
|
||||||
class tournament_object;
|
|
||||||
class tournament_details_object;
|
|
||||||
class match_object;
|
|
||||||
class game_object;
|
|
||||||
class sport_object;
|
|
||||||
class event_group_object;
|
|
||||||
class event_object;
|
|
||||||
class betting_market_rules_object;
|
|
||||||
class betting_market_group_object;
|
|
||||||
class betting_market_object;
|
|
||||||
class bet_object;
|
|
||||||
class custom_permission_object;
|
|
||||||
class custom_account_authority_object;
|
|
||||||
class offer_object;
|
|
||||||
class nft_metadata_object;
|
|
||||||
class nft_object;
|
|
||||||
|
|
||||||
typedef object_id< protocol_ids, account_object_type, account_object> account_id_type;
|
|
||||||
typedef object_id< protocol_ids, asset_object_type, asset_object> asset_id_type;
|
|
||||||
typedef object_id< protocol_ids, force_settlement_object_type, force_settlement_object> force_settlement_id_type;
|
|
||||||
typedef object_id< protocol_ids, committee_member_object_type, committee_member_object> committee_member_id_type;
|
|
||||||
typedef object_id< protocol_ids, witness_object_type, witness_object> witness_id_type;
|
|
||||||
typedef object_id< protocol_ids, limit_order_object_type, limit_order_object> limit_order_id_type;
|
|
||||||
typedef object_id< protocol_ids, call_order_object_type, call_order_object> call_order_id_type;
|
|
||||||
typedef object_id< protocol_ids, custom_object_type, custom_object> custom_id_type;
|
|
||||||
typedef object_id< protocol_ids, proposal_object_type, proposal_object> proposal_id_type;
|
|
||||||
typedef object_id< protocol_ids, operation_history_object_type, operation_history_object> operation_history_id_type;
|
|
||||||
typedef object_id< protocol_ids, withdraw_permission_object_type,withdraw_permission_object> withdraw_permission_id_type;
|
|
||||||
typedef object_id< protocol_ids, vesting_balance_object_type, vesting_balance_object> vesting_balance_id_type;
|
|
||||||
typedef object_id< protocol_ids, worker_object_type, worker_object> worker_id_type;
|
|
||||||
typedef object_id< protocol_ids, balance_object_type, balance_object> balance_id_type;
|
|
||||||
typedef object_id< protocol_ids, tournament_object_type, tournament_object> tournament_id_type;
|
|
||||||
typedef object_id< protocol_ids, tournament_details_object_type, tournament_details_object> tournament_details_id_type;
|
|
||||||
typedef object_id< protocol_ids, match_object_type, match_object> match_id_type;
|
|
||||||
typedef object_id< protocol_ids, game_object_type, game_object> game_id_type;
|
|
||||||
typedef object_id< protocol_ids, sport_object_type, sport_object> sport_id_type;
|
|
||||||
typedef object_id< protocol_ids, event_group_object_type, event_group_object> event_group_id_type;
|
|
||||||
typedef object_id< protocol_ids, event_object_type, event_object> event_id_type;
|
|
||||||
typedef object_id< protocol_ids, betting_market_rules_object_type, betting_market_rules_object> betting_market_rules_id_type;
|
|
||||||
typedef object_id< protocol_ids, betting_market_group_object_type, betting_market_group_object> betting_market_group_id_type;
|
|
||||||
typedef object_id< protocol_ids, betting_market_object_type, betting_market_object> betting_market_id_type;
|
|
||||||
typedef object_id< protocol_ids, bet_object_type, bet_object> bet_id_type;
|
|
||||||
typedef object_id< protocol_ids, custom_permission_object_type, custom_permission_object> custom_permission_id_type;
|
|
||||||
typedef object_id< protocol_ids, custom_account_authority_object_type, custom_account_authority_object> custom_account_authority_id_type;
|
|
||||||
typedef object_id< protocol_ids, offer_object_type, offer_object> offer_id_type;
|
|
||||||
typedef object_id< protocol_ids, nft_metadata_type, nft_metadata_object> nft_metadata_id_type;
|
|
||||||
typedef object_id< protocol_ids, nft_object_type, nft_object> nft_id_type;
|
|
||||||
|
|
||||||
// implementation types
|
|
||||||
class global_property_object;
|
|
||||||
class dynamic_global_property_object;
|
|
||||||
class asset_dynamic_data_object;
|
|
||||||
class asset_bitasset_data_object;
|
|
||||||
class account_balance_object;
|
|
||||||
class account_statistics_object;
|
|
||||||
class transaction_object;
|
|
||||||
class block_summary_object;
|
|
||||||
class account_transaction_history_object;
|
|
||||||
class chain_property_object;
|
|
||||||
class witness_schedule_object;
|
|
||||||
class budget_record_object;
|
|
||||||
class special_authority_object;
|
|
||||||
class buyback_object;
|
|
||||||
class fba_accumulator_object;
|
|
||||||
class asset_dividend_data_object;
|
|
||||||
class pending_dividend_payout_balance_for_holder_object;
|
|
||||||
class betting_market_position_object;
|
|
||||||
class global_betting_statistics_object;
|
|
||||||
class lottery_balance_object;
|
|
||||||
class sweeps_vesting_balance_object;
|
|
||||||
class offer_history_object;
|
|
||||||
|
|
||||||
typedef object_id< implementation_ids, impl_global_property_object_type, global_property_object> global_property_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_dynamic_global_property_object_type, dynamic_global_property_object> dynamic_global_property_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_asset_dynamic_data_type, asset_dynamic_data_object> asset_dynamic_data_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_asset_bitasset_data_type, asset_bitasset_data_object> asset_bitasset_data_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_asset_dividend_data_type, asset_dividend_data_object> asset_dividend_data_id_type;
|
|
||||||
typedef object_id< implementation_ids,
|
|
||||||
impl_pending_dividend_payout_balance_for_holder_object_type,
|
|
||||||
pending_dividend_payout_balance_for_holder_object> pending_dividend_payout_balance_for_holder_object_type;
|
|
||||||
typedef object_id< implementation_ids, impl_account_balance_object_type, account_balance_object> account_balance_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_account_statistics_object_type, account_statistics_object> account_statistics_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_transaction_object_type, transaction_object> transaction_obj_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_block_summary_object_type, block_summary_object> block_summary_id_type;
|
|
||||||
|
|
||||||
typedef object_id< implementation_ids,
|
|
||||||
impl_account_transaction_history_object_type,
|
|
||||||
account_transaction_history_object> account_transaction_history_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_chain_property_object_type, chain_property_object> chain_property_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_witness_schedule_object_type, witness_schedule_object> witness_schedule_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_budget_record_object_type, budget_record_object > budget_record_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_blinded_balance_object_type, blinded_balance_object > blinded_balance_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_special_authority_object_type, special_authority_object > special_authority_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_buyback_object_type, buyback_object > buyback_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_fba_accumulator_object_type, fba_accumulator_object > fba_accumulator_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_betting_market_position_object_type, betting_market_position_object > betting_market_position_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_global_betting_statistics_object_type, global_betting_statistics_object > global_betting_statistics_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_lottery_balance_object_type, lottery_balance_object > lottery_balance_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_sweeps_vesting_balance_object_type, sweeps_vesting_balance_object> sweeps_vesting_balance_id_type;
|
|
||||||
typedef object_id< implementation_ids, impl_offer_history_object_type, offer_history_object> offer_history_id_type;
|
|
||||||
|
|
||||||
typedef fc::ripemd160 block_id_type;
|
|
||||||
typedef fc::ripemd160 checksum_type;
|
|
||||||
typedef fc::ripemd160 transaction_id_type;
|
|
||||||
typedef fc::sha256 digest_type;
|
|
||||||
typedef fc::ecc::compact_signature signature_type;
|
|
||||||
typedef safe<int64_t> share_type;
|
|
||||||
typedef fc::ripemd160 secret_hash_type;
|
|
||||||
typedef uint16_t weight_type;
|
|
||||||
|
|
||||||
struct public_key_type
|
|
||||||
{
|
|
||||||
struct binary_key
|
|
||||||
{
|
|
||||||
binary_key() {}
|
|
||||||
uint32_t check = 0;
|
|
||||||
fc::ecc::public_key_data data;
|
|
||||||
};
|
|
||||||
fc::ecc::public_key_data key_data;
|
|
||||||
public_key_type();
|
|
||||||
public_key_type( const fc::ecc::public_key_data& data );
|
|
||||||
public_key_type( const fc::ecc::public_key& pubkey );
|
|
||||||
explicit public_key_type( const std::string& base58str );
|
|
||||||
operator fc::ecc::public_key_data() const;
|
|
||||||
operator fc::ecc::public_key() const;
|
|
||||||
explicit operator std::string() const;
|
|
||||||
friend bool operator == ( const public_key_type& p1, const fc::ecc::public_key& p2);
|
|
||||||
friend bool operator == ( const public_key_type& p1, const public_key_type& p2);
|
|
||||||
friend bool operator != ( const public_key_type& p1, const public_key_type& p2);
|
|
||||||
// TODO: This is temporary for testing
|
|
||||||
bool is_valid_v1( const std::string& base58str );
|
|
||||||
bool is_valid_muse( const std::string& base58str );
|
|
||||||
};
|
|
||||||
|
|
||||||
struct extended_public_key_type
|
|
||||||
{
|
|
||||||
struct binary_key
|
|
||||||
{
|
|
||||||
binary_key() {}
|
|
||||||
uint32_t check = 0;
|
|
||||||
fc::ecc::extended_key_data data;
|
|
||||||
};
|
|
||||||
|
|
||||||
fc::ecc::extended_key_data key_data;
|
|
||||||
|
|
||||||
extended_public_key_type();
|
|
||||||
extended_public_key_type( const fc::ecc::extended_key_data& data );
|
|
||||||
extended_public_key_type( const fc::ecc::extended_public_key& extpubkey );
|
|
||||||
explicit extended_public_key_type( const std::string& base58str );
|
|
||||||
operator fc::ecc::extended_public_key() const;
|
|
||||||
explicit operator std::string() const;
|
|
||||||
friend bool operator == ( const extended_public_key_type& p1, const fc::ecc::extended_public_key& p2);
|
|
||||||
friend bool operator == ( const extended_public_key_type& p1, const extended_public_key_type& p2);
|
|
||||||
friend bool operator != ( const extended_public_key_type& p1, const extended_public_key_type& p2);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct extended_private_key_type
|
|
||||||
{
|
|
||||||
struct binary_key
|
|
||||||
{
|
|
||||||
binary_key() {}
|
|
||||||
uint32_t check = 0;
|
|
||||||
fc::ecc::extended_key_data data;
|
|
||||||
};
|
|
||||||
|
|
||||||
fc::ecc::extended_key_data key_data;
|
|
||||||
|
|
||||||
extended_private_key_type();
|
|
||||||
extended_private_key_type( const fc::ecc::extended_key_data& data );
|
|
||||||
extended_private_key_type( const fc::ecc::extended_private_key& extprivkey );
|
|
||||||
explicit extended_private_key_type( const std::string& base58str );
|
|
||||||
operator fc::ecc::extended_private_key() const;
|
|
||||||
explicit operator std::string() const;
|
|
||||||
friend bool operator == ( const extended_private_key_type& p1, const fc::ecc::extended_private_key& p2);
|
|
||||||
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);
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef flat_map<std::string, std::string> internationalized_string_type;
|
|
||||||
|
|
||||||
typedef uint32_t bet_multiplier_type;
|
|
||||||
} } // graphene::chain
|
|
||||||
|
|
||||||
namespace fc
|
|
||||||
{
|
|
||||||
void to_variant( const graphene::chain::public_key_type& var, fc::variant& vo, uint32_t max_depth = 2 );
|
|
||||||
void from_variant( const fc::variant& var, graphene::chain::public_key_type& vo, uint32_t max_depth = 2 );
|
|
||||||
void to_variant( const graphene::chain::extended_public_key_type& var, fc::variant& vo, uint32_t max_depth = 2 );
|
|
||||||
void from_variant( const fc::variant& var, graphene::chain::extended_public_key_type& vo, uint32_t max_depth = 2 );
|
|
||||||
void to_variant( const graphene::chain::extended_private_key_type& var, fc::variant& vo, uint32_t max_depth = 2 );
|
|
||||||
void from_variant( const fc::variant& var, graphene::chain::extended_private_key_type& vo, uint32_t max_depth = 2 );
|
|
||||||
}
|
|
||||||
|
|
||||||
FC_REFLECT( graphene::chain::public_key_type, (key_data) )
|
|
||||||
FC_REFLECT( graphene::chain::public_key_type::binary_key, (data)(check) )
|
|
||||||
FC_REFLECT( graphene::chain::extended_public_key_type, (key_data) )
|
|
||||||
FC_REFLECT( graphene::chain::extended_public_key_type::binary_key, (check)(data) )
|
|
||||||
FC_REFLECT( graphene::chain::extended_private_key_type, (key_data) )
|
|
||||||
FC_REFLECT( graphene::chain::extended_private_key_type::binary_key, (check)(data) )
|
|
||||||
|
|
||||||
FC_REFLECT_ENUM( graphene::chain::object_type,
|
|
||||||
(null_object_type)
|
|
||||||
(base_object_type)
|
|
||||||
(account_object_type)
|
|
||||||
(force_settlement_object_type)
|
|
||||||
(asset_object_type)
|
|
||||||
(committee_member_object_type)
|
|
||||||
(witness_object_type)
|
|
||||||
(limit_order_object_type)
|
|
||||||
(call_order_object_type)
|
|
||||||
(custom_object_type)
|
|
||||||
(proposal_object_type)
|
|
||||||
(operation_history_object_type)
|
|
||||||
(withdraw_permission_object_type)
|
|
||||||
(vesting_balance_object_type)
|
|
||||||
(worker_object_type)
|
|
||||||
(balance_object_type)
|
|
||||||
(tournament_object_type)
|
|
||||||
(tournament_details_object_type)
|
|
||||||
(match_object_type)
|
|
||||||
(game_object_type)
|
|
||||||
(sport_object_type)
|
|
||||||
(event_group_object_type)
|
|
||||||
(event_object_type)
|
|
||||||
(betting_market_rules_object_type)
|
|
||||||
(betting_market_group_object_type)
|
|
||||||
(betting_market_object_type)
|
|
||||||
(bet_object_type)
|
|
||||||
(custom_permission_object_type)
|
|
||||||
(custom_account_authority_object_type)
|
|
||||||
(offer_object_type)
|
|
||||||
(nft_metadata_type)
|
|
||||||
(nft_object_type)
|
|
||||||
(OBJECT_TYPE_COUNT)
|
|
||||||
)
|
|
||||||
FC_REFLECT_ENUM( graphene::chain::impl_object_type,
|
|
||||||
(impl_global_property_object_type)
|
|
||||||
(impl_dynamic_global_property_object_type)
|
|
||||||
(impl_reserved0_object_type)
|
|
||||||
(impl_asset_dynamic_data_type)
|
|
||||||
(impl_asset_bitasset_data_type)
|
|
||||||
(impl_account_balance_object_type)
|
|
||||||
(impl_account_statistics_object_type)
|
|
||||||
(impl_transaction_object_type)
|
|
||||||
(impl_block_summary_object_type)
|
|
||||||
(impl_account_transaction_history_object_type)
|
|
||||||
(impl_blinded_balance_object_type)
|
|
||||||
(impl_chain_property_object_type)
|
|
||||||
(impl_witness_schedule_object_type)
|
|
||||||
(impl_budget_record_object_type)
|
|
||||||
(impl_special_authority_object_type)
|
|
||||||
(impl_buyback_object_type)
|
|
||||||
(impl_fba_accumulator_object_type)
|
|
||||||
(impl_asset_dividend_data_type)
|
|
||||||
(impl_pending_dividend_payout_balance_for_holder_object_type)
|
|
||||||
(impl_distributed_dividend_balance_data_type)
|
|
||||||
(impl_betting_market_position_object_type)
|
|
||||||
(impl_global_betting_statistics_object_type)
|
|
||||||
(impl_lottery_balance_object_type)
|
|
||||||
(impl_sweeps_vesting_balance_object_type)
|
|
||||||
(impl_offer_history_object_type)
|
|
||||||
)
|
|
||||||
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::share_type )
|
|
||||||
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::account_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::asset_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::force_settlement_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::committee_member_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::witness_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::limit_order_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::call_order_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::custom_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::proposal_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::operation_history_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::withdraw_permission_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::vesting_balance_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::worker_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::balance_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::sport_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::event_group_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::event_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::betting_market_rules_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::betting_market_group_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::betting_market_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::bet_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::tournament_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::offer_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::global_property_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::dynamic_global_property_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::asset_dynamic_data_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::asset_bitasset_data_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::account_balance_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::account_statistics_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::transaction_obj_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::block_summary_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::account_transaction_history_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::budget_record_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::special_authority_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::buyback_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::fba_accumulator_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::betting_market_position_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::global_betting_statistics_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::tournament_details_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::custom_permission_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::custom_account_authority_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::offer_history_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::nft_metadata_id_type )
|
|
||||||
FC_REFLECT_TYPENAME( graphene::chain::nft_id_type )
|
|
||||||
|
|
||||||
FC_REFLECT( graphene::chain::void_t, )
|
|
||||||
|
|
||||||
FC_REFLECT_ENUM( graphene::chain::asset_issuer_permission_flags,
|
|
||||||
(charge_market_fee)
|
|
||||||
(white_list)
|
|
||||||
(transfer_restricted)
|
|
||||||
(override_authority)
|
|
||||||
(disable_force_settle)
|
|
||||||
(global_settle)
|
|
||||||
(disable_confidential)
|
|
||||||
(witness_fed_asset)
|
|
||||||
(committee_fed_asset)
|
|
||||||
)
|
|
||||||
|
|
@ -23,11 +23,12 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/protocol/special_authority.hpp>
|
#include <graphene/protocol/special_authority.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
class database;
|
class database;
|
||||||
|
using namespace protocol;
|
||||||
|
|
||||||
void evaluate_special_authority( const database& db, const special_authority& auth );
|
void evaluate_special_authority( const database& db, const special_authority& auth );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
#include <graphene/db/object.hpp>
|
#include <graphene/db/object.hpp>
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
|
|
||||||
|
|
@ -63,6 +63,8 @@ typedef generic_index< special_authority_object, special_authority_multi_index_t
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::special_authority_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED(
|
FC_REFLECT_DERIVED(
|
||||||
graphene::chain::special_authority_object,
|
graphene::chain::special_authority_object,
|
||||||
(graphene::db::object),
|
(graphene::db::object),
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,13 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/operations.hpp>
|
#include <graphene/protocol/operations.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene {
|
||||||
|
namespace protocol { class signed_transaction; }
|
||||||
|
namespace chain {
|
||||||
class database;
|
class database;
|
||||||
struct signed_transaction;
|
using protocol::signed_transaction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Place holder for state tracked while processing a transaction. This class provides helper methods that are
|
* Place holder for state tracked while processing a transaction. This class provides helper methods that are
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/protocol/transaction.hpp>
|
#include <graphene/protocol/transaction.hpp>
|
||||||
#include <graphene/db/index.hpp>
|
#include <graphene/db/index.hpp>
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
|
|
||||||
|
|
@ -55,7 +55,6 @@ namespace graphene { namespace chain {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct by_expiration;
|
struct by_expiration;
|
||||||
struct by_id;
|
|
||||||
struct by_trx_id;
|
struct by_trx_id;
|
||||||
typedef multi_index_container<
|
typedef multi_index_container<
|
||||||
transaction_object,
|
transaction_object,
|
||||||
|
|
@ -69,6 +68,8 @@ namespace graphene { namespace chain {
|
||||||
typedef generic_index<transaction_object, transaction_multi_index_type> transaction_index;
|
typedef generic_index<transaction_object, transaction_multi_index_type> transaction_index;
|
||||||
} }
|
} }
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::transaction_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::transaction_object, (graphene::db::object), (trx)(trx_id) )
|
FC_REFLECT_DERIVED( graphene::chain::transaction_object, (graphene::db::object), (trx)(trx_id) )
|
||||||
|
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::transaction_object )
|
GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::transaction_object )
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/operations.hpp>
|
#include <graphene/protocol/operations.hpp>
|
||||||
#include <graphene/chain/evaluator.hpp>
|
#include <graphene/chain/evaluator.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
106
libraries/chain/include/graphene/chain/types.hpp
Normal file
106
libraries/chain/include/graphene/chain/types.hpp
Normal file
|
|
@ -0,0 +1,106 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2015 Cryptonomex, Inc., and contributors.
|
||||||
|
*
|
||||||
|
* The MIT License
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <graphene/protocol/types.hpp>
|
||||||
|
|
||||||
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
|
using namespace graphene::protocol;
|
||||||
|
|
||||||
|
enum impl_object_type {
|
||||||
|
impl_global_property_object_type,
|
||||||
|
impl_dynamic_global_property_object_type,
|
||||||
|
impl_reserved0_object_type, // formerly index_meta_object_type, TODO: delete me
|
||||||
|
impl_asset_dynamic_data_type,
|
||||||
|
impl_asset_bitasset_data_type,
|
||||||
|
impl_account_balance_object_type,
|
||||||
|
impl_account_statistics_object_type,
|
||||||
|
impl_transaction_object_type,
|
||||||
|
impl_block_summary_object_type,
|
||||||
|
impl_account_transaction_history_object_type,
|
||||||
|
impl_blinded_balance_object_type,
|
||||||
|
impl_chain_property_object_type,
|
||||||
|
impl_witness_schedule_object_type,
|
||||||
|
impl_budget_record_object_type,
|
||||||
|
impl_special_authority_object_type,
|
||||||
|
impl_buyback_object_type,
|
||||||
|
impl_fba_accumulator_object_type,
|
||||||
|
impl_collateral_bid_object_type
|
||||||
|
};
|
||||||
|
|
||||||
|
using global_property_id_type = object_id<implementation_ids, impl_global_property_object_type>;
|
||||||
|
using dynamic_global_property_id_type = object_id<implementation_ids, impl_dynamic_global_property_object_type>;
|
||||||
|
using asset_dynamic_data_id_type = object_id<implementation_ids, impl_asset_dynamic_data_type>;
|
||||||
|
using asset_bitasset_data_id_type = object_id<implementation_ids, impl_asset_bitasset_data_type>;
|
||||||
|
using account_balance_id_type = object_id<implementation_ids, impl_account_balance_object_type>;
|
||||||
|
using account_statistics_id_type = object_id<implementation_ids, impl_account_statistics_object_type>;
|
||||||
|
using transaction_obj_id_type = object_id<implementation_ids, impl_transaction_object_type>;
|
||||||
|
using block_summary_id_type = object_id<implementation_ids, impl_block_summary_object_type>;
|
||||||
|
using account_transaction_history_id_type = object_id<implementation_ids, impl_account_transaction_history_object_type>;
|
||||||
|
using chain_property_id_type = object_id<implementation_ids, impl_chain_property_object_type>;
|
||||||
|
using witness_schedule_id_type = object_id<implementation_ids, impl_witness_schedule_object_type>;
|
||||||
|
using budget_record_id_type = object_id<implementation_ids, impl_budget_record_object_type>;
|
||||||
|
using blinded_balance_id_type = object_id<implementation_ids, impl_blinded_balance_object_type>;
|
||||||
|
using special_authority_id_type = object_id<implementation_ids, impl_special_authority_object_type>;
|
||||||
|
using buyback_id_type = object_id<implementation_ids, impl_buyback_object_type>;
|
||||||
|
using fba_accumulator_id_type = object_id<implementation_ids, impl_fba_accumulator_object_type>;
|
||||||
|
using collateral_bid_id_type = object_id<implementation_ids, impl_collateral_bid_object_type>;
|
||||||
|
|
||||||
|
} }
|
||||||
|
|
||||||
|
FC_REFLECT_ENUM(graphene::chain::impl_object_type,
|
||||||
|
(impl_global_property_object_type)
|
||||||
|
(impl_dynamic_global_property_object_type)
|
||||||
|
(impl_reserved0_object_type)
|
||||||
|
(impl_asset_dynamic_data_type)
|
||||||
|
(impl_asset_bitasset_data_type)
|
||||||
|
(impl_account_balance_object_type)
|
||||||
|
(impl_account_statistics_object_type)
|
||||||
|
(impl_transaction_object_type)
|
||||||
|
(impl_block_summary_object_type)
|
||||||
|
(impl_account_transaction_history_object_type)
|
||||||
|
(impl_blinded_balance_object_type)
|
||||||
|
(impl_chain_property_object_type)
|
||||||
|
(impl_witness_schedule_object_type)
|
||||||
|
(impl_budget_record_object_type)
|
||||||
|
(impl_special_authority_object_type)
|
||||||
|
(impl_buyback_object_type)
|
||||||
|
(impl_fba_accumulator_object_type)
|
||||||
|
(impl_collateral_bid_object_type))
|
||||||
|
|
||||||
|
FC_REFLECT_TYPENAME(graphene::chain::global_property_id_type)
|
||||||
|
FC_REFLECT_TYPENAME(graphene::chain::dynamic_global_property_id_type)
|
||||||
|
FC_REFLECT_TYPENAME(graphene::chain::asset_dynamic_data_id_type)
|
||||||
|
FC_REFLECT_TYPENAME(graphene::chain::asset_bitasset_data_id_type)
|
||||||
|
FC_REFLECT_TYPENAME(graphene::chain::account_balance_id_type)
|
||||||
|
FC_REFLECT_TYPENAME(graphene::chain::account_statistics_id_type)
|
||||||
|
FC_REFLECT_TYPENAME(graphene::chain::transaction_obj_id_type)
|
||||||
|
FC_REFLECT_TYPENAME(graphene::chain::block_summary_id_type)
|
||||||
|
FC_REFLECT_TYPENAME(graphene::chain::account_transaction_history_id_type)
|
||||||
|
FC_REFLECT_TYPENAME(graphene::chain::budget_record_id_type)
|
||||||
|
FC_REFLECT_TYPENAME(graphene::chain::special_authority_id_type)
|
||||||
|
FC_REFLECT_TYPENAME(graphene::chain::buyback_id_type)
|
||||||
|
FC_REFLECT_TYPENAME(graphene::chain::fba_accumulator_id_type)
|
||||||
|
FC_REFLECT_TYPENAME(graphene::chain::collateral_bid_id_type)
|
||||||
|
|
@ -23,9 +23,7 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/protocol/asset.hpp>
|
#include <graphene/protocol/asset.hpp>
|
||||||
#include <graphene/chain/protocol/vesting.hpp>
|
|
||||||
|
|
||||||
#include <graphene/db/object.hpp>
|
#include <graphene/db/object.hpp>
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
|
|
||||||
|
|
@ -37,6 +35,7 @@
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
using namespace graphene::db;
|
using namespace graphene::db;
|
||||||
|
using namespace graphene::protocol;
|
||||||
|
|
||||||
struct vesting_policy_context
|
struct vesting_policy_context
|
||||||
{
|
{
|
||||||
|
|
@ -210,6 +209,8 @@ namespace graphene { namespace chain {
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::vesting_balance_object)
|
||||||
|
|
||||||
FC_REFLECT(graphene::chain::linear_vesting_policy,
|
FC_REFLECT(graphene::chain::linear_vesting_policy,
|
||||||
(begin_timestamp)
|
(begin_timestamp)
|
||||||
(vesting_cliff_seconds)
|
(vesting_cliff_seconds)
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/chain/protocol/authority.hpp>
|
#include <graphene/protocol/authority.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/authority.hpp>
|
#include <graphene/protocol/authority.hpp>
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
#include <boost/multi_index/composite_key.hpp>
|
#include <boost/multi_index/composite_key.hpp>
|
||||||
|
|
||||||
|
|
@ -105,6 +105,8 @@ namespace graphene { namespace chain {
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::withdraw_permission_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::withdraw_permission_object, (graphene::db::object),
|
FC_REFLECT_DERIVED( graphene::chain::withdraw_permission_object, (graphene::db::object),
|
||||||
(withdraw_from_account)
|
(withdraw_from_account)
|
||||||
(authorized_account)
|
(authorized_account)
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/asset.hpp>
|
#include <graphene/protocol/asset.hpp>
|
||||||
#include <graphene/db/object.hpp>
|
#include <graphene/db/object.hpp>
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
|
|
||||||
|
|
@ -70,6 +70,8 @@ namespace graphene { namespace chain {
|
||||||
using witness_index = generic_index<witness_object, witness_multi_index_type>;
|
using witness_index = generic_index<witness_object, witness_multi_index_type>;
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::witness_object)
|
||||||
|
|
||||||
FC_REFLECT_DERIVED( graphene::chain::witness_object, (graphene::db::object),
|
FC_REFLECT_DERIVED( graphene::chain::witness_object, (graphene::db::object),
|
||||||
(witness_account)
|
(witness_account)
|
||||||
(last_aslot)
|
(last_aslot)
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
#include <graphene/db/object.hpp>
|
#include <graphene/db/object.hpp>
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
#include <graphene/chain/witness_scheduler.hpp>
|
#include <graphene/chain/witness_scheduler.hpp>
|
||||||
|
|
@ -73,6 +73,7 @@ class witness_schedule_object : public graphene::db::abstract_object<witness_sch
|
||||||
|
|
||||||
} }
|
} }
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::witness_schedule_object)
|
||||||
|
|
||||||
FC_REFLECT( graphene::chain::witness_scheduler,
|
FC_REFLECT( graphene::chain::witness_scheduler,
|
||||||
(_turns)
|
(_turns)
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,12 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
|
||||||
#include <graphene/db/generic_index.hpp>
|
#include <graphene/db/generic_index.hpp>
|
||||||
#include <graphene/chain/protocol/vote.hpp>
|
#include <graphene/protocol/vote.hpp>
|
||||||
|
#include <graphene/chain/types.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
class database;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup worker_types Implementations of the various worker types in the system
|
* @defgroup worker_types Implementations of the various worker types in the system
|
||||||
|
|
@ -159,6 +160,8 @@ using worker_index = generic_index<worker_object, worker_object_multi_index_type
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::chain
|
||||||
|
|
||||||
|
MAP_OBJECT_ID_TO_TYPE(graphene::chain::worker_object)
|
||||||
|
|
||||||
FC_REFLECT( graphene::chain::refund_worker_type, (total_burned) )
|
FC_REFLECT( graphene::chain::refund_worker_type, (total_burned) )
|
||||||
FC_REFLECT( graphene::chain::vesting_balance_worker_type, (balance) )
|
FC_REFLECT( graphene::chain::vesting_balance_worker_type, (balance) )
|
||||||
FC_REFLECT( graphene::chain::burn_worker_type, (total_burned) )
|
FC_REFLECT( graphene::chain::burn_worker_type, (total_burned) )
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
#include <graphene/chain/hardfork.hpp>
|
#include <graphene/chain/hardfork.hpp>
|
||||||
#include <graphene/chain/is_authorized_asset.hpp>
|
#include <graphene/chain/is_authorized_asset.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/protocol/market.hpp>
|
#include <graphene/protocol/market.hpp>
|
||||||
|
|
||||||
#include <fc/uint128.hpp>
|
#include <fc/uint128.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
#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>();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
|
|
@ -22,31 +22,13 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <graphene/chain/protocol/special_authority.hpp>
|
#include <graphene/chain/special_authority.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
|
|
||||||
#include <fc/io/raw.hpp>
|
#include <fc/io/raw.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
struct special_authority_validate_visitor
|
|
||||||
{
|
|
||||||
typedef void result_type;
|
|
||||||
|
|
||||||
void operator()( const no_special_authority& a ) {}
|
|
||||||
|
|
||||||
void operator()( const top_holders_special_authority& a )
|
|
||||||
{
|
|
||||||
FC_ASSERT( a.num_top_holders > 0 );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
void validate_special_authority( const special_authority& a )
|
|
||||||
{
|
|
||||||
special_authority_validate_visitor vtor;
|
|
||||||
a.visit( vtor );
|
|
||||||
}
|
|
||||||
|
|
||||||
struct special_authority_evaluate_visitor
|
struct special_authority_evaluate_visitor
|
||||||
{
|
{
|
||||||
typedef void result_type;
|
typedef void result_type;
|
||||||
|
|
@ -57,7 +39,7 @@ struct special_authority_evaluate_visitor
|
||||||
|
|
||||||
void operator()( const top_holders_special_authority& a )
|
void operator()( const top_holders_special_authority& a )
|
||||||
{
|
{
|
||||||
a.asset(db); // require asset to exist
|
db.get(a.asset); // require asset to exist
|
||||||
}
|
}
|
||||||
|
|
||||||
const database& db;
|
const database& db;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
#include <graphene/chain/committee_member_object.hpp>
|
#include <graphene/chain/committee_member_object.hpp>
|
||||||
#include <graphene/chain/account_object.hpp>
|
#include <graphene/chain/account_object.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
#include <graphene/chain/protocol/vote.hpp>
|
#include <graphene/protocol/vote.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
|
|
@ -40,7 +40,7 @@ object_id_type witness_create_evaluator::do_apply( const witness_create_operatio
|
||||||
{ try {
|
{ try {
|
||||||
vote_id_type vote_id;
|
vote_id_type vote_id;
|
||||||
db().modify(db().get_global_properties(), [&vote_id](global_property_object& p) {
|
db().modify(db().get_global_properties(), [&vote_id](global_property_object& p) {
|
||||||
vote_id = get_next_vote_id(p, vote_id_type::witness);
|
vote_id = vote_id_type(vote_id_type::witness, p.next_available_vote_id++);
|
||||||
});
|
});
|
||||||
|
|
||||||
const auto& new_witness_object = db().create<witness_object>( [&]( witness_object& obj ) {
|
const auto& new_witness_object = db().create<witness_object>( [&]( witness_object& obj ) {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
#include <graphene/chain/vesting_balance_object.hpp>
|
#include <graphene/chain/vesting_balance_object.hpp>
|
||||||
#include <graphene/chain/worker_object.hpp>
|
#include <graphene/chain/worker_object.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/protocol/vote.hpp>
|
#include <graphene/protocol/vote.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
|
|
@ -84,8 +84,8 @@ object_id_type worker_create_evaluator::do_apply(const worker_create_evaluator::
|
||||||
database& d = db();
|
database& d = db();
|
||||||
vote_id_type for_id, against_id;
|
vote_id_type for_id, against_id;
|
||||||
d.modify(d.get_global_properties(), [&for_id, &against_id](global_property_object& p) {
|
d.modify(d.get_global_properties(), [&for_id, &against_id](global_property_object& p) {
|
||||||
for_id = get_next_vote_id(p, vote_id_type::worker);
|
for_id = vote_id_type(vote_id_type::worker, p.next_available_vote_id++);
|
||||||
against_id = get_next_vote_id(p, vote_id_type::worker);
|
against_id = vote_id_type(vote_id_type::worker, p.next_available_vote_id++);
|
||||||
});
|
});
|
||||||
|
|
||||||
return d.create<worker_object>([&](worker_object& w) {
|
return d.create<worker_object>([&](worker_object& w) {
|
||||||
|
|
|
||||||
|
|
@ -33,3 +33,4 @@ namespace graphene { namespace db {
|
||||||
typedef std::shared_ptr<peer_ram> peer_ram_ptr;
|
typedef std::shared_ptr<peer_ram> peer_ram_ptr;
|
||||||
|
|
||||||
}} // namespace graphene::db
|
}} // namespace graphene::db
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
#include <boost/multi_index/ordered_index.hpp>
|
#include <boost/multi_index/ordered_index.hpp>
|
||||||
#include <boost/multi_index/mem_fun.hpp>
|
#include <boost/multi_index/mem_fun.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace db {
|
||||||
|
|
||||||
using boost::multi_index_container;
|
using boost::multi_index_container;
|
||||||
using namespace boost::multi_index;
|
using namespace boost::multi_index;
|
||||||
|
|
|
||||||
|
|
@ -121,11 +121,15 @@ namespace graphene { namespace db {
|
||||||
return static_cast<const T*>(obj);
|
return static_cast<const T*>(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<uint8_t SpaceID, uint8_t TypeID, typename T>
|
template<uint8_t SpaceID, uint8_t TypeID>
|
||||||
const T* find( object_id<SpaceID,TypeID,T> id )const { return find<T>(id); }
|
auto find( object_id<SpaceID,TypeID> id )const -> const typename object_downcast<decltype(id)>::type* {
|
||||||
|
return find<typename object_downcast<decltype(id)>::type>(id);
|
||||||
|
}
|
||||||
|
|
||||||
template<uint8_t SpaceID, uint8_t TypeID, typename T>
|
template<uint8_t SpaceID, uint8_t TypeID>
|
||||||
const T& get( object_id<SpaceID,TypeID,T> id )const { return get<T>(id); }
|
auto get( object_id<SpaceID,TypeID> id )const -> const typename object_downcast<decltype(id)>::type& {
|
||||||
|
return get<typename object_downcast<decltype(id)>::type>(id);
|
||||||
|
}
|
||||||
|
|
||||||
template<typename IndexType>
|
template<typename IndexType>
|
||||||
IndexType* add_index()
|
IndexType* add_index()
|
||||||
|
|
|
||||||
|
|
@ -93,14 +93,23 @@ namespace graphene { namespace db {
|
||||||
class object;
|
class object;
|
||||||
class object_database;
|
class object_database;
|
||||||
|
|
||||||
template<uint8_t SpaceID, uint8_t TypeID, typename T = object>
|
/// This template is used to downcast a generic object type to a specific xyz_object type.
|
||||||
|
template<typename ObjectID>
|
||||||
|
struct object_downcast { using type = object; };
|
||||||
|
// This macro specializes the above template for a specific xyz_object type
|
||||||
|
#define MAP_OBJECT_ID_TO_TYPE(OBJECT) \
|
||||||
|
namespace graphene { namespace db { \
|
||||||
|
template<> \
|
||||||
|
struct object_downcast<graphene::db::object_id<OBJECT::space_id, OBJECT::type_id>> { using type = OBJECT; }; \
|
||||||
|
} }
|
||||||
|
|
||||||
|
template<uint8_t SpaceID, uint8_t TypeID>
|
||||||
struct object_id
|
struct object_id
|
||||||
{
|
{
|
||||||
typedef T type;
|
|
||||||
static const uint8_t space_id = SpaceID;
|
static const uint8_t space_id = SpaceID;
|
||||||
static const uint8_t type_id = TypeID;
|
static const uint8_t type_id = TypeID;
|
||||||
|
|
||||||
object_id(){}
|
object_id() = default;
|
||||||
object_id( unsigned_int i ):instance(i){}
|
object_id( unsigned_int i ):instance(i){}
|
||||||
explicit object_id( uint64_t i ):instance(i)
|
explicit object_id( uint64_t i ):instance(i)
|
||||||
{
|
{
|
||||||
|
|
@ -117,14 +126,18 @@ namespace graphene { namespace db {
|
||||||
explicit operator uint64_t()const { return object_id_type( *this ).number; }
|
explicit operator uint64_t()const { return object_id_type( *this ).number; }
|
||||||
|
|
||||||
template<typename DB>
|
template<typename DB>
|
||||||
const T& operator()(const DB& db)const { return db.get(*this); }
|
auto operator()(const DB& db)const -> const decltype(db.get(*this))& { return db.get(*this); }
|
||||||
|
|
||||||
friend bool operator == ( const object_id& a, const object_id& b ) { return a.instance == b.instance; }
|
friend bool operator == ( const object_id& a, const object_id& b ) { return a.instance == b.instance; }
|
||||||
friend bool operator != ( const object_id& a, const object_id& b ) { return a.instance != b.instance; }
|
friend bool operator != ( const object_id& a, const object_id& b ) { return a.instance != b.instance; }
|
||||||
friend bool operator == ( const object_id_type& a, const object_id& b ) { return a == object_id_type(b); }
|
friend bool operator == ( const object_id_type& a, const object_id& b ) { return a == object_id_type(b); }
|
||||||
friend bool operator != ( const object_id_type& a, const object_id& b ) { return a != object_id_type(b); }
|
friend bool operator != ( const object_id_type& a, const object_id& b ) { return a != object_id_type(b); }
|
||||||
friend bool operator == ( const object_id& b, const object_id_type& a ) { return a == object_id_type(b); }
|
friend bool operator == ( const object_id& a, const object_id_type& b ) { return object_id_type(a) == b; }
|
||||||
friend bool operator != ( const object_id& b, const object_id_type& a ) { return a != object_id_type(b); }
|
friend bool operator != ( const object_id& a, const object_id_type& b ) { return object_id_type(a) != b; }
|
||||||
|
friend bool operator == ( const object_id& a, const fc::unsigned_int& b ) { return a.instance == b; }
|
||||||
|
friend bool operator != ( const object_id& a, const fc::unsigned_int& b ) { return a.instance != b; }
|
||||||
|
friend bool operator == ( const fc::unsigned_int& a, const object_id& b ) { return a == b.instance; }
|
||||||
|
friend bool operator != ( const fc::unsigned_int& a, const object_id& b ) { return a != b.instance; }
|
||||||
|
|
||||||
friend bool operator < ( const object_id& a, const object_id& b ) { return a.instance.value < b.instance.value; }
|
friend bool operator < ( const object_id& a, const object_id& b ) { return a.instance.value < b.instance.value; }
|
||||||
friend bool operator > ( const object_id& a, const object_id& b ) { return a.instance.value > b.instance.value; }
|
friend bool operator > ( const object_id& a, const object_id& b ) { return a.instance.value > b.instance.value; }
|
||||||
|
|
@ -140,8 +153,8 @@ FC_REFLECT( graphene::db::object_id_type, (number) )
|
||||||
|
|
||||||
// REFLECT object_id manually because it has 2 template params
|
// REFLECT object_id manually because it has 2 template params
|
||||||
namespace fc {
|
namespace fc {
|
||||||
template<uint8_t SpaceID, uint8_t TypeID, typename T>
|
template<uint8_t SpaceID, uint8_t TypeID>
|
||||||
struct get_typename<graphene::db::object_id<SpaceID,TypeID,T>>
|
struct get_typename<graphene::db::object_id<SpaceID,TypeID>>
|
||||||
{
|
{
|
||||||
static const char* name() {
|
static const char* name() {
|
||||||
return typeid(get_typename).name();
|
return typeid(get_typename).name();
|
||||||
|
|
@ -150,12 +163,11 @@ struct get_typename<graphene::db::object_id<SpaceID,TypeID,T>>
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<uint8_t SpaceID, uint8_t TypeID, typename T>
|
template<uint8_t SpaceID, uint8_t TypeID>
|
||||||
struct reflector<graphene::db::object_id<SpaceID,TypeID,T> >
|
struct reflector<graphene::db::object_id<SpaceID,TypeID> >
|
||||||
{
|
{
|
||||||
typedef graphene::db::object_id<SpaceID,TypeID,T> type;
|
typedef graphene::db::object_id<SpaceID,TypeID> type;
|
||||||
typedef fc::true_type is_defined;
|
typedef std::true_type is_defined;
|
||||||
typedef fc::false_type is_enum;
|
|
||||||
enum member_count_enum {
|
enum member_count_enum {
|
||||||
local_member_count = 1,
|
local_member_count = 1,
|
||||||
total_member_count = 1
|
total_member_count = 1
|
||||||
|
|
@ -190,13 +202,13 @@ struct reflector<graphene::db::object_id<SpaceID,TypeID,T> >
|
||||||
FC_ASSERT( type_id <= 0xff );
|
FC_ASSERT( type_id <= 0xff );
|
||||||
vo.number |= (space_id << 56) | (type_id << 48);
|
vo.number |= (space_id << 56) | (type_id << 48);
|
||||||
} FC_CAPTURE_AND_RETHROW( (var) ) }
|
} FC_CAPTURE_AND_RETHROW( (var) ) }
|
||||||
template<uint8_t SpaceID, uint8_t TypeID, typename T>
|
template<uint8_t SpaceID, uint8_t TypeID>
|
||||||
void to_variant( const graphene::db::object_id<SpaceID,TypeID,T>& var, fc::variant& vo, uint32_t max_depth = 1 )
|
void to_variant( const graphene::db::object_id<SpaceID,TypeID>& var, fc::variant& vo, uint32_t max_depth = 1 )
|
||||||
{
|
{
|
||||||
vo = fc::to_string(SpaceID) + "." + fc::to_string(TypeID) + "." + fc::to_string(var.instance.value);
|
vo = fc::to_string(SpaceID) + "." + fc::to_string(TypeID) + "." + fc::to_string(var.instance.value);
|
||||||
}
|
}
|
||||||
template<uint8_t SpaceID, uint8_t TypeID, typename T>
|
template<uint8_t SpaceID, uint8_t TypeID>
|
||||||
void from_variant( const fc::variant& var, graphene::db::object_id<SpaceID,TypeID,T>& vo, uint32_t max_depth = 1 )
|
void from_variant( const fc::variant& var, graphene::db::object_id<SpaceID,TypeID>& vo, uint32_t max_depth = 1 )
|
||||||
{ try {
|
{ try {
|
||||||
const auto& s = var.get_string();
|
const auto& s = var.get_string();
|
||||||
auto first_dot = s.find('.');
|
auto first_dot = s.find('.');
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ ${generated_file_banner}
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
#include <graphene/egenesis/egenesis.hpp>
|
#include <graphene/egenesis/egenesis.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace egenesis {
|
namespace graphene { namespace egenesis {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ ${generated_file_banner}
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
#include <graphene/egenesis/egenesis.hpp>
|
#include <graphene/egenesis/egenesis.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace egenesis {
|
namespace graphene { namespace egenesis {
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,10 @@
|
||||||
#include <fc/io/fstream.hpp>
|
#include <fc/io/fstream.hpp>
|
||||||
#include <fc/io/json.hpp>
|
#include <fc/io/json.hpp>
|
||||||
#include <graphene/chain/genesis_state.hpp>
|
#include <graphene/chain/genesis_state.hpp>
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
|
|
||||||
// we need to include the world in order to serialize fee_parameters
|
// we need to include the world in order to serialize fee_parameters
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
|
|
||||||
using namespace graphene::chain;
|
using namespace graphene::chain;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <fc/crypto/sha256.hpp>
|
#include <fc/crypto/sha256.hpp>
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
#include <graphene/chain/genesis_state.hpp>
|
#include <graphene/chain/genesis_state.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace egenesis {
|
namespace graphene { namespace egenesis {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ set(SOURCES node.cpp
|
||||||
add_library( graphene_net ${SOURCES} ${HEADERS} )
|
add_library( graphene_net ${SOURCES} ${HEADERS} )
|
||||||
|
|
||||||
target_link_libraries( graphene_net
|
target_link_libraries( graphene_net
|
||||||
PUBLIC fc graphene_db )
|
PUBLIC fc graphene_db graphene_protocol )
|
||||||
target_include_directories( graphene_net
|
target_include_directories( graphene_net
|
||||||
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../chain/include" "${CMAKE_CURRENT_BINARY_DIR}/../chain/include"
|
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../chain/include" "${CMAKE_CURRENT_BINARY_DIR}/../chain/include"
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <graphene/net/config.hpp>
|
#include <graphene/net/config.hpp>
|
||||||
#include <graphene/chain/protocol/block.hpp>
|
#include <graphene/protocol/block.hpp>
|
||||||
|
|
||||||
#include <fc/crypto/ripemd160.hpp>
|
#include <fc/crypto/ripemd160.hpp>
|
||||||
#include <fc/crypto/elliptic.hpp>
|
#include <fc/crypto/elliptic.hpp>
|
||||||
|
|
@ -40,10 +40,10 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace graphene { namespace net {
|
namespace graphene { namespace net {
|
||||||
using graphene::chain::signed_transaction;
|
using graphene::protocol::signed_transaction;
|
||||||
using graphene::chain::block_id_type;
|
using graphene::protocol::block_id_type;
|
||||||
using graphene::chain::transaction_id_type;
|
using graphene::protocol::transaction_id_type;
|
||||||
using graphene::chain::signed_block;
|
using graphene::protocol::signed_block;
|
||||||
|
|
||||||
typedef fc::ecc::public_key_data node_id_t;
|
typedef fc::ecc::public_key_data node_id_t;
|
||||||
typedef fc::ripemd160 item_hash_t;
|
typedef fc::ripemd160 item_hash_t;
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <boost/endian/buffers.hpp>
|
#include <boost/endian/buffers.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
|
|
||||||
#include <fc/io/varint.hpp>
|
#include <fc/io/varint.hpp>
|
||||||
#include <fc/network/ip.hpp>
|
#include <fc/network/ip.hpp>
|
||||||
|
|
|
||||||
|
|
@ -27,14 +27,14 @@
|
||||||
#include <graphene/net/message.hpp>
|
#include <graphene/net/message.hpp>
|
||||||
#include <graphene/net/peer_database.hpp>
|
#include <graphene/net/peer_database.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
namespace graphene { namespace net {
|
namespace graphene { namespace net {
|
||||||
|
|
||||||
using fc::variant_object;
|
using fc::variant_object;
|
||||||
using graphene::chain::chain_id_type;
|
using graphene::protocol::chain_id_type;
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
@ -272,8 +272,8 @@ namespace graphene { namespace net {
|
||||||
|
|
||||||
void set_advanced_node_parameters(const fc::variant_object& params);
|
void set_advanced_node_parameters(const fc::variant_object& params);
|
||||||
fc::variant_object get_advanced_node_parameters();
|
fc::variant_object get_advanced_node_parameters();
|
||||||
message_propagation_data get_transaction_propagation_data(const graphene::chain::transaction_id_type& transaction_id);
|
message_propagation_data get_transaction_propagation_data(const graphene::protocol::transaction_id_type& transaction_id);
|
||||||
message_propagation_data get_block_propagation_data(const graphene::chain::block_id_type& block_id);
|
message_propagation_data get_block_propagation_data(const graphene::protocol::block_id_type& block_id);
|
||||||
node_id_t get_node_id() const;
|
node_id_t get_node_id() const;
|
||||||
void set_allowed_peers(const std::vector<node_id_t>& allowed_peers);
|
void set_allowed_peers(const std::vector<node_id_t>& allowed_peers);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <boost/iterator/iterator_facade.hpp>
|
#include <boost/iterator/iterator_facade.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
|
|
||||||
#include <fc/network/ip.hpp>
|
#include <fc/network/ip.hpp>
|
||||||
#include <fc/time.hpp>
|
#include <fc/time.hpp>
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,10 @@
|
||||||
#include <graphene/net/exceptions.hpp>
|
#include <graphene/net/exceptions.hpp>
|
||||||
|
|
||||||
#include <graphene/chain/config.hpp>
|
#include <graphene/chain/config.hpp>
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
// Nasty hack: A circular dependency around fee_schedule is resolved by fwd-declaring it and using a shared_ptr
|
||||||
|
// to it in chain_parameters, which is used in an operation and thus must be serialized by the net library.
|
||||||
|
// Resolving that forward declaration doesn't happen until now:
|
||||||
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
|
|
||||||
#include <fc/git_revision.hpp>
|
#include <fc/git_revision.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
#include <graphene/net/exceptions.hpp>
|
#include <graphene/net/exceptions.hpp>
|
||||||
#include <graphene/net/config.hpp>
|
#include <graphene/net/config.hpp>
|
||||||
#include <graphene/chain/config.hpp>
|
#include <graphene/chain/config.hpp>
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
|
|
||||||
#include <fc/io/raw_fwd.hpp>
|
#include <fc/io/raw_fwd.hpp>
|
||||||
#include <fc/thread/thread.hpp>
|
#include <fc/thread/thread.hpp>
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ class affiliate_reward_index : public secondary_index
|
||||||
|
|
||||||
} } //graphene::account_history
|
} } //graphene::account_history
|
||||||
|
|
||||||
/*struct by_id;
|
/*
|
||||||
struct by_seq;
|
struct by_seq;
|
||||||
struct by_op;
|
struct by_op;
|
||||||
typedef boost::multi_index_container<
|
typedef boost::multi_index_container<
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include <graphene/app/plugin.hpp>
|
#include <graphene/app/plugin.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
|
|
||||||
#include <fc/thread/future.hpp>
|
#include <fc/thread/future.hpp>
|
||||||
#include <fc/container/flat.hpp>
|
#include <fc/container/flat.hpp>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <graphene/delayed_node/delayed_node_plugin.hpp>
|
#include <graphene/delayed_node/delayed_node_plugin.hpp>
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
#include <graphene/chain/database.hpp>
|
||||||
#include <graphene/app/api.hpp>
|
#include <graphene/app/api.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
#include <graphene/chain/evaluator.hpp>
|
#include <graphene/chain/evaluator.hpp>
|
||||||
#include <graphene/chain/operation_history_object.hpp>
|
#include <graphene/chain/operation_history_object.hpp>
|
||||||
#include <graphene/chain/transaction_evaluation_state.hpp>
|
#include <graphene/chain/transaction_evaluation_state.hpp>
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
|
|
||||||
#include <fc/thread/thread.hpp>
|
#include <fc/thread/thread.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
54
libraries/protocol/CMakeLists.txt
Normal file
54
libraries/protocol/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
file(GLOB HEADERS "include/graphene/protocol/*.hpp")
|
||||||
|
|
||||||
|
list(APPEND SOURCES account.cpp
|
||||||
|
assert.cpp
|
||||||
|
asset_ops.cpp
|
||||||
|
block.cpp
|
||||||
|
confidential.cpp
|
||||||
|
chain_parameters.cpp
|
||||||
|
fee_schedule.cpp
|
||||||
|
memo.cpp
|
||||||
|
proposal.cpp
|
||||||
|
transfer.cpp
|
||||||
|
vote.cpp
|
||||||
|
witness.cpp
|
||||||
|
address.cpp
|
||||||
|
asset.cpp
|
||||||
|
authority.cpp
|
||||||
|
special_authority.cpp
|
||||||
|
committee_member.cpp
|
||||||
|
custom.cpp
|
||||||
|
market.cpp
|
||||||
|
operations.cpp
|
||||||
|
pts_address.cpp
|
||||||
|
transaction.cpp
|
||||||
|
types.cpp
|
||||||
|
withdraw_permission.cpp
|
||||||
|
worker.cpp
|
||||||
|
betting_market.cpp
|
||||||
|
competitor.cpp
|
||||||
|
event.cpp
|
||||||
|
event_group.cpp
|
||||||
|
lottery_ops.cpp
|
||||||
|
small_ops.cpp
|
||||||
|
sport.cpp
|
||||||
|
tournament.cpp
|
||||||
|
small_ops.cpp
|
||||||
|
custom_permission.cpp
|
||||||
|
custom_account_authority.cpp
|
||||||
|
offer.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
add_library( graphene_protocol ${SOURCES} ${HEADERS} )
|
||||||
|
target_link_libraries( graphene_protocol graphene_db fc )
|
||||||
|
target_include_directories( graphene_protocol PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
|
||||||
|
|
||||||
|
install( TARGETS
|
||||||
|
graphene_protocol
|
||||||
|
|
||||||
|
RUNTIME DESTINATION bin
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
ARCHIVE DESTINATION lib
|
||||||
|
)
|
||||||
|
install( FILES ${HEADERS} DESTINATION "include/graphene/protocol" )
|
||||||
|
|
@ -21,13 +21,9 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include <graphene/chain/protocol/account.hpp>
|
#include <graphene/protocol/account.hpp>
|
||||||
#include <graphene/chain/hardfork.hpp>
|
|
||||||
#include <boost/algorithm/string/predicate.hpp>
|
|
||||||
|
|
||||||
#include <fc/io/raw.hpp>
|
namespace graphene { namespace protocol {
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Names must comply with the following grammar (RFC 1035):
|
* Names must comply with the following grammar (RFC 1035):
|
||||||
|
|
@ -322,16 +318,16 @@ void account_transfer_operation::validate()const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::protocol
|
||||||
|
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_options )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::account_options )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_create_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::account_create_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_whitelist_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::account_whitelist_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_update_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::account_update_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_upgrade_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::account_upgrade_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_transfer_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::account_transfer_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_create_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::account_create_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_whitelist_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::account_whitelist_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_update_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::account_update_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_upgrade_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::account_upgrade_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_transfer_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::account_transfer_operation )
|
||||||
|
|
@ -21,17 +21,13 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include <graphene/chain/protocol/types.hpp>
|
#include <graphene/protocol/types.hpp>
|
||||||
#include <graphene/chain/protocol/address.hpp>
|
#include <graphene/protocol/address.hpp>
|
||||||
#include <fc/crypto/elliptic.hpp>
|
#include <fc/crypto/elliptic.hpp>
|
||||||
#include <fc/crypto/base58.hpp>
|
#include <fc/crypto/base58.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include <fc/io/raw.hpp>
|
namespace graphene { namespace protocol {
|
||||||
|
|
||||||
namespace graphene {
|
|
||||||
namespace chain {
|
|
||||||
|
|
||||||
address::address( const std::string& base58str )
|
address::address( const std::string& base58str )
|
||||||
{
|
{
|
||||||
std::string prefix( GRAPHENE_ADDRESS_PREFIX );
|
std::string prefix( GRAPHENE_ADDRESS_PREFIX );
|
||||||
|
|
@ -84,7 +80,7 @@ namespace graphene {
|
||||||
addr = fc::ripemd160::hash( fc::sha512::hash( (char*) pub.data(), pub.size() ) );
|
addr = fc::ripemd160::hash( fc::sha512::hash( (char*) pub.data(), pub.size() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
address::address( const graphene::chain::public_key_type& pub )
|
address::address( const graphene::protocol::public_key_type& pub )
|
||||||
{
|
{
|
||||||
addr = fc::ripemd160::hash( fc::sha512::hash( (char*) pub.key_data.data(), pub.key_data.size() ) );
|
addr = fc::ripemd160::hash( fc::sha512::hash( (char*) pub.key_data.data(), pub.key_data.size() ) );
|
||||||
}
|
}
|
||||||
|
|
@ -99,17 +95,17 @@ namespace graphene {
|
||||||
return GRAPHENE_ADDRESS_PREFIX + fc::to_base58( bin_addr.data(), bin_addr.size() );
|
return GRAPHENE_ADDRESS_PREFIX + fc::to_base58( bin_addr.data(), bin_addr.size() );
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // namespace graphene::chain
|
} } // namespace graphene::protocol
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
void to_variant( const graphene::chain::address& var, variant& vo, uint32_t max_depth )
|
void to_variant( const graphene::protocol::address& var, variant& vo, uint32_t max_depth )
|
||||||
{
|
{
|
||||||
vo = std::string(var);
|
vo = std::string(var);
|
||||||
}
|
}
|
||||||
void from_variant( const variant& var, graphene::chain::address& vo, uint32_t max_depth )
|
void from_variant( const variant& var, graphene::protocol::address& vo, uint32_t max_depth )
|
||||||
{
|
{
|
||||||
vo = graphene::chain::address( var.as_string() );
|
vo = graphene::protocol::address( var.as_string() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -21,13 +21,9 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include <graphene/chain/protocol/account.hpp>
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
#include <graphene/chain/protocol/asset_ops.hpp>
|
|
||||||
#include <graphene/chain/protocol/assert.hpp>
|
|
||||||
|
|
||||||
#include <fc/io/raw.hpp>
|
namespace graphene { namespace protocol {
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
|
||||||
|
|
||||||
bool account_name_eq_lit_predicate::validate()const
|
bool account_name_eq_lit_predicate::validate()const
|
||||||
{
|
{
|
||||||
|
|
@ -66,7 +62,7 @@ share_type assert_operation::calculate_fee(const fee_parameters_type& k)const
|
||||||
return k.fee * predicates.size();
|
return k.fee * predicates.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // namespace graphene::chain
|
} } // namespace graphene::protocol
|
||||||
|
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::assert_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::assert_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::assert_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::assert_operation )
|
||||||
|
|
@ -21,13 +21,13 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include <graphene/chain/protocol/asset.hpp>
|
#include <graphene/protocol/asset.hpp>
|
||||||
#include <boost/rational.hpp>
|
#include <boost/rational.hpp>
|
||||||
#include <boost/multiprecision/cpp_int.hpp>
|
#include <boost/multiprecision/cpp_int.hpp>
|
||||||
#include <fc/io/raw.hpp>
|
#include <fc/io/raw.hpp>
|
||||||
#include <fc/uint128.hpp>
|
#include <fc/uint128.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace protocol {
|
||||||
typedef boost::multiprecision::uint128_t uint128_t;
|
typedef boost::multiprecision::uint128_t uint128_t;
|
||||||
typedef boost::multiprecision::int128_t int128_t;
|
typedef boost::multiprecision::int128_t int128_t;
|
||||||
|
|
||||||
|
|
@ -207,8 +207,8 @@ const int64_t scaled_precision_lut[19] =
|
||||||
p10< 16 >::v, p10< 17 >::v, p10< 18 >::v
|
p10< 16 >::v, p10< 17 >::v, p10< 18 >::v
|
||||||
};
|
};
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::protocol
|
||||||
|
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::price )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::price )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::price_feed )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::price_feed )
|
||||||
|
|
@ -21,12 +21,11 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include <graphene/chain/protocol/asset_ops.hpp>
|
#include <graphene/protocol/asset_ops.hpp>
|
||||||
#include <graphene/chain/database.hpp>
|
|
||||||
|
|
||||||
#include <fc/io/raw.hpp>
|
#include <fc/io/raw.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace protocol {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Valid symbols can contain [A-Z0-9], and '.'
|
* Valid symbols can contain [A-Z0-9], and '.'
|
||||||
|
|
@ -289,31 +288,31 @@ void lottery_asset_options::validate() const
|
||||||
FC_ASSERT( total == GRAPHENE_100_PERCENT, "distribution amount not equals GRAPHENE_100_PERCENT" );
|
FC_ASSERT( total == GRAPHENE_100_PERCENT, "distribution amount not equals GRAPHENE_100_PERCENT" );
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // namespace graphene::chain
|
} } // namespace graphene::protocol
|
||||||
|
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_options )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_options )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::bitasset_options )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::bitasset_options )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_create_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_create_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_global_settle_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_global_settle_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_settle_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_settle_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_fund_fee_pool_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_fund_fee_pool_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_claim_fees_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_claim_fees_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_update_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_update_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_update_bitasset_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_update_bitasset_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_update_feed_producers_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_update_feed_producers_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_publish_feed_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_publish_feed_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_issue_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_issue_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_reserve_operation::fee_parameters_type )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_reserve_operation::fee_parameters_type )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_create_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_create_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_global_settle_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_global_settle_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_settle_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_settle_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_settle_cancel_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_settle_cancel_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_fund_fee_pool_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_fund_fee_pool_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_claim_fees_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_claim_fees_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_dividend_distribution_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_dividend_distribution_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_update_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_update_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_update_bitasset_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_update_bitasset_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_update_feed_producers_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_update_feed_producers_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_publish_feed_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_publish_feed_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_issue_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_issue_operation )
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_reserve_operation )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::asset_reserve_operation )
|
||||||
|
|
@ -22,10 +22,9 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <graphene/chain/protocol/authority.hpp>
|
#include <graphene/protocol/authority.hpp>
|
||||||
#include <fc/io/raw.hpp>
|
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace protocol {
|
||||||
|
|
||||||
void add_authority_accounts(
|
void add_authority_accounts(
|
||||||
flat_set<account_id_type>& result,
|
flat_set<account_id_type>& result,
|
||||||
|
|
@ -36,6 +35,6 @@ void add_authority_accounts(
|
||||||
result.insert( item.first );
|
result.insert( item.first );
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // graphene::chain
|
} } // graphene::protocol
|
||||||
|
|
||||||
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::authority )
|
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::protocol::authority )
|
||||||
|
|
@ -21,13 +21,12 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include <graphene/chain/protocol/block.hpp>
|
#include <graphene/protocol/block.hpp>
|
||||||
#include <graphene/chain/protocol/fee_schedule.hpp>
|
|
||||||
#include <fc/io/raw.hpp>
|
#include <fc/io/raw.hpp>
|
||||||
#include <fc/bitutil.hpp>
|
#include <fc/bitutil.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace protocol {
|
||||||
digest_type block_header::digest()const
|
digest_type block_header::digest()const
|
||||||
{
|
{
|
||||||
return digest_type::hash(*this);
|
return digest_type::hash(*this);
|
||||||
8
libraries/protocol/chain_parameters.cpp
Normal file
8
libraries/protocol/chain_parameters.cpp
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
#include <graphene/protocol/chain_parameters.hpp>
|
||||||
|
#include <graphene/protocol/fee_schedule.hpp>
|
||||||
|
|
||||||
|
namespace graphene { namespace protocol {
|
||||||
|
chain_parameters::chain_parameters() {
|
||||||
|
current_fees = std::make_shared<fee_schedule>();
|
||||||
|
}
|
||||||
|
}}
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue