Compare commits
3 commits
master
...
feature/SO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60eb4272bf | ||
|
|
9b4917227d | ||
|
|
9f91b21700 |
8 changed files with 140 additions and 1 deletions
|
|
@ -9,3 +9,4 @@ add_subdirectory( generate_genesis )
|
||||||
add_subdirectory( generate_uia_sharedrop_genesis )
|
add_subdirectory( generate_uia_sharedrop_genesis )
|
||||||
add_subdirectory( debug_witness )
|
add_subdirectory( debug_witness )
|
||||||
add_subdirectory( snapshot )
|
add_subdirectory( snapshot )
|
||||||
|
add_subdirectory( peerplays_sidechain )
|
||||||
|
|
|
||||||
19
libraries/plugins/peerplays_sidechain/CMakeLists.txt
Normal file
19
libraries/plugins/peerplays_sidechain/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
file(GLOB HEADERS "include/graphene/peerplays_sidechain_history/*.hpp")
|
||||||
|
|
||||||
|
add_library( peerplays_sidechain
|
||||||
|
peerplays_sidechain_plugin.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries( peerplays_sidechain graphene_chain graphene_app )
|
||||||
|
target_include_directories( peerplays_sidechain
|
||||||
|
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
|
||||||
|
|
||||||
|
install( TARGETS
|
||||||
|
peerplays_sidechain
|
||||||
|
|
||||||
|
RUNTIME DESTINATION bin
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
ARCHIVE DESTINATION lib
|
||||||
|
)
|
||||||
|
INSTALL( FILES ${HEADERS} DESTINATION "include/graphene/peerplays_sidechain" )
|
||||||
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <graphene/app/plugin.hpp>
|
||||||
|
#include <graphene/chain/database.hpp>
|
||||||
|
#include <graphene/chain/account_object.hpp>
|
||||||
|
|
||||||
|
#include <fc/thread/future.hpp>
|
||||||
|
|
||||||
|
namespace graphene { namespace peerplays_sidechain {
|
||||||
|
using namespace chain;
|
||||||
|
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
class peerplays_sidechain_plugin_impl;
|
||||||
|
}
|
||||||
|
|
||||||
|
class peerplays_sidechain_plugin : public graphene::app::plugin
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
peerplays_sidechain_plugin();
|
||||||
|
virtual ~peerplays_sidechain_plugin();
|
||||||
|
|
||||||
|
std::string plugin_name()const override;
|
||||||
|
virtual void plugin_set_program_options(
|
||||||
|
boost::program_options::options_description& cli,
|
||||||
|
boost::program_options::options_description& cfg) override;
|
||||||
|
virtual void plugin_initialize(const boost::program_options::variables_map& options) override;
|
||||||
|
virtual void plugin_startup() override;
|
||||||
|
|
||||||
|
std::unique_ptr<detail::peerplays_sidechain_plugin_impl> my;
|
||||||
|
};
|
||||||
|
|
||||||
|
} } //graphene::peerplays_sidechain_plugin
|
||||||
|
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
#include <graphene/peerplays_sidechain/peerplays_sidechain_plugin.hpp>
|
||||||
|
|
||||||
|
namespace graphene { namespace peerplays_sidechain {
|
||||||
|
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
class peerplays_sidechain_plugin_impl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
peerplays_sidechain_plugin_impl(peerplays_sidechain_plugin& _plugin)
|
||||||
|
: _self( _plugin )
|
||||||
|
{ }
|
||||||
|
virtual ~peerplays_sidechain_plugin_impl();
|
||||||
|
|
||||||
|
peerplays_sidechain_plugin& _self;
|
||||||
|
};
|
||||||
|
|
||||||
|
peerplays_sidechain_plugin_impl::~peerplays_sidechain_plugin_impl()
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // end namespace detail
|
||||||
|
|
||||||
|
peerplays_sidechain_plugin::peerplays_sidechain_plugin() :
|
||||||
|
my( new detail::peerplays_sidechain_plugin_impl(*this) )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
peerplays_sidechain_plugin::~peerplays_sidechain_plugin()
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string peerplays_sidechain_plugin::plugin_name()const
|
||||||
|
{
|
||||||
|
return "peerplays_sidechain";
|
||||||
|
}
|
||||||
|
|
||||||
|
void peerplays_sidechain_plugin::plugin_set_program_options(
|
||||||
|
boost::program_options::options_description& /*cli*/,
|
||||||
|
boost::program_options::options_description& /*cfg*/
|
||||||
|
)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void peerplays_sidechain_plugin::plugin_initialize(const boost::program_options::variables_map& /*options*/)
|
||||||
|
{
|
||||||
|
ilog("peerplays sidechain plugin: plugin_initialize()");
|
||||||
|
}
|
||||||
|
|
||||||
|
void peerplays_sidechain_plugin::plugin_startup()
|
||||||
|
{
|
||||||
|
ilog("peerplays sidechain plugin: plugin_startup()");
|
||||||
|
}
|
||||||
|
|
||||||
|
} }
|
||||||
|
|
@ -11,7 +11,7 @@ endif()
|
||||||
|
|
||||||
# We have to link against graphene_debug_witness because deficiency in our API infrastructure doesn't allow plugins to be fully abstracted #246
|
# We have to link against graphene_debug_witness because deficiency in our API infrastructure doesn't allow plugins to be fully abstracted #246
|
||||||
target_link_libraries( witness_node
|
target_link_libraries( witness_node
|
||||||
PRIVATE graphene_app graphene_account_history graphene_affiliate_stats graphene_market_history graphene_witness graphene_chain graphene_debug_witness graphene_bookie graphene_egenesis_full fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} )
|
PRIVATE graphene_app graphene_account_history graphene_affiliate_stats graphene_market_history graphene_witness graphene_chain graphene_debug_witness graphene_bookie graphene_egenesis_full fc peerplays_sidechain ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} )
|
||||||
# also add dependencies to graphene_generate_genesis graphene_generate_uia_sharedrop_genesis if you want those plugins
|
# also add dependencies to graphene_generate_genesis graphene_generate_uia_sharedrop_genesis if you want those plugins
|
||||||
|
|
||||||
install( TARGETS
|
install( TARGETS
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
//#include <graphene/generate_uia_sharedrop_genesis/generate_uia_sharedrop_genesis.hpp>
|
//#include <graphene/generate_uia_sharedrop_genesis/generate_uia_sharedrop_genesis.hpp>
|
||||||
#include <graphene/affiliate_stats/affiliate_stats_plugin.hpp>
|
#include <graphene/affiliate_stats/affiliate_stats_plugin.hpp>
|
||||||
#include <graphene/bookie/bookie_plugin.hpp>
|
#include <graphene/bookie/bookie_plugin.hpp>
|
||||||
|
#include <graphene/peerplays_sidechain/peerplays_sidechain_plugin.hpp>
|
||||||
#include <graphene/utilities/git_revision.hpp>
|
#include <graphene/utilities/git_revision.hpp>
|
||||||
//#include <graphene/snapshot/snapshot.hpp>
|
//#include <graphene/snapshot/snapshot.hpp>
|
||||||
|
|
||||||
|
|
@ -91,6 +92,7 @@ int main(int argc, char** argv) {
|
||||||
auto list_plug = node->register_plugin<accounts_list::accounts_list_plugin>();
|
auto list_plug = node->register_plugin<accounts_list::accounts_list_plugin>();
|
||||||
auto affiliate_stats_plug = node->register_plugin<affiliate_stats::affiliate_stats_plugin>();
|
auto affiliate_stats_plug = node->register_plugin<affiliate_stats::affiliate_stats_plugin>();
|
||||||
auto bookie_plug = node->register_plugin<bookie::bookie_plugin>();
|
auto bookie_plug = node->register_plugin<bookie::bookie_plugin>();
|
||||||
|
auto peerplays_sidechain = node->register_plugin<peerplays_sidechain::peerplays_sidechain_plugin>();
|
||||||
// auto snapshot_plug = node->register_plugin<snapshot_plugin::snapshot_plugin>();
|
// auto snapshot_plug = node->register_plugin<snapshot_plugin::snapshot_plugin>();
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,10 @@ file(GLOB BETTING_TESTS "betting/*.cpp")
|
||||||
add_executable( betting_test ${BETTING_TESTS} ${COMMON_SOURCES} )
|
add_executable( betting_test ${BETTING_TESTS} ${COMMON_SOURCES} )
|
||||||
target_link_libraries( betting_test graphene_chain graphene_app graphene_account_history graphene_bookie graphene_egenesis_none fc graphene_wallet ${PLATFORM_SPECIFIC_LIBS} )
|
target_link_libraries( betting_test graphene_chain graphene_app graphene_account_history graphene_bookie graphene_egenesis_none fc graphene_wallet ${PLATFORM_SPECIFIC_LIBS} )
|
||||||
|
|
||||||
|
file(GLOB PEERPLAYS_SIDECHAIN_TESTS "peerplays_sidechain/*.cpp")
|
||||||
|
add_executable( peerplays_sidechain_test ${PEERPLAYS_SIDECHAIN_TESTS} ${COMMON_SOURCES} )
|
||||||
|
target_link_libraries( peerplays_sidechain_test graphene_chain graphene_app graphene_account_history graphene_bookie graphene_egenesis_none fc graphene_wallet ${PLATFORM_SPECIFIC_LIBS} )
|
||||||
|
|
||||||
file(GLOB TOURNAMENT_TESTS "tournament/*.cpp")
|
file(GLOB TOURNAMENT_TESTS "tournament/*.cpp")
|
||||||
add_executable( tournament_test ${TOURNAMENT_TESTS} ${COMMON_SOURCES} )
|
add_executable( tournament_test ${TOURNAMENT_TESTS} ${COMMON_SOURCES} )
|
||||||
target_link_libraries( tournament_test graphene_chain graphene_app graphene_account_history graphene_egenesis_none fc ${PLATFORM_SPECIFIC_LIBS} )
|
target_link_libraries( tournament_test graphene_chain graphene_app graphene_account_history graphene_egenesis_none fc ${PLATFORM_SPECIFIC_LIBS} )
|
||||||
|
|
|
||||||
20
tests/peerplays_sidechain/peerplays_sidechain_tests.cpp
Normal file
20
tests/peerplays_sidechain/peerplays_sidechain_tests.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
#include <boost/test/unit_test.hpp>
|
||||||
|
|
||||||
|
#define BOOST_TEST_MODULE Peerplays SON Tests
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(peerplays_sidechain)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <iostream>
|
||||||
|
#include <boost/test/included/unit_test.hpp>
|
||||||
|
|
||||||
|
boost::unit_test::test_suite* init_unit_test_suite(int argc, char* argv[]) {
|
||||||
|
std::srand(time(NULL));
|
||||||
|
std::cout << "Random number generator seeded to " << time(NULL) << std::endl;
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in a new issue