Skip to content

Commit

Permalink
scrub dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Oct 6, 2023
1 parent 6c8eb87 commit a4ad7af
Show file tree
Hide file tree
Showing 9 changed files with 64,911 additions and 1,071 deletions.
109 changes: 0 additions & 109 deletions framework/libra-framework/sources/modified_source/genesis.move
Original file line number Diff line number Diff line change
Expand Up @@ -377,48 +377,6 @@ module diem_framework::genesis {
create_initialize_validators_with_commission(diem_framework, false, validators_with_commission);
}

// fun depr_ol_create_validator_accounts(
// diem_framework: &signer,
// validator: &ValidatorConfiguration,
// // _use_staking_contract: bool,
// ) { // NOTE: after the accounts are created, the migration will restore the previous authentication keys.
// let owner = &ol_create_account(diem_framework, validator.owner_address);
// // TODO: we probably don't need either of these accounts.
// ol_create_account(diem_framework, validator.operator_address);
// ol_create_account(diem_framework, validator.voter_address);

// // Initialize the stake pool and join the validator set.
// // let pool_address = if (use_staking_contract) {

// // staking_contract::create_staking_contract(
// // owner,
// // validator.operator_address,
// // validator.voter_address,
// // validator.stake_amount,
// // commission_config.commission_percentage,
// // x"",
// // );
// // staking_contract::stake_pool_address(validator.owner_address, validator.operator_address)
// // } else
// let pool_address = {


// stake::initialize_stake_owner(
// owner,
// validator.stake_amount,
// validator.operator_address,
// validator.voter_address,
// );

// validator.owner_address
// };


// // if (commission_config.join_during_genesis) { // TODO: remove this check
// initialize_validator(pool_address, validator);
// // };
// }

fun register_one_genesis_validator(
diem_framework: &signer,
commission_config: &ValidatorConfigurationWithCommission,
Expand All @@ -443,73 +401,6 @@ module diem_framework::genesis {

stake::join_validator_set(owner, validator.owner_address);
}

// fun test_create_validator_accounts(
// diem_framework: &signer,
// commission_config: &ValidatorConfigurationWithCommission,
// _use_staking_contract: bool,
// ) {
// let validator = &commission_config.validator_config;

// let owner = &create_account(diem_framework, validator.owner_address, validator.stake_amount);
// // TODO: we probably don't need either of these accounts.
// create_account(diem_framework, validator.operator_address, 0);
// create_account(diem_framework, validator.voter_address, 0);

// // Initialize the stake pool and join the validator set.
// // let pool_address = if (use_staking_contract) {

// // staking_contract::create_staking_contract(
// // owner,
// // validator.operator_address,
// // validator.voter_address,
// // validator.stake_amount,
// // commission_config.commission_percentage,
// // x"",
// // );
// // staking_contract::stake_pool_address(validator.owner_address, validator.operator_address)
// // } else
// let pool_address = {


// stake::initialize_stake_owner(
// owner,
// validator.stake_amount,
// validator.operator_address,
// validator.voter_address,
// );

// validator.owner_address
// };


// if (commission_config.join_during_genesis) { // TODO: remove this check
// initialize_validator(pool_address, validator);
// validator_universe::genesis_helper_add_validator(diem_framework, owner)
// };
// }

// fun initialize_validator(pool_address: address, validator: &ValidatorConfiguration) {
// let operator = &create_signer(validator.operator_address);

// stake::rotate_consensus_key(
// operator,
// pool_address,
// validator.consensus_pubkey,
// validator.proof_of_possession,
// );

// stake::update_network_and_fullnode_addresses(
// operator,
// pool_address,
// validator.network_addresses,
// validator.full_node_network_addresses,
// );

// stake::join_validator_set_internal(operator, pool_address);

// }

/// The last step of genesis.
fun set_genesis_end(diem_framework: &signer) {
chain_status::set_genesis_end(diem_framework);
Expand Down
Loading

0 comments on commit a4ad7af

Please sign in to comment.