Merge branch 'master' into beatrice
This commit is contained in:
commit
6e1b8ba9ae
14 changed files with 111 additions and 94 deletions
|
|
@ -160,10 +160,12 @@ namespace detail {
|
||||||
{
|
{
|
||||||
// t.me/peerplays #seednodes
|
// t.me/peerplays #seednodes
|
||||||
vector<string> seeds = {
|
vector<string> seeds = {
|
||||||
"ppy-beatrice-seed.blckchnd.com:6666",
|
"pts.blockveritas.co:6666",
|
||||||
"159.69.223.206:7777",
|
"seed-beatrice01.eifos.org:7777",
|
||||||
"51.38.237.243:9666",
|
"seed-testnet.ppy.alex-pu.info:7777",
|
||||||
"pbsa-beatrice.blockchainprojectsbv.com:9195"
|
"seed.ppy-beatrice.blckchnd.com:6666",
|
||||||
|
"seed.testnet.peerblock.trade:6666",
|
||||||
|
"testnet-ppyapi.spacemx.tech:9777"
|
||||||
};
|
};
|
||||||
|
|
||||||
for( const string& endpoint_string : seeds )
|
for( const string& endpoint_string : seeds )
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
// SON HARDFORK Wednesday, October 28, 2020 0:00:00 GMT
|
// SON HARDFORK Wednesday, October 28, 2020 0:00:00 GMT
|
||||||
#ifndef HARDFORK_SON_TIME
|
#ifndef HARDFORK_SON_TIME
|
||||||
#include <ctime>
|
|
||||||
#define HARDFORK_SON_TIME (fc::time_point_sec( 1603843200 ))
|
#define HARDFORK_SON_TIME (fc::time_point_sec( 1603843200 ))
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@
|
||||||
#define GRAPHENE_RECENTLY_MISSED_COUNT_INCREMENT 4
|
#define GRAPHENE_RECENTLY_MISSED_COUNT_INCREMENT 4
|
||||||
#define GRAPHENE_RECENTLY_MISSED_COUNT_DECREMENT 3
|
#define GRAPHENE_RECENTLY_MISSED_COUNT_DECREMENT 3
|
||||||
|
|
||||||
#define GRAPHENE_CURRENT_DB_VERSION "PPY2.3"
|
#define GRAPHENE_CURRENT_DB_VERSION "PPY2.4"
|
||||||
|
|
||||||
#define GRAPHENE_IRREVERSIBLE_THRESHOLD (70 * GRAPHENE_1_PERCENT)
|
#define GRAPHENE_IRREVERSIBLE_THRESHOLD (70 * GRAPHENE_1_PERCENT)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1838,14 +1838,17 @@ BOOST_AUTO_TEST_CASE(event_group_delete_test_with_matched_bets)
|
||||||
transfer(account_id_type(), bob_id, asset(initialAccountAsset));
|
transfer(account_id_type(), bob_id, asset(initialAccountAsset));
|
||||||
generate_blocks(1);
|
generate_blocks(1);
|
||||||
|
|
||||||
const auto& event = create_event({{"en", "event"}}, {{"en", "2016-17"}}, nhl.id);
|
create_event({{"en", "event"}}, {{"en", "2016-17"}}, nhl.id);
|
||||||
generate_blocks(1);
|
generate_blocks(1);
|
||||||
|
const event_object& event = *db.get_index_type<event_object_index>().indices().get<by_id>().rbegin();
|
||||||
|
|
||||||
const auto& market_group = create_betting_market_group({{"en", "market group"}}, event.id, betting_market_rules.id, asset_id_type(), false, 0);
|
create_betting_market_group({{"en", "market group"}}, event.id, betting_market_rules.id, asset_id_type(), false, 0);
|
||||||
generate_blocks(1);
|
generate_blocks(1);
|
||||||
|
const betting_market_group_object& market_group = *db.get_index_type<betting_market_group_object_index>().indices().get<by_id>().rbegin();
|
||||||
|
|
||||||
const auto& market = create_betting_market(market_group.id, {{"en", "market"}});
|
create_betting_market(market_group.id, {{"en", "market"}});
|
||||||
generate_blocks(1);
|
generate_blocks(1);
|
||||||
|
const betting_market_object& market = *db.get_index_type<betting_market_object_index>().indices().get<by_id>().rbegin();
|
||||||
|
|
||||||
place_bet(alice_id, market.id, bet_type::back, asset(betAsset, asset_id_type()), 2 * GRAPHENE_BETTING_ODDS_PRECISION);
|
place_bet(alice_id, market.id, bet_type::back, asset(betAsset, asset_id_type()), 2 * GRAPHENE_BETTING_ODDS_PRECISION);
|
||||||
place_bet(bob_id, market.id, bet_type::lay, asset(betAsset, asset_id_type()), 2 * GRAPHENE_BETTING_ODDS_PRECISION);
|
place_bet(bob_id, market.id, bet_type::lay, asset(betAsset, asset_id_type()), 2 * GRAPHENE_BETTING_ODDS_PRECISION);
|
||||||
|
|
@ -1877,9 +1880,8 @@ BOOST_AUTO_TEST_CASE(event_group_delete_test_not_existed_event_group)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CREATE_ICE_HOCKEY_BETTING_MARKET(false, 0);
|
CREATE_ICE_HOCKEY_BETTING_MARKET(false, 0);
|
||||||
event_group_id_type nhl_id = nhl.id;
|
event_group_id_type nhl_id = nhl.id;
|
||||||
delete_event_group(nhl_id);
|
delete_event_group(nhl_id);
|
||||||
|
|
||||||
|
|
||||||
BOOST_CHECK_THROW(delete_event_group(nhl_id), fc::exception);
|
BOOST_CHECK_THROW(delete_event_group(nhl_id), fc::exception);
|
||||||
} FC_LOG_AND_RETHROW()
|
} FC_LOG_AND_RETHROW()
|
||||||
|
|
|
||||||
|
|
@ -201,9 +201,39 @@ cli_fixture::~cli_fixture()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cli_fixture::generate_blocks(fc::time_point_sec timestamp, bool miss_intermediate_blocks, uint32_t skip)
|
||||||
|
{
|
||||||
|
auto db = app1->chain_database();
|
||||||
|
|
||||||
|
if( miss_intermediate_blocks )
|
||||||
|
{
|
||||||
|
generate_block(skip);
|
||||||
|
auto slots_to_miss = db->get_slot_at_time(timestamp);
|
||||||
|
if( slots_to_miss <= 1 )
|
||||||
|
return;
|
||||||
|
--slots_to_miss;
|
||||||
|
generate_block(skip, fc::ecc::private_key::regenerate(fc::sha256::hash(string("null_key"))), slots_to_miss);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
while( db->head_block_time() < timestamp )
|
||||||
|
generate_block(skip);
|
||||||
|
}
|
||||||
|
|
||||||
|
signed_block cli_fixture::generate_block(uint32_t skip, const fc::ecc::private_key& key, int miss_blocks)
|
||||||
|
{
|
||||||
|
skip |= database::skip_undo_history_check;
|
||||||
|
// skip == ~0 will skip checks specified in database::validation_steps
|
||||||
|
auto db = app1->chain_database();
|
||||||
|
auto block = db->generate_block(db->get_slot_time(miss_blocks + 1),
|
||||||
|
db->get_scheduled_witness(miss_blocks + 1),
|
||||||
|
key, skip);
|
||||||
|
db->clear_pending();
|
||||||
|
return block;
|
||||||
|
}
|
||||||
|
|
||||||
bool cli_fixture::generate_maintenance_block() {
|
bool cli_fixture::generate_maintenance_block() {
|
||||||
try {
|
try {
|
||||||
fc::ecc::private_key committee_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("nathan")));
|
fc::ecc::private_key committee_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("null_key")));
|
||||||
uint32_t skip = ~database::skip_fork_db;
|
uint32_t skip = ~database::skip_fork_db;
|
||||||
auto db = app1->chain_database();
|
auto db = app1->chain_database();
|
||||||
auto maint_time = db->get_dynamic_global_properties().next_maintenance_time;
|
auto maint_time = db->get_dynamic_global_properties().next_maintenance_time;
|
||||||
|
|
@ -219,27 +249,6 @@ bool cli_fixture::generate_maintenance_block() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cli_fixture::generate_block()
|
|
||||||
{
|
|
||||||
graphene::chain::signed_block returned_block;
|
|
||||||
return generate_block(returned_block);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool cli_fixture::generate_block(graphene::chain::signed_block& returned_block)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
fc::ecc::private_key committee_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("nathan")));
|
|
||||||
auto db = app1->chain_database();
|
|
||||||
returned_block = db->generate_block( db->get_slot_time(1),
|
|
||||||
db->get_scheduled_witness(1),
|
|
||||||
committee_key,
|
|
||||||
database::skip_nothing );
|
|
||||||
return true;
|
|
||||||
} catch (exception &e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void cli_fixture::init_nathan()
|
void cli_fixture::init_nathan()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
@ -254,7 +263,7 @@ void cli_fixture::init_nathan()
|
||||||
import_txs = con.wallet_api_ptr->import_balance("nathan", nathan_keys, true);
|
import_txs = con.wallet_api_ptr->import_balance("nathan", nathan_keys, true);
|
||||||
nathan_acct_before_upgrade = con.wallet_api_ptr->get_account("nathan");
|
nathan_acct_before_upgrade = con.wallet_api_ptr->get_account("nathan");
|
||||||
|
|
||||||
BOOST_CHECK(generate_block());
|
generate_block();
|
||||||
|
|
||||||
// upgrade nathan
|
// upgrade nathan
|
||||||
BOOST_TEST_MESSAGE("Upgrading Nathan to LTM");
|
BOOST_TEST_MESSAGE("Upgrading Nathan to LTM");
|
||||||
|
|
|
||||||
|
|
@ -60,13 +60,12 @@ struct cli_fixture
|
||||||
cli_fixture();
|
cli_fixture();
|
||||||
~cli_fixture();
|
~cli_fixture();
|
||||||
|
|
||||||
///////////
|
signed_block generate_block(uint32_t skip = ~0,
|
||||||
/// Send a block to the db
|
const fc::ecc::private_key& key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("null_key"))),
|
||||||
/// @param returned_block the signed block
|
int miss_blocks = 0);
|
||||||
/// @returns true on success
|
|
||||||
///////////
|
void generate_blocks(fc::time_point_sec timestamp, bool miss_intermediate_blocks = true, uint32_t skip = ~0);
|
||||||
bool generate_block(graphene::chain::signed_block& returned_block);
|
|
||||||
bool generate_block();
|
|
||||||
///////////
|
///////////
|
||||||
/// @brief Skip intermediate blocks, and generate a maintenance block
|
/// @brief Skip intermediate blocks, and generate a maintenance block
|
||||||
/// @returns true on success
|
/// @returns true on success
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE( create_new_account )
|
||||||
BOOST_CHECK(con.wallet_api_ptr->import_key("jmjatlanta", bki.wif_priv_key));
|
BOOST_CHECK(con.wallet_api_ptr->import_key("jmjatlanta", bki.wif_priv_key));
|
||||||
con.wallet_api_ptr->save_wallet_file(con.wallet_filename);
|
con.wallet_api_ptr->save_wallet_file(con.wallet_filename);
|
||||||
|
|
||||||
BOOST_CHECK(generate_block());
|
generate_block();
|
||||||
fc::usleep( fc::seconds(1) );
|
fc::usleep( fc::seconds(1) );
|
||||||
|
|
||||||
// attempt to give jmjatlanta some peerplays
|
// attempt to give jmjatlanta some peerplays
|
||||||
|
|
@ -112,7 +112,7 @@ BOOST_FIXTURE_TEST_CASE( cli_vote_for_2_witnesses, cli_fixture )
|
||||||
signed_transaction vote_witness1_tx = con.wallet_api_ptr->vote_for_witness("jmjatlanta", "init1", true, true);
|
signed_transaction vote_witness1_tx = con.wallet_api_ptr->vote_for_witness("jmjatlanta", "init1", true, true);
|
||||||
|
|
||||||
// generate a block to get things started
|
// generate a block to get things started
|
||||||
BOOST_CHECK(generate_block());
|
generate_block();
|
||||||
// wait for a maintenance interval
|
// wait for a maintenance interval
|
||||||
BOOST_CHECK(generate_maintenance_block());
|
BOOST_CHECK(generate_maintenance_block());
|
||||||
|
|
||||||
|
|
@ -197,7 +197,7 @@ BOOST_AUTO_TEST_CASE( account_history_pagination )
|
||||||
"1.3.0", "Here are some CORE token for your new account", true);
|
"1.3.0", "Here are some CORE token for your new account", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_CHECK(generate_block());
|
generate_block();
|
||||||
|
|
||||||
// now get account history and make sure everything is there (and no duplicates)
|
// now get account history and make sure everything is there (and no duplicates)
|
||||||
std::vector<graphene::wallet::operation_detail> history = con.wallet_api_ptr->get_account_history("jmjatlanta", 300);
|
std::vector<graphene::wallet::operation_detail> history = con.wallet_api_ptr->get_account_history("jmjatlanta", 300);
|
||||||
|
|
@ -489,7 +489,7 @@ BOOST_FIXTURE_TEST_CASE( saving_keys_wallet_test, cli_fixture )
|
||||||
graphene::wallet::plain_keys pk = decrypt_keys( "supersecret", wallet.cipher_keys );
|
graphene::wallet::plain_keys pk = decrypt_keys( "supersecret", wallet.cipher_keys );
|
||||||
BOOST_CHECK( pk.keys.size() == 1 ); // nathan key
|
BOOST_CHECK( pk.keys.size() == 1 ); // nathan key
|
||||||
|
|
||||||
BOOST_CHECK( generate_block() );
|
generate_block();
|
||||||
fc::usleep( fc::seconds(1) );
|
fc::usleep( fc::seconds(1) );
|
||||||
|
|
||||||
wallet = fc::json::from_file( path ).as<graphene::wallet::wallet_data>( 2 * GRAPHENE_MAX_NESTED_OBJECTS );
|
wallet = fc::json::from_file( path ).as<graphene::wallet::wallet_data>( 2 * GRAPHENE_MAX_NESTED_OBJECTS );
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,9 @@
|
||||||
|
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
|
|
||||||
|
#include <graphene/chain/config.hpp>
|
||||||
|
#include <graphene/chain/hardfork.hpp>
|
||||||
|
|
||||||
class son_test_helper
|
class son_test_helper
|
||||||
{
|
{
|
||||||
cli_fixture& fixture_;
|
cli_fixture& fixture_;
|
||||||
|
|
@ -36,6 +39,8 @@ public:
|
||||||
fixture_(fixture)
|
fixture_(fixture)
|
||||||
{
|
{
|
||||||
fixture_.init_nathan();
|
fixture_.init_nathan();
|
||||||
|
fixture_.generate_blocks(HARDFORK_SON_TIME);
|
||||||
|
fixture_.generate_block();
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_son(const std::string& account_name, const std::string& son_url,
|
void create_son(const std::string& account_name, const std::string& son_url,
|
||||||
|
|
@ -65,7 +70,7 @@ public:
|
||||||
"nathan", account_name, "65000", "1.3.0", "Here are some CORE token for your new account", true
|
"nathan", account_name, "65000", "1.3.0", "Here are some CORE token for your new account", true
|
||||||
);
|
);
|
||||||
|
|
||||||
BOOST_CHECK(fixture_.generate_block());
|
fixture_.generate_block();
|
||||||
|
|
||||||
// upgrade son account
|
// upgrade son account
|
||||||
BOOST_TEST_MESSAGE("Upgrading son account to LTM");
|
BOOST_TEST_MESSAGE("Upgrading son account to LTM");
|
||||||
|
|
@ -75,16 +80,16 @@ public:
|
||||||
// verify that the upgrade was successful
|
// verify that the upgrade was successful
|
||||||
BOOST_CHECK(son_account.is_lifetime_member());
|
BOOST_CHECK(son_account.is_lifetime_member());
|
||||||
|
|
||||||
BOOST_CHECK(fixture_.generate_block());
|
fixture_.generate_block();
|
||||||
|
|
||||||
// create deposit vesting
|
// create deposit vesting
|
||||||
fixture_.con.wallet_api_ptr->create_vesting_balance(account_name,
|
fixture_.con.wallet_api_ptr->create_vesting_balance(account_name,
|
||||||
"50", "1.3.0", vesting_balance_type::son, true);
|
"50", "1.3.0", vesting_balance_type::son, true);
|
||||||
BOOST_CHECK(fixture_.generate_block());
|
fixture_.generate_block();
|
||||||
|
|
||||||
// create pay_vb vesting
|
// create pay_vb vesting
|
||||||
fixture_.con.wallet_api_ptr->create_vesting_balance(account_name, "1", "1.3.0", vesting_balance_type::normal, true);
|
fixture_.con.wallet_api_ptr->create_vesting_balance(account_name, "1", "1.3.0", vesting_balance_type::normal, true);
|
||||||
BOOST_CHECK(fixture_.generate_block());
|
fixture_.generate_block();
|
||||||
|
|
||||||
// check deposits are here
|
// check deposits are here
|
||||||
auto deposits = fixture_.con.wallet_api_ptr->get_vesting_balances(account_name);
|
auto deposits = fixture_.con.wallet_api_ptr->get_vesting_balances(account_name);
|
||||||
|
|
@ -169,10 +174,11 @@ BOOST_AUTO_TEST_CASE( cli_update_son )
|
||||||
|
|
||||||
// update SON signing key
|
// update SON signing key
|
||||||
sidechain_public_keys.clear();
|
sidechain_public_keys.clear();
|
||||||
con.wallet_api_ptr->update_son("sonmember", "http://sonmember_updated2", "TEST6Yaq5ZNTTkMM2kBBzV5jktr8ETsniCC3bnVD7eFmegRrLXfGGG", sidechain_public_keys, true);
|
std::string new_key = GRAPHENE_ADDRESS_PREFIX + std::string("6Yaq5ZNTTkMM2kBBzV5jktr8ETsniCC3bnVD7eFmegRrLXfGGG");
|
||||||
|
con.wallet_api_ptr->update_son("sonmember", "http://sonmember_updated2", new_key, sidechain_public_keys, true);
|
||||||
son_data = con.wallet_api_ptr->get_son("sonmember");
|
son_data = con.wallet_api_ptr->get_son("sonmember");
|
||||||
BOOST_CHECK(son_data.url == "http://sonmember_updated2");
|
BOOST_CHECK(son_data.url == "http://sonmember_updated2");
|
||||||
BOOST_CHECK(std::string(son_data.signing_key) == "TEST6Yaq5ZNTTkMM2kBBzV5jktr8ETsniCC3bnVD7eFmegRrLXfGGG");
|
BOOST_CHECK(std::string(son_data.signing_key) == new_key);
|
||||||
|
|
||||||
} catch( fc::exception& e ) {
|
} catch( fc::exception& e ) {
|
||||||
edump((e.to_detail_string()));
|
edump((e.to_detail_string()));
|
||||||
|
|
@ -421,7 +427,7 @@ BOOST_AUTO_TEST_CASE( update_son_votes_test )
|
||||||
con.wallet_api_ptr->create_vesting_balance("nathan", "1000", "1.3.0", vesting_balance_type::gpos, true);
|
con.wallet_api_ptr->create_vesting_balance("nathan", "1000", "1.3.0", vesting_balance_type::gpos, true);
|
||||||
update_votes_tx = con.wallet_api_ptr->update_son_votes("nathan", accepted,
|
update_votes_tx = con.wallet_api_ptr->update_son_votes("nathan", accepted,
|
||||||
rejected, 2, true);
|
rejected, 2, true);
|
||||||
BOOST_CHECK(generate_block());
|
generate_block();
|
||||||
BOOST_CHECK(generate_maintenance_block());
|
BOOST_CHECK(generate_maintenance_block());
|
||||||
|
|
||||||
// Verify the votes
|
// Verify the votes
|
||||||
|
|
@ -461,7 +467,7 @@ BOOST_AUTO_TEST_CASE( update_son_votes_test )
|
||||||
rejected.push_back("son1accnt");
|
rejected.push_back("son1accnt");
|
||||||
BOOST_CHECK_THROW(update_votes_tx = con.wallet_api_ptr->update_son_votes("nathan", accepted,
|
BOOST_CHECK_THROW(update_votes_tx = con.wallet_api_ptr->update_son_votes("nathan", accepted,
|
||||||
rejected, 1, true), fc::exception);
|
rejected, 1, true), fc::exception);
|
||||||
BOOST_CHECK(generate_block());
|
generate_block();
|
||||||
|
|
||||||
// Verify the votes
|
// Verify the votes
|
||||||
son1_obj = con.wallet_api_ptr->get_son("son1account");
|
son1_obj = con.wallet_api_ptr->get_son("son1account");
|
||||||
|
|
@ -675,7 +681,7 @@ BOOST_AUTO_TEST_CASE( maintenance_test )
|
||||||
|
|
||||||
// put SON in maintenance mode
|
// put SON in maintenance mode
|
||||||
con.wallet_api_ptr->request_son_maintenance(name, true);
|
con.wallet_api_ptr->request_son_maintenance(name, true);
|
||||||
BOOST_CHECK(generate_block());
|
generate_block();
|
||||||
|
|
||||||
// check SON is in request_maintenance
|
// check SON is in request_maintenance
|
||||||
son_obj = con.wallet_api_ptr->get_son(name);
|
son_obj = con.wallet_api_ptr->get_son(name);
|
||||||
|
|
@ -683,7 +689,7 @@ BOOST_AUTO_TEST_CASE( maintenance_test )
|
||||||
|
|
||||||
// restore SON activity
|
// restore SON activity
|
||||||
con.wallet_api_ptr->cancel_request_son_maintenance(name, true);
|
con.wallet_api_ptr->cancel_request_son_maintenance(name, true);
|
||||||
BOOST_CHECK(generate_block());
|
generate_block();
|
||||||
|
|
||||||
// check SON is active
|
// check SON is active
|
||||||
son_obj = con.wallet_api_ptr->get_son(name);
|
son_obj = con.wallet_api_ptr->get_son(name);
|
||||||
|
|
@ -691,7 +697,7 @@ BOOST_AUTO_TEST_CASE( maintenance_test )
|
||||||
|
|
||||||
// put SON in maintenance mode
|
// put SON in maintenance mode
|
||||||
con.wallet_api_ptr->request_son_maintenance(name, true);
|
con.wallet_api_ptr->request_son_maintenance(name, true);
|
||||||
BOOST_CHECK(generate_block());
|
generate_block();
|
||||||
|
|
||||||
// check SON is in request_maintenance
|
// check SON is in request_maintenance
|
||||||
son_obj = con.wallet_api_ptr->get_son(name);
|
son_obj = con.wallet_api_ptr->get_son(name);
|
||||||
|
|
|
||||||
|
|
@ -905,7 +905,7 @@ BOOST_AUTO_TEST_CASE( worker_dividends_voting )
|
||||||
vote_for(voter1_id, worker.vote_for, voter1_private_key);
|
vote_for(voter1_id, worker.vote_for, voter1_private_key);
|
||||||
|
|
||||||
// first maint pass, coefficient will be 1
|
// first maint pass, coefficient will be 1
|
||||||
generate_blocks(db.get_dynamic_global_properties().next_maintenance_time);
|
generate_blocks(HARDFORK_GPOS_TIME + fc::hours(12)); //forward 1/2 sub-period so that it consider only gpos votes
|
||||||
worker = worker_id_type()(db);
|
worker = worker_id_type()(db);
|
||||||
BOOST_CHECK_EQUAL(worker.total_votes_for, 100);
|
BOOST_CHECK_EQUAL(worker.total_votes_for, 100);
|
||||||
|
|
||||||
|
|
@ -925,8 +925,8 @@ BOOST_AUTO_TEST_CASE( worker_dividends_voting )
|
||||||
generate_blocks(db.get_dynamic_global_properties().next_maintenance_time);
|
generate_blocks(db.get_dynamic_global_properties().next_maintenance_time);
|
||||||
|
|
||||||
// worker is getting paid
|
// worker is getting paid
|
||||||
BOOST_CHECK_EQUAL(worker_id_type()(db).worker.get<vesting_balance_worker_type>().balance(db).balance.amount.value, 10);
|
BOOST_CHECK_EQUAL(worker_id_type()(db).worker.get<vesting_balance_worker_type>().balance(db).balance.amount.value, 5);
|
||||||
BOOST_CHECK_EQUAL(worker.worker.get<vesting_balance_worker_type>().balance(db).balance.amount.value, 10);
|
BOOST_CHECK_EQUAL(worker.worker.get<vesting_balance_worker_type>().balance(db).balance.amount.value, 5);
|
||||||
|
|
||||||
// second maint pass, coefficient will be 0.75
|
// second maint pass, coefficient will be 0.75
|
||||||
worker = worker_id_type()(db);
|
worker = worker_id_type()(db);
|
||||||
|
|
@ -1009,7 +1009,7 @@ BOOST_AUTO_TEST_CASE( account_multiple_vesting )
|
||||||
vote_for(sam_id, witness1.vote_id, sam_private_key);
|
vote_for(sam_id, witness1.vote_id, sam_private_key);
|
||||||
vote_for(patty_id, witness1.vote_id, patty_private_key);
|
vote_for(patty_id, witness1.vote_id, patty_private_key);
|
||||||
|
|
||||||
generate_blocks(db.get_dynamic_global_properties().next_maintenance_time);
|
generate_blocks(HARDFORK_GPOS_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
|
// amount in vested balanced will sum up as voting power
|
||||||
witness1 = witness_id_type(1)(db);
|
witness1 = witness_id_type(1)(db);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue