diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index da6baf86..18012916 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,7 +12,7 @@ stages: build: stage: build script: - - rm -rf .git/modules/* ./docs ./libraries/fc + - rm -rf .git/modules/docs .git/modules/libraries/fc ./docs ./libraries/fc - git submodule sync - git submodule update --init --recursive - rm -rf build diff --git a/libraries/app/database_api.cpp b/libraries/app/database_api.cpp index 1fb6d140..a95a49c3 100644 --- a/libraries/app/database_api.cpp +++ b/libraries/app/database_api.cpp @@ -2086,7 +2086,7 @@ vector database_api_impl::lookup_vote_ids( const vector& { auto itr = son_idx.find( id ); if( itr != son_idx.end() ) - result.emplace_back( variant( *itr, 1 ) ); + result.emplace_back( variant( *itr, 5 ) ); else result.emplace_back( variant() ); break; diff --git a/libraries/app/include/graphene/app/full_account.hpp b/libraries/app/include/graphene/app/full_account.hpp index 955857b7..dc83adb6 100644 --- a/libraries/app/include/graphene/app/full_account.hpp +++ b/libraries/app/include/graphene/app/full_account.hpp @@ -70,6 +70,5 @@ FC_REFLECT( graphene::app::full_account, (proposals) (assets) (withdraws) - (proposals) (pending_dividend_payments) ) diff --git a/libraries/chain/include/graphene/chain/son_object.hpp b/libraries/chain/include/graphene/chain/son_object.hpp index 3335bd8a..53072515 100644 --- a/libraries/chain/include/graphene/chain/son_object.hpp +++ b/libraries/chain/include/graphene/chain/son_object.hpp @@ -115,7 +115,17 @@ namespace graphene { namespace chain { FC_REFLECT_ENUM(graphene::chain::son_status, (inactive)(active)(request_maintenance)(in_maintenance)(deregistered) ) FC_REFLECT_DERIVED( graphene::chain::son_object, (graphene::db::object), - (son_account)(vote_id)(total_votes)(url)(deposit)(signing_key)(pay_vb)(statistics)(status)(sidechain_public_keys) ) + (son_account) + (vote_id) + (total_votes) + (url) + (deposit) + (signing_key) + (pay_vb) + (statistics) + (status) + (sidechain_public_keys) + ) FC_REFLECT_DERIVED( graphene::chain::son_statistics_object, (graphene::db::object), @@ -131,3 +141,6 @@ FC_REFLECT_DERIVED( graphene::chain::son_statistics_object, (total_sidechain_txs_reported) (sidechain_txs_reported) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::son_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::son_statistics_object ) diff --git a/libraries/chain/small_objects.cpp b/libraries/chain/small_objects.cpp index 6b8af3d9..24166e4e 100644 --- a/libraries/chain/small_objects.cpp +++ b/libraries/chain/small_objects.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -62,6 +63,8 @@ GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::dynamic_global GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::global_property_object ) GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::operation_history_object ) GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_transaction_history_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::son_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::son_statistics_object ) GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::special_authority_object ) GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::transaction_object ) GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::withdraw_permission_object ) diff --git a/tests/betting/betting_tests.cpp b/tests/betting/betting_tests.cpp index cb7c473a..cb6118a6 100644 --- a/tests/betting/betting_tests.cpp +++ b/tests/betting/betting_tests.cpp @@ -3015,7 +3015,8 @@ boost::unit_test::test_suite* init_unit_test_suite(int argc, char* argv[]) { std::cout << "Random number generator seeded to " << time(NULL) << std::endl; // betting operations don't take effect until HARDFORK 1000 - GRAPHENE_TESTING_GENESIS_TIMESTAMP = HARDFORK_1000_TIME.sec_since_epoch() + 15; + GRAPHENE_TESTING_GENESIS_TIMESTAMP = + (HARDFORK_1000_TIME.sec_since_epoch() + 15) / GRAPHENE_DEFAULT_BLOCK_INTERVAL * GRAPHENE_DEFAULT_BLOCK_INTERVAL; return nullptr; } diff --git a/tests/tests/gpos_tests.cpp b/tests/tests/gpos_tests.cpp index 22908c07..14be6fe2 100644 --- a/tests/tests/gpos_tests.cpp +++ b/tests/tests/gpos_tests.cpp @@ -851,7 +851,10 @@ BOOST_AUTO_TEST_CASE( worker_dividends_voting ) { try { // advance to HF - generate_blocks(HARDFORK_GPOS_TIME); + fc::time_point_sec GPOS_HARDFORK_TIME = + fc::time_point_sec(1581976800); // Use mainnet GPOS hardfork time + + generate_blocks(GPOS_HARDFORK_TIME); generate_block(); // update default gpos global parameters to 4 days @@ -905,7 +908,7 @@ BOOST_AUTO_TEST_CASE( worker_dividends_voting ) vote_for(voter1_id, worker.vote_for, voter1_private_key); // first maint pass, coefficient will be 1 - generate_blocks(HARDFORK_GPOS_TIME + fc::hours(12)); //forward 1/2 sub-period so that it consider only gpos votes + generate_blocks(GPOS_HARDFORK_TIME + fc::hours(12)); //forward 1/2 sub-period so that it consider only gpos votes worker = worker_id_type()(db); BOOST_CHECK_EQUAL(worker.total_votes_for, 100); @@ -966,7 +969,10 @@ BOOST_AUTO_TEST_CASE( account_multiple_vesting ) { try { // advance to HF - generate_blocks(HARDFORK_GPOS_TIME); + fc::time_point_sec GPOS_HARDFORK_TIME = + fc::time_point_sec(1581976800); // Use mainnet GPOS hardfork time + + generate_blocks(GPOS_HARDFORK_TIME); generate_block(); set_expiration(db, trx); @@ -1009,7 +1015,7 @@ BOOST_AUTO_TEST_CASE( account_multiple_vesting ) vote_for(sam_id, witness1.vote_id, sam_private_key); vote_for(patty_id, witness1.vote_id, patty_private_key); - generate_blocks(HARDFORK_GPOS_TIME + fc::hours(12)); //forward 1/2 sub-period so that it consider only gpos votes + generate_blocks(GPOS_HARDFORK_TIME + fc::hours(12)); //forward 1/2 sub-period so that it consider only gpos votes // amount in vested balanced will sum up as voting power witness1 = witness_id_type(1)(db);