From 70b77be3bc441cbc1bd101cc1fc97452d0e08799 Mon Sep 17 00:00:00 2001 From: Vikram Rajkumar Date: Mon, 13 Jul 2015 15:19:36 -0400 Subject: [PATCH] Rename bad references to genesis account -> committee account; #147 --- README.md | 6 +- libraries/chain/asset_evaluator.cpp | 2 +- libraries/chain/db_maint.cpp | 2 +- .../include/graphene/chain/asset_object.hpp | 2 +- .../graphene/chain/delegate_object.hpp | 2 +- .../graphene/chain/protocol/asset_ops.hpp | 2 +- .../chain/protocol/chain_parameters.hpp | 4 +- .../graphene/chain/protocol/proposal.hpp | 4 +- libraries/chain/proposal_evaluator.cpp | 2 +- libraries/chain/protocol/proposal.cpp | 2 +- programs/cli_full_wallet/main.cpp | 4 +- programs/cli_wallet/main.cpp | 4 +- tests/app/main.cpp | 4 +- tests/common/database_fixture.cpp | 4 +- tests/common/database_fixture.hpp | 4 +- tests/intense/block_tests.cpp | 10 +-- tests/performance/performance_tests.cpp | 4 +- tests/tests/authority_tests.cpp | 50 +++++------ tests/tests/block_tests.cpp | 18 ++-- tests/tests/operation_tests.cpp | 82 +++++++++---------- tests/tests/operation_tests2.cpp | 16 ++-- tests/tests/uia_tests.cpp | 2 +- 22 files changed, 115 insertions(+), 115 deletions(-) diff --git a/README.md b/README.md index fd8ed41b..7740f786 100644 --- a/README.md +++ b/README.md @@ -191,9 +191,9 @@ Questions Yes. Documentation of the code base, including APIs, can be generated using Doxygen. Simply run `doxygen` in this directory. If both Doxygen and perl are available in your build environment, the CLI wallet's `help` and `gethelp` - commands will display help generated from the doxygen documentation. + commands will display help generated from the doxygen documentation. - If your CLI wallet's `help` command displays descriptions without parameter names like + If your CLI wallet's `help` command displays descriptions without parameter names like `signed_transaction transfer(string, string, string, string, string, bool)` it means CMake was unable to find Doxygen or perl during configuration. If found, the output should look like this: @@ -231,7 +231,7 @@ Questions - The answer to the previous question was really confusing. Can you make it clearer? All account ID's are of the form `1.2.x`. If you were the 9735th account to be registered, - your account's ID will be `1.2.9735`. Account `0` is special (it's the "genesis account," + your account's ID will be `1.2.9735`. Account `0` is special (it's the "committee account," which is controlled by the delegates and has a few abilities and restrictions other accounts do not). diff --git a/libraries/chain/asset_evaluator.cpp b/libraries/chain/asset_evaluator.cpp index b76c794e..dba363d9 100644 --- a/libraries/chain/asset_evaluator.cpp +++ b/libraries/chain/asset_evaluator.cpp @@ -325,7 +325,7 @@ void_result asset_update_feed_producers_evaluator::do_evaluate(const asset_updat const asset_object& a = o.asset_to_update(d); FC_ASSERT(a.is_market_issued(), "Cannot update feed producers on a non-BitAsset."); - FC_ASSERT(a.issuer != account_id_type(), "Cannot set feed producers on a genesis-issued asset."); + FC_ASSERT(a.issuer != GRAPHENE_COMMITTEE_ACCOUNT, "Cannot set feed producers on a committee-issued asset."); const asset_bitasset_data_object& b = a.bitasset_data(d); bitasset_to_update = &b; diff --git a/libraries/chain/db_maint.cpp b/libraries/chain/db_maint.cpp index eb429e36..65be3dbe 100644 --- a/libraries/chain/db_maint.cpp +++ b/libraries/chain/db_maint.cpp @@ -204,7 +204,7 @@ void database::update_active_delegates() auto delegates = sort_votable_objects(std::max(delegate_count*2+1, (size_t)GRAPHENE_MIN_DELEGATE_COUNT)); - // Update genesis authorities + // Update committee authorities if( !delegates.empty() ) { modify(get(GRAPHENE_COMMITTEE_ACCOUNT), [&](account_object& a) { diff --git a/libraries/chain/include/graphene/chain/asset_object.hpp b/libraries/chain/include/graphene/chain/asset_object.hpp index d434f868..3c8e91bc 100644 --- a/libraries/chain/include/graphene/chain/asset_object.hpp +++ b/libraries/chain/include/graphene/chain/asset_object.hpp @@ -167,7 +167,7 @@ namespace graphene { namespace chain { /// The tunable options for BitAssets are stored in this field. bitasset_options options; - /// Feeds published for this asset. If issuer is not genesis, the keys in this map are the feed publishing + /// Feeds published for this asset. If issuer is not committee, the keys in this map are the feed publishing /// accounts; otherwise, the feed publishers are the currently active delegates and witnesses and this map /// should be treated as an implementation detail. The timestamp on each feed is the time it was published. flat_map> feeds; diff --git a/libraries/chain/include/graphene/chain/delegate_object.hpp b/libraries/chain/include/graphene/chain/delegate_object.hpp index 053eadd2..f6f1e5a6 100644 --- a/libraries/chain/include/graphene/chain/delegate_object.hpp +++ b/libraries/chain/include/graphene/chain/delegate_object.hpp @@ -30,7 +30,7 @@ namespace graphene { namespace chain { * @ingroup object * * A delegate is responsible for setting blockchain parameters and has - * dynamic multi-sig control over the genesis account. The current set of + * dynamic multi-sig control over the committee account. The current set of * active delegates has control. * * Delegates were separated into a separate object to make iterating over diff --git a/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp b/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp index b7b42daa..d75bcc4a 100644 --- a/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp +++ b/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp @@ -282,7 +282,7 @@ namespace graphene { namespace chain { * This operation is used to specify which accounts may produce feeds for a given BitAsset. * * @pre @ref issuer MUST be an existing account, and MUST match asset_object::issuer on @ref asset_to_update - * @pre @ref issuer MUST NOT be the genesis account + * @pre @ref issuer MUST NOT be the committee account * @pre @ref asset_to_update MUST be a BitAsset, i.e. @ref asset_object::is_market_issued() returns true * @pre @ref fee MUST be nonnegative, and @ref issuer MUST have a sufficient balance to pay it * @pre Cardinality of @ref new_feed_producers MUST NOT exceed @ref chain_parameters::maximum_asset_feed_publishers diff --git a/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp b/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp index d8f8b48b..a0725aa3 100644 --- a/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp +++ b/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp @@ -36,7 +36,7 @@ namespace graphene { namespace chain { smart_ref current_fees; ///< current schedule of fees uint8_t block_interval = GRAPHENE_DEFAULT_BLOCK_INTERVAL; ///< interval in seconds between blocks uint32_t maintenance_interval = GRAPHENE_DEFAULT_MAINTENANCE_INTERVAL; ///< interval in sections between blockchain maintenance events - uint32_t committee_proposal_review_period = GRAPHENE_DEFAULT_COMMITTEE_PROPOSAL_REVIEW_PERIOD_SEC; ///< minimum time in seconds that a proposed transaction requiring genesis authority may not be signed, prior to expiration + uint32_t committee_proposal_review_period = GRAPHENE_DEFAULT_COMMITTEE_PROPOSAL_REVIEW_PERIOD_SEC; ///< minimum time in seconds that a proposed transaction requiring committee authority may not be signed, prior to expiration uint32_t maximum_transaction_size = GRAPHENE_DEFAULT_MAX_TRANSACTION_SIZE; ///< maximum allowable size in bytes for a transaction uint32_t maximum_block_size = GRAPHENE_DEFAULT_MAX_BLOCK_SIZE; ///< maximum allowable size in bytes for a block uint32_t maximum_undo_history = GRAPHENE_DEFAULT_MAX_UNDO_HISTORY; ///< maximum number of undo states to keep in RAM @@ -89,7 +89,7 @@ namespace graphene { namespace chain { FC_ASSERT( maximum_time_until_expiration > block_interval, "Maximum transaction expiration time must be greater than a block interval" ); FC_ASSERT( maximum_proposal_lifetime - committee_proposal_review_period > block_interval, - "Genesis proposal review period must be less than the maximum proposal lifetime" ); + "Committee proposal review period must be less than the maximum proposal lifetime" ); } }; diff --git a/libraries/chain/include/graphene/chain/protocol/proposal.hpp b/libraries/chain/include/graphene/chain/protocol/proposal.hpp index f26a2ac6..e23329f9 100644 --- a/libraries/chain/include/graphene/chain/protocol/proposal.hpp +++ b/libraries/chain/include/graphene/chain/protocol/proposal.hpp @@ -57,9 +57,9 @@ namespace graphene { namespace chain { optional review_period_seconds; extensions_type extensions; - /// Constructs a proposal_create_operation suitable for genesis proposals, with fee, expiration time and review + /// Constructs a proposal_create_operation suitable for committee proposals, with fee, expiration time and review /// period set appropriately. - static proposal_create_operation genesis_proposal(const chain_parameters& param, fc::time_point_sec head_block_time ); + static proposal_create_operation committee_proposal(const chain_parameters& param, fc::time_point_sec head_block_time ); account_id_type fee_payer()const { return fee_paying_account; } void validate()const; diff --git a/libraries/chain/proposal_evaluator.cpp b/libraries/chain/proposal_evaluator.cpp index 1bc684af..86e6ee04 100644 --- a/libraries/chain/proposal_evaluator.cpp +++ b/libraries/chain/proposal_evaluator.cpp @@ -35,7 +35,7 @@ void_result proposal_create_evaluator::do_evaluate(const proposal_create_operati "Proposal review period must be less than its overall lifetime." ); { - // If we're dealing with the genesis authority, make sure this transaction has a sufficient review period. + // If we're dealing with the committee authority, make sure this transaction has a sufficient review period. flat_set auths; vector other; for( auto& op : o.proposed_ops ) diff --git a/libraries/chain/protocol/proposal.cpp b/libraries/chain/protocol/proposal.cpp index beb1b8a9..118a23fc 100644 --- a/libraries/chain/protocol/proposal.cpp +++ b/libraries/chain/protocol/proposal.cpp @@ -4,7 +4,7 @@ namespace graphene { namespace chain { -proposal_create_operation proposal_create_operation::genesis_proposal(const chain_parameters& global_params, fc::time_point_sec head_block_time ) +proposal_create_operation proposal_create_operation::committee_proposal(const chain_parameters& global_params, fc::time_point_sec head_block_time ) { proposal_create_operation op; op.expiration_time = head_block_time + global_params.maximum_proposal_lifetime; diff --git a/programs/cli_full_wallet/main.cpp b/programs/cli_full_wallet/main.cpp index cb704418..ba608c94 100644 --- a/programs/cli_full_wallet/main.cpp +++ b/programs/cli_full_wallet/main.cpp @@ -132,9 +132,9 @@ int main( int argc, char** argv ) //fc::configure_logging( cfg ); - fc::ecc::private_key genesis_private_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("null_key"))); + fc::ecc::private_key committee_private_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("null_key"))); - idump( (key_to_wif( genesis_private_key ) ) ); + idump( (key_to_wif( committee_private_key ) ) ); fc::ecc::private_key nathan_private_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("nathan"))); idump( (key_to_wif( nathan_private_key ) ) ); diff --git a/programs/cli_wallet/main.cpp b/programs/cli_wallet/main.cpp index fd246571..c98e51bc 100644 --- a/programs/cli_wallet/main.cpp +++ b/programs/cli_wallet/main.cpp @@ -105,9 +105,9 @@ int main( int argc, char** argv ) //fc::configure_logging( cfg ); - fc::ecc::private_key genesis_private_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("null_key"))); + fc::ecc::private_key committee_private_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("null_key"))); - idump( (key_to_wif( genesis_private_key ) ) ); + idump( (key_to_wif( committee_private_key ) ) ); fc::ecc::private_key nathan_private_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("nathan"))); public_key_type nathan_pub_key = nathan_private_key.get_public_key(); diff --git a/tests/app/main.cpp b/tests/app/main.cpp index c4d05708..ffade287 100644 --- a/tests/app/main.cpp +++ b/tests/app/main.cpp @@ -68,7 +68,7 @@ BOOST_AUTO_TEST_CASE( two_node_network ) ilog("Connected!"); fc::ecc::private_key nathan_key = fc::ecc::private_key::generate(); - fc::ecc::private_key genesis_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("nathan"))); graphene::chain::signed_transaction trx; trx.set_expiration(now + fc::seconds(30)); std::shared_ptr db2 = app2.chain_database(); @@ -89,7 +89,7 @@ BOOST_AUTO_TEST_CASE( two_node_network ) now += GRAPHENE_DEFAULT_BLOCK_INTERVAL; app2.p2p_node()->broadcast(graphene::net::block_message(db2->generate_block(now, db2->get_scheduled_witness(1).first, - genesis_key, + committee_key, database::skip_nothing))); fc::usleep(fc::milliseconds(500)); diff --git a/tests/common/database_fixture.cpp b/tests/common/database_fixture.cpp index c748af9c..35a669bd 100644 --- a/tests/common/database_fixture.cpp +++ b/tests/common/database_fixture.cpp @@ -120,9 +120,9 @@ database_fixture::~database_fixture() fc::ecc::private_key database_fixture::generate_private_key(string seed) { - static const fc::ecc::private_key genesis = fc::ecc::private_key::regenerate(fc::sha256::hash(string("null_key"))); + static const fc::ecc::private_key committee = fc::ecc::private_key::regenerate(fc::sha256::hash(string("null_key"))); if( seed == "null_key" ) - return genesis; + return committee; return fc::ecc::private_key::regenerate(fc::sha256::hash(seed)); } diff --git a/tests/common/database_fixture.hpp b/tests/common/database_fixture.hpp index 50582315..1853b934 100644 --- a/tests/common/database_fixture.hpp +++ b/tests/common/database_fixture.hpp @@ -141,8 +141,8 @@ struct database_fixture { genesis_state_type genesis_state; chain::database &db; signed_transaction trx; - public_key_type genesis_key; - account_id_type genesis_account; + public_key_type committee_key; + account_id_type committee_account; fc::ecc::private_key private_key = fc::ecc::private_key::generate(); fc::ecc::private_key delegate_priv_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("null_key")) ); public_key_type delegate_pub_key; diff --git a/tests/intense/block_tests.cpp b/tests/intense/block_tests.cpp index 98eb17e2..0de2a8d6 100644 --- a/tests/intense/block_tests.cpp +++ b/tests/intense/block_tests.cpp @@ -49,7 +49,7 @@ BOOST_FIXTURE_TEST_CASE( update_account_keys, database_fixture ) ; // Sam is the creator of accounts - private_key_type genesis_key = delegate_priv_key; + private_key_type committee_key = delegate_priv_key; private_key_type sam_key = generate_private_key("sam"); // @@ -78,9 +78,9 @@ BOOST_FIXTURE_TEST_CASE( update_account_keys, database_fixture ) transaction tx; processed_transaction ptx; - account_object genesis_account_object = genesis_account(db); - // transfer from genesis account to Sam account - transfer(genesis_account_object, sam_account_object, core.amount(100000)); + account_object committee_account_object = committee_account(db); + // transfer from committee account to Sam account + transfer(committee_account_object, sam_account_object, core.amount(100000)); const int num_keys = 5; vector< private_key_type > numbered_private_keys; @@ -410,7 +410,7 @@ BOOST_FIXTURE_TEST_CASE( tapos_rollover, database_fixture ) const auto& core = asset_id_type()(db); BOOST_TEST_MESSAGE( "Give Alice some money" ); - transfer(genesis_account, alice_id, asset(10000)); + transfer(committee_account, alice_id, asset(10000)); generate_block(); BOOST_TEST_MESSAGE( "Generate up to block 0xFF00" ); diff --git a/tests/performance/performance_tests.cpp b/tests/performance/performance_tests.cpp index d137949f..2b5415c6 100644 --- a/tests/performance/performance_tests.cpp +++ b/tests/performance/performance_tests.cpp @@ -34,12 +34,12 @@ BOOST_AUTO_TEST_CASE( transfer_benchmark ) { fc::ecc::private_key nathan_key = fc::ecc::private_key::generate(); const key_object& key = register_key(nathan_key.get_public_key()); - const auto& genesis = account_id_type()(db); + const auto& committee_account = account_id_type()(db); auto start = fc::time_point::now(); for( uint32_t i = 0; i < 1000*1000; ++i ) { const auto& a = create_account("a"+fc::to_string(i), key.id); - transfer( genesis, a, asset(1000) ); + transfer( committee_account, a, asset(1000) ); } auto end = fc::time_point::now(); auto elapsed = end - start; diff --git a/tests/tests/authority_tests.cpp b/tests/tests/authority_tests.cpp index a3321b38..91d8a081 100644 --- a/tests/tests/authority_tests.cpp +++ b/tests/tests/authority_tests.cpp @@ -238,7 +238,7 @@ BOOST_AUTO_TEST_CASE( recursive_accounts ) BOOST_CHECK_EQUAL(get_balance(child, core), old_balance - 2000); trx.clear(); - BOOST_TEST_MESSAGE( "Update grandparent account authority to be genesis account" ); + BOOST_TEST_MESSAGE( "Update grandparent account authority to be committee account" ); { account_update_operation op; op.account = grandparent.id; @@ -293,7 +293,7 @@ BOOST_AUTO_TEST_CASE( proposed_single_account ) try { INVOKE(any_two_of_three); - fc::ecc::private_key genesis_key = delegate_priv_key; + fc::ecc::private_key committee_key = delegate_priv_key; fc::ecc::private_key nathan_key1 = fc::ecc::private_key::regenerate(fc::digest("key1")); fc::ecc::private_key nathan_key2 = fc::ecc::private_key::regenerate(fc::digest("key2")); fc::ecc::private_key nathan_key3 = fc::ecc::private_key::regenerate(fc::digest("key3")); @@ -355,14 +355,14 @@ BOOST_AUTO_TEST_CASE( proposed_single_account ) pup.active_approvals_to_add.insert(nathan.id); trx.operations = {pup}; - trx.sign( genesis_key ); - //Genesis may not add nathan's approval. + trx.sign( committee_key ); + //committee may not add nathan's approval. GRAPHENE_CHECK_THROW(PUSH_TX( db, trx ), fc::exception); pup.active_approvals_to_add.clear(); pup.active_approvals_to_add.insert(account_id_type()); trx.operations = {pup}; - trx.sign( genesis_key ); - //Genesis has no stake in the transaction. + trx.sign( committee_key ); + //committee has no stake in the transaction. GRAPHENE_CHECK_THROW(PUSH_TX( db, trx ), fc::exception); trx.signatures.clear(); @@ -382,11 +382,11 @@ BOOST_AUTO_TEST_CASE( proposed_single_account ) } } -/// Verify that genesis authority cannot be invoked in a normal transaction -BOOST_AUTO_TEST_CASE( genesis_authority ) +/// Verify that committee authority cannot be invoked in a normal transaction +BOOST_AUTO_TEST_CASE( committee_authority ) { try { fc::ecc::private_key nathan_key = fc::ecc::private_key::generate(); - fc::ecc::private_key genesis_key = delegate_priv_key; + fc::ecc::private_key committee_key = delegate_priv_key; const account_object nathan = create_account("nathan", nathan_key.get_public_key()); const auto& global_params = db.get_global_properties().parameters; @@ -398,12 +398,12 @@ BOOST_AUTO_TEST_CASE( genesis_authority ) p.parameters.committee_proposal_review_period = fc::days(1).to_seconds(); }); - BOOST_TEST_MESSAGE( "transfering 100000 CORE to nathan, signing with genesis key" ); + BOOST_TEST_MESSAGE( "transfering 100000 CORE to nathan, signing with committee key" ); transfer_operation top; top.to = nathan.id; top.amount = asset(100000); trx.operations.push_back(top); - sign(trx, genesis_key); + sign(trx, committee_key); GRAPHENE_CHECK_THROW(PUSH_TX( db, trx ), fc::exception); auto sign = [&] { trx.signatures.clear(); trx.sign(nathan_key); }; @@ -446,7 +446,7 @@ BOOST_AUTO_TEST_CASE( genesis_authority ) uop.fee_paying_account = GRAPHENE_TEMP_ACCOUNT; uop.proposal = prop.id; - uop.key_approvals_to_add.emplace(genesis_key.get_public_key()); + uop.key_approvals_to_add.emplace(committee_key.get_public_key()); /* uop.key_approvals_to_add.emplace(1); uop.key_approvals_to_add.emplace(2); @@ -456,16 +456,16 @@ BOOST_AUTO_TEST_CASE( genesis_authority ) uop.key_approvals_to_add.emplace(6); */ trx.operations.push_back(uop); - trx.sign(genesis_key); + trx.sign(committee_key); db.push_transaction(trx); BOOST_CHECK_EQUAL(get_balance(nathan, asset_id_type()(db)), 0); BOOST_CHECK(db.get(prop.id).is_authorized_to_execute(db)); generate_blocks(*prop.review_period_time); uop.key_approvals_to_add.clear(); - uop.key_approvals_to_add.insert(genesis_key.get_public_key()); // was 7 + uop.key_approvals_to_add.insert(committee_key.get_public_key()); // was 7 trx.operations.back() = uop; - trx.sign( genesis_key); + trx.sign( committee_key); // Should throw because the transaction is now in review. GRAPHENE_CHECK_THROW(PUSH_TX( db, trx ), fc::exception); @@ -476,7 +476,7 @@ BOOST_AUTO_TEST_CASE( genesis_authority ) BOOST_FIXTURE_TEST_CASE( fired_delegates, database_fixture ) { try { generate_block(); - fc::ecc::private_key genesis_key = delegate_priv_key; + fc::ecc::private_key committee_key = delegate_priv_key; fc::ecc::private_key delegate_key = fc::ecc::private_key::generate(); //Meet nathan. He has a little money. @@ -499,7 +499,7 @@ BOOST_FIXTURE_TEST_CASE( fired_delegates, database_fixture ) } //A proposal is created to give nathan lots more money. - proposal_create_operation pop = proposal_create_operation::genesis_proposal(db.get_global_properties().parameters, db.head_block_time()); + proposal_create_operation pop = proposal_create_operation::committee_proposal(db.get_global_properties().parameters, db.head_block_time()); pop.fee_paying_account = GRAPHENE_TEMP_ACCOUNT; pop.expiration_time = db.head_block_time() + *pop.review_period_seconds * 3; @@ -512,7 +512,7 @@ BOOST_FIXTURE_TEST_CASE( fired_delegates, database_fixture ) proposal_id_type pid = prop.id; BOOST_CHECK(!pid(db).is_authorized_to_execute(db)); - //Genesis key approves of the proposal. + //committee key approves of the proposal. proposal_update_operation uop; uop.fee_paying_account = GRAPHENE_TEMP_ACCOUNT; uop.proposal = pid; @@ -528,7 +528,7 @@ BOOST_FIXTURE_TEST_CASE( fired_delegates, database_fixture ) uop.key_approvals_to_add.emplace(9); */ trx.operations.back() = uop; - trx.sign(genesis_key); + trx.sign(committee_key); PUSH_TX( db, trx ); BOOST_CHECK(pid(db).is_authorized_to_execute(db)); @@ -882,17 +882,17 @@ BOOST_FIXTURE_TEST_CASE( max_authority_membership, database_fixture ) transaction tx; processed_transaction ptx; - private_key_type genesis_key = delegate_priv_key; + private_key_type committee_key = delegate_priv_key; // Sam is the creator of accounts private_key_type sam_key = generate_private_key("sam"); account_object sam_account_object = create_account( "sam", sam_key ); upgrade_to_lifetime_member(sam_account_object); - account_object genesis_account_object = genesis_account(db); + account_object committee_account_object = committee_account(db); const asset_object& core = asset_id_type()(db); - transfer(genesis_account_object, sam_account_object, core.amount(100000)); + transfer(committee_account_object, sam_account_object, core.amount(100000)); // have Sam create some keys @@ -968,13 +968,13 @@ BOOST_FIXTURE_TEST_CASE( bogus_signature, database_fixture ) { try { - private_key_type genesis_key = delegate_priv_key; + private_key_type committee_key = delegate_priv_key; // Sam is the creator of accounts private_key_type alice_key = generate_private_key("alice"); private_key_type bob_key = generate_private_key("bob"); private_key_type charlie_key = generate_private_key("charlie"); - account_object genesis_account_object = genesis_account(db); + account_object committee_account_object = committee_account(db); account_object alice_account_object = create_account( "alice", alice_key ); account_object bob_account_object = create_account( "bob", bob_key ); account_object charlie_account_object = create_account( "charlie", charlie_key ); @@ -987,7 +987,7 @@ BOOST_FIXTURE_TEST_CASE( bogus_signature, database_fixture ) // send from Sam -> Alice, signed by Sam const asset_object& core = asset_id_type()(db); - transfer(genesis_account_object, alice_account_object, core.amount(100000)); + transfer(committee_account_object, alice_account_object, core.amount(100000)); transfer_operation xfer_op; xfer_op.from = alice_account_object.id; diff --git a/tests/tests/block_tests.cpp b/tests/tests/block_tests.cpp index 3a70d28c..feb38ce2 100644 --- a/tests/tests/block_tests.cpp +++ b/tests/tests/block_tests.cpp @@ -555,9 +555,9 @@ BOOST_FIXTURE_TEST_CASE( limit_order_expiration, database_fixture ) auto* test = &create_bitasset("TEST"); auto* core = &asset_id_type()(db); auto* nathan = &create_account("nathan"); - auto* genesis = &account_id_type()(db); + auto* committee = &account_id_type()(db); - transfer(*genesis, *nathan, core->amount(50000)); + transfer(*committee, *nathan, core->amount(50000)); BOOST_CHECK_EQUAL( get_balance(*nathan, *core), 50000 ); @@ -584,7 +584,7 @@ BOOST_FIXTURE_TEST_CASE( limit_order_expiration, database_fixture ) test = &get_asset("TEST"); core = &asset_id_type()(db); nathan = &get_account("nathan"); - genesis = &account_id_type()(db); + committee = &account_id_type()(db); BOOST_CHECK(db.find_object(id) == nullptr); BOOST_CHECK_EQUAL( get_balance(*nathan, *core), 50000 ); @@ -646,7 +646,7 @@ BOOST_FIXTURE_TEST_CASE( change_block_interval, database_fixture ) BOOST_TEST_MESSAGE( "Creating a proposal to change the block_interval to 1 second" ); { - proposal_create_operation cop = proposal_create_operation::genesis_proposal(db.get_global_properties().parameters, db.head_block_time()); + proposal_create_operation cop = proposal_create_operation::committee_proposal(db.get_global_properties().parameters, db.head_block_time()); cop.fee_paying_account = GRAPHENE_TEMP_ACCOUNT; cop.expiration_time = db.head_block_time() + *cop.review_period_seconds + 10; delegate_update_global_parameters_operation uop; @@ -710,7 +710,7 @@ BOOST_FIXTURE_TEST_CASE( unimp_force_settlement, database_fixture ) /* try { auto private_key = delegate_priv_key; - auto private_key = generate_private_key("genesis"); + auto private_key = generate_private_key("committee"); >>>>>>> short_refactor account_id_type nathan_id = create_account("nathan").get_id(); account_id_type shorter1_id = create_account("shorter1").get_id(); @@ -848,7 +848,7 @@ BOOST_FIXTURE_TEST_CASE( pop_block_twice, database_fixture ) const asset_object& core = asset_id_type()(db); // Sam is the creator of accounts - private_key_type genesis_key = delegate_priv_key; + private_key_type committee_key = delegate_priv_key; private_key_type sam_key = generate_private_key("sam"); account_object sam_account_object = create_account("sam", sam_key); @@ -862,9 +862,9 @@ BOOST_FIXTURE_TEST_CASE( pop_block_twice, database_fixture ) transaction tx; processed_transaction ptx; - account_object genesis_account_object = genesis_account(db); - // transfer from genesis account to Sam account - transfer(genesis_account_object, sam_account_object, core.amount(100000)); + account_object committee_account_object = committee_account(db); + // transfer from committee account to Sam account + transfer(committee_account_object, sam_account_object, core.amount(100000)); generate_block(skip_flags); diff --git a/tests/tests/operation_tests.cpp b/tests/tests/operation_tests.cpp index 1ce08213..70c70ad5 100644 --- a/tests/tests/operation_tests.cpp +++ b/tests/tests/operation_tests.cpp @@ -72,7 +72,7 @@ BOOST_AUTO_TEST_CASE( call_order_update_test ) const auto& bitusd = create_bitasset("BITUSD"); const auto& core = asset_id_type()(db); - transfer(genesis_account, dan_id, asset(10000000)); + transfer(committee_account, dan_id, asset(10000000)); update_feed_producers( bitusd, {sam.id} ); price_feed current_feed; current_feed.settlement_price = bitusd.amount( 100 ) / core.amount(100); @@ -162,9 +162,9 @@ BOOST_AUTO_TEST_CASE( margin_call_limit_test ) int64_t init_balance(1000000); - transfer(genesis_account, buyer_id, asset(init_balance)); - transfer(genesis_account, borrower_id, asset(init_balance)); - transfer(genesis_account, borrower2_id, asset(init_balance)); + transfer(committee_account, buyer_id, asset(init_balance)); + transfer(committee_account, borrower_id, asset(init_balance)); + transfer(committee_account, borrower2_id, asset(init_balance)); update_feed_producers( bitusd, {feedproducer.id} ); price_feed current_feed; @@ -221,9 +221,9 @@ BOOST_AUTO_TEST_CASE( black_swan ) int64_t init_balance(1000000); - transfer(genesis_account, buyer_id, asset(init_balance)); - transfer(genesis_account, borrower_id, asset(init_balance)); - transfer(genesis_account, borrower2_id, asset(init_balance)); + transfer(committee_account, buyer_id, asset(init_balance)); + transfer(committee_account, borrower_id, asset(init_balance)); + transfer(committee_account, borrower2_id, asset(init_balance)); update_feed_producers(bitusd, {feedproducer.id}); price_feed current_feed; @@ -267,9 +267,9 @@ BOOST_AUTO_TEST_CASE( prediction_market ) const auto& core = asset_id_type()(db); int64_t init_balance(1000000); - transfer(genesis_account, judge_id, asset(init_balance)); - transfer(genesis_account, dan_id, asset(init_balance)); - transfer(genesis_account, nathan_id, asset(init_balance)); + transfer(committee_account, judge_id, asset(init_balance)); + transfer(committee_account, dan_id, asset(init_balance)); + transfer(committee_account, nathan_id, asset(init_balance)); BOOST_TEST_MESSAGE( "Require throw for mismatch collateral amounts" ); GRAPHENE_REQUIRE_THROW( borrow( dan, pmark.amount(1000), asset(2000) ), fc::exception ); @@ -339,11 +339,11 @@ BOOST_AUTO_TEST_CASE( create_account_test ) BOOST_CHECK(nathan_account.name == "nathan"); BOOST_REQUIRE(nathan_account.owner.num_auths() == 1); - BOOST_CHECK(nathan_account.owner.key_auths.at(genesis_key) == 123); + BOOST_CHECK(nathan_account.owner.key_auths.at(committee_key) == 123); BOOST_REQUIRE(nathan_account.active.num_auths() == 1); - BOOST_CHECK(nathan_account.active.key_auths.at(genesis_key) == 321); + BOOST_CHECK(nathan_account.active.key_auths.at(committee_key) == 321); BOOST_CHECK(nathan_account.options.voting_account == account_id_type()); - BOOST_CHECK(nathan_account.options.memo_key == genesis_key); + BOOST_CHECK(nathan_account.options.memo_key == committee_key); const account_statistics_object& statistics = nathan_account.statistics(db); BOOST_CHECK(statistics.id.space() == implementation_ids); @@ -409,12 +409,12 @@ BOOST_AUTO_TEST_CASE( transfer_core_asset ) try { INVOKE(create_account_test); - account_id_type genesis_account; - asset genesis_balance = db.get_balance(account_id_type(), asset_id_type()); + account_id_type committee_account; + asset committee_balance = db.get_balance(account_id_type(), asset_id_type()); const account_object& nathan_account = *db.get_index_type().indices().get().find("nathan"); transfer_operation top; - top.from = genesis_account; + top.from = committee_account; top.to = nathan_account.id; top.amount = asset( 10000); trx.operations.push_back(top); @@ -425,14 +425,14 @@ BOOST_AUTO_TEST_CASE( transfer_core_asset ) PUSH_TX( db, trx, ~0 ); BOOST_CHECK_EQUAL(get_balance(account_id_type()(db), asset_id_type()(db)), - (genesis_balance.amount - 10000 - fee.amount).value); - genesis_balance = db.get_balance(account_id_type(), asset_id_type()); + (committee_balance.amount - 10000 - fee.amount).value); + committee_balance = db.get_balance(account_id_type(), asset_id_type()); BOOST_CHECK_EQUAL(get_balance(nathan_account, asset_id_type()(db)), 10000); trx = signed_transaction(); top.from = nathan_account.id; - top.to = genesis_account; + top.to = committee_account; top.amount = asset(2000); trx.operations.push_back(top); @@ -443,7 +443,7 @@ BOOST_AUTO_TEST_CASE( transfer_core_asset ) PUSH_TX( db, trx, ~0 ); BOOST_CHECK_EQUAL(get_balance(nathan_account, asset_id_type()(db)), 8000 - fee.amount.value); - BOOST_CHECK_EQUAL(get_balance(account_id_type()(db), asset_id_type()(db)), genesis_balance.amount.value + 2000); + BOOST_CHECK_EQUAL(get_balance(account_id_type()(db), asset_id_type()(db)), committee_balance.amount.value + 2000); } catch (fc::exception& e) { edump((e.to_detail_string())); @@ -698,22 +698,22 @@ BOOST_AUTO_TEST_CASE( transfer_uia ) const asset_object& uia = *db.get_index_type().indices().get().find("TEST"); const account_object& nathan = *db.get_index_type().indices().get().find("nathan"); - const account_object& genesis = account_id_type()(db); + const account_object& committee = account_id_type()(db); BOOST_CHECK_EQUAL(get_balance(nathan, uia), 10000000); transfer_operation top; top.from = nathan.id; - top.to = genesis.id; + top.to = committee.id; top.amount = uia.amount(5000); trx.operations.push_back(top); - BOOST_TEST_MESSAGE( "Transfering 5000 TEST from nathan to genesis" ); + BOOST_TEST_MESSAGE( "Transfering 5000 TEST from nathan to committee" ); PUSH_TX( db, trx, ~0 ); BOOST_CHECK_EQUAL(get_balance(nathan, uia), 10000000 - 5000); - BOOST_CHECK_EQUAL(get_balance(genesis, uia), 5000); + BOOST_CHECK_EQUAL(get_balance(committee, uia), 5000); PUSH_TX( db, trx, ~0 ); BOOST_CHECK_EQUAL(get_balance(nathan, uia), 10000000 - 10000); - BOOST_CHECK_EQUAL(get_balance(genesis, uia), 10000); + BOOST_CHECK_EQUAL(get_balance(committee, uia), 10000); } catch(fc::exception& e) { edump((e.to_detail_string())); throw; @@ -730,7 +730,7 @@ BOOST_AUTO_TEST_CASE( create_buy_uia_multiple_match_new ) const account_object& buyer_account = create_account( "buyer" ); const account_object& seller_account = create_account( "seller" ); - transfer( genesis_account(db), buyer_account, test_asset.amount( 10000 ) ); + transfer( committee_account(db), buyer_account, test_asset.amount( 10000 ) ); transfer( nathan_account, seller_account, core_asset.amount(10000) ); BOOST_CHECK_EQUAL( get_balance( buyer_account, test_asset ), 10000 ); @@ -770,7 +770,7 @@ BOOST_AUTO_TEST_CASE( create_buy_exact_match_uia ) const account_object& buyer_account = create_account( "buyer" ); const account_object& seller_account = create_account( "seller" ); - transfer( genesis_account(db), seller_account, asset( 10000 ) ); + transfer( committee_account(db), seller_account, asset( 10000 ) ); transfer( nathan_account, buyer_account, test_asset.amount(10000) ); BOOST_CHECK_EQUAL( get_balance( buyer_account, test_asset ), 10000 ); @@ -811,7 +811,7 @@ BOOST_AUTO_TEST_CASE( create_buy_uia_multiple_match_new_reverse ) const account_object& buyer_account = create_account( "buyer" ); const account_object& seller_account = create_account( "seller" ); - transfer( genesis_account(db), seller_account, asset( 10000 ) ); + transfer( committee_account(db), seller_account, asset( 10000 ) ); transfer( nathan_account, buyer_account, test_asset.amount(10000),test_asset.amount(0) ); BOOST_CHECK_EQUAL( get_balance( buyer_account, test_asset ), 10000 ); @@ -851,7 +851,7 @@ BOOST_AUTO_TEST_CASE( create_buy_uia_multiple_match_new_reverse_fract ) const account_object& buyer_account = create_account( "buyer" ); const account_object& seller_account = create_account( "seller" ); - transfer( genesis_account(db), seller_account, asset( 30 ) ); + transfer( committee_account(db), seller_account, asset( 30 ) ); transfer( nathan_account, buyer_account, test_asset.amount(10000),test_asset.amount(0) ); BOOST_CHECK_EQUAL( get_balance( buyer_account, test_asset ), 10000 ); @@ -896,15 +896,15 @@ BOOST_AUTO_TEST_CASE( uia_fees ) const asset_object& test_asset = get_asset("TEST"); const asset_dynamic_data_object& asset_dynamic = test_asset.dynamic_asset_data_id(db); const account_object& nathan_account = get_account("nathan"); - const account_object& genesis_account = account_id_type()(db); + const account_object& committee_account = account_id_type()(db); - fund_fee_pool(genesis_account, test_asset, 1000*CORE); + fund_fee_pool(committee_account, test_asset, 1000*CORE); BOOST_CHECK(asset_dynamic.fee_pool == 1000*CORE); transfer_operation op; op.fee = test_asset.amount(0); op.from = nathan_account.id; - op.to = genesis_account.id; + op.to = committee_account.id; op.amount = test_asset.amount(100); op.fee = db.current_fee_schedule().calculate_fee( op, test_asset.options.core_exchange_rate ); BOOST_CHECK(op.fee.asset_id == test_asset.id); @@ -917,7 +917,7 @@ BOOST_AUTO_TEST_CASE( uia_fees ) BOOST_CHECK_EQUAL(get_balance(nathan_account, test_asset), (old_balance - fee - test_asset.amount(100)).amount.value); - BOOST_CHECK_EQUAL(get_balance(genesis_account, test_asset), 100); + BOOST_CHECK_EQUAL(get_balance(committee_account, test_asset), 100); BOOST_CHECK(asset_dynamic.accumulated_fees == fee.amount); BOOST_CHECK(asset_dynamic.fee_pool == 1000*CORE - core_fee.amount); @@ -925,7 +925,7 @@ BOOST_AUTO_TEST_CASE( uia_fees ) PUSH_TX( db, trx, ~0 ); BOOST_CHECK_EQUAL(get_balance(nathan_account, test_asset), (old_balance - fee - fee - test_asset.amount(200)).amount.value); - BOOST_CHECK_EQUAL(get_balance(genesis_account, test_asset), 200); + BOOST_CHECK_EQUAL(get_balance(committee_account, test_asset), 200); BOOST_CHECK(asset_dynamic.accumulated_fees == fee.amount + fee.amount); BOOST_CHECK(asset_dynamic.fee_pool == 1000*CORE - core_fee.amount - core_fee.amount); @@ -934,7 +934,7 @@ BOOST_AUTO_TEST_CASE( uia_fees ) op.amount = asset(20); BOOST_CHECK_EQUAL(get_balance(nathan_account, asset_id_type()(db)), 0); - transfer(genesis_account, nathan_account, asset(20)); + transfer(committee_account, nathan_account, asset(20)); BOOST_CHECK_EQUAL(get_balance(nathan_account, asset_id_type()(db)), 20); trx.operations.emplace_back(std::move(op)); @@ -943,7 +943,7 @@ BOOST_AUTO_TEST_CASE( uia_fees ) BOOST_CHECK_EQUAL(get_balance(nathan_account, asset_id_type()(db)), 0); BOOST_CHECK_EQUAL(get_balance(nathan_account, test_asset), (old_balance - fee - fee - fee - test_asset.amount(200)).amount.value); - BOOST_CHECK_EQUAL(get_balance(genesis_account, test_asset), 200); + BOOST_CHECK_EQUAL(get_balance(committee_account, test_asset), 200); BOOST_CHECK(asset_dynamic.accumulated_fees == fee.amount.value * 3); BOOST_CHECK(asset_dynamic.fee_pool == 1000*CORE - core_fee.amount.value * 3); } catch (fc::exception& e) { @@ -958,7 +958,7 @@ BOOST_AUTO_TEST_CASE( cancel_limit_order_test ) const asset_object& test_asset = get_asset( "TEST" ); const account_object& buyer_account = create_account( "buyer" ); - transfer( genesis_account(db), buyer_account, asset( 10000 ) ); + transfer( committee_account(db), buyer_account, asset( 10000 ) ); BOOST_CHECK_EQUAL( get_balance(buyer_account, asset_id_type()(db)), 10000 ); auto sell_order = create_sell_order( buyer_account, asset(1000), test_asset.amount(100+450*1) ); @@ -1049,7 +1049,7 @@ BOOST_AUTO_TEST_CASE( trade_amount_equals_zero ) const account_object& core_seller = create_account( "shorter1" ); const account_object& core_buyer = get_account("nathan"); - transfer( genesis_account(db), core_seller, asset( 100000000 ) ); + transfer( committee_account(db), core_seller, asset( 100000000 ) ); BOOST_CHECK_EQUAL(get_balance(core_buyer, core), 0); BOOST_CHECK_EQUAL(get_balance(core_buyer, test), 10000000); @@ -1334,7 +1334,7 @@ BOOST_AUTO_TEST_CASE( vesting_balance_create_test ) const account_object& alice_account = create_account("alice"); const account_object& bob_account = create_account("bob"); - transfer(genesis_account(db), alice_account, core.amount(100000)); + transfer(committee_account(db), alice_account, core.amount(100000)); op.creator = alice_account.get_id(); op.owner = alice_account.get_id(); @@ -1383,7 +1383,7 @@ BOOST_AUTO_TEST_CASE( vesting_balance_withdraw_test ) const account_object& alice_account = create_account( "alice" ); const account_object& bob_account = create_account( "bob" ); - transfer( genesis_account(db), alice_account, core.amount( 1000000 ) ); + transfer( committee_account(db), alice_account, core.amount( 1000000 ) ); auto spin_vbo_clock = [&]( const vesting_balance_object& vbo, uint32_t dt_secs ) { @@ -1422,7 +1422,7 @@ BOOST_AUTO_TEST_CASE( vesting_balance_withdraw_test ) auto top_up = [&]() { trx.clear(); - transfer( genesis_account(db), + transfer( committee_account(db), alice_account, core.amount( 1000000 - db.get_balance( alice_account, core ).amount ) ); diff --git a/tests/tests/operation_tests2.cpp b/tests/tests/operation_tests2.cpp index f5561ffb..13f44f32 100644 --- a/tests/tests/operation_tests2.cpp +++ b/tests/tests/operation_tests2.cpp @@ -413,7 +413,7 @@ BOOST_AUTO_TEST_CASE( witness_create ) trx.clear(); witness_id_type nathan_witness_id = create_witness(nathan_id, nathan_private_key).id; // Give nathan some voting stake - transfer(genesis_account, nathan_id, asset(10000000)); + transfer(committee_account, nathan_id, asset(10000000)); generate_block(); trx.set_expiration(db.head_block_id()); @@ -488,9 +488,9 @@ BOOST_AUTO_TEST_CASE( global_settle_test ) feed.maximum_short_squeeze_ratio = 150 * GRAPHENE_COLLATERAL_RATIO_DENOM / 100; publish_feed( bit_usd_id(db), nathan, feed ); - transfer(genesis_account, ben_id, asset(10000)); - transfer(genesis_account, valentine_id, asset(10000)); - transfer(genesis_account, dan_id, asset(10000)); + transfer(committee_account, ben_id, asset(10000)); + transfer(committee_account, valentine_id, asset(10000)); + transfer(committee_account, dan_id, asset(10000)); borrow(ben, asset(1000, bit_usd_id), asset(1000)); BOOST_CHECK_EQUAL(get_balance(ben_id, bit_usd_id), 1000); BOOST_CHECK_EQUAL(get_balance(ben_id, asset_id_type()), 9000); @@ -597,7 +597,7 @@ BOOST_AUTO_TEST_CASE( worker_pay_test ) INVOKE(worker_create_test); GET_ACTOR(nathan); generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); - transfer(genesis_account, nathan_id, asset(100000)); + transfer(committee_account, nathan_id, asset(100000)); { account_update_operation op; @@ -710,7 +710,7 @@ BOOST_AUTO_TEST_CASE( refund_worker_test ) BOOST_CHECK(worker.vote_for.type() == vote_id_type::worker); BOOST_CHECK(worker.vote_against.type() == vote_id_type::worker); - transfer(genesis_account, nathan_id, asset(100000)); + transfer(committee_account, nathan_id, asset(100000)); { account_update_operation op; @@ -783,7 +783,7 @@ BOOST_AUTO_TEST_CASE( burn_worker_test ) BOOST_CHECK(worker.vote_for.type() == vote_id_type::worker); BOOST_CHECK(worker.vote_against.type() == vote_id_type::worker); - transfer(genesis_account, nathan_id, asset(100000)); + transfer(committee_account, nathan_id, asset(100000)); { account_update_operation op; @@ -827,7 +827,7 @@ BOOST_AUTO_TEST_CASE( unimp_force_settlement_unavailable ) /* try { auto private_key = delegate_priv_key; - auto private_key = generate_private_key("genesis"); + auto private_key = generate_private_key("committee"); >>>>>>> short_refactor account_id_type nathan_id = create_account("nathan").get_id(); account_id_type shorter1_id = create_account("shorter1").get_id(); diff --git a/tests/tests/uia_tests.cpp b/tests/tests/uia_tests.cpp index 0b499251..0c487ec0 100644 --- a/tests/tests/uia_tests.cpp +++ b/tests/tests/uia_tests.cpp @@ -259,7 +259,7 @@ BOOST_AUTO_TEST_CASE( transfer_whitelist_uia ) BOOST_CHECK(!nathan.is_authorized_asset(advanced)); GRAPHENE_REQUIRE_THROW(PUSH_TX( db, trx, ~0 ), fc::exception); - //Remove nathan from genesis' whitelist, add him to dan's. This should not authorize him to hold ADVANCED. + //Remove nathan from committee's whitelist, add him to dan's. This should not authorize him to hold ADVANCED. wop.authorizing_account = account_id_type(); wop.account_to_list = nathan.id; wop.new_listing = account_whitelist_operation::no_listing;