Skip to content

Commit

Permalink
cleanup names
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Apr 13, 2023
1 parent 73331f1 commit fc79bd4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion diem-move/diem-framework/DPN/sources/0L/Ancestry.move
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ address DiemFramework {
}

// admin migration. Needs the signer object for both VM and child to prevent changes.
public fun migrate(
public fun fork_migrate(
vm: &signer,
child_sig: &signer,
migrate_tree: vector<address>
Expand Down
14 changes: 7 additions & 7 deletions diem-move/diem-framework/DPN/sources/0L/Epoch.move
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ module Epoch {

// TODO: Unclear if we want to migrate epoch number
/// Migrate the timer in a fork.
fun fork_migrate(vm: &signer, epoch: u64) {
CoreAddresses::assert_vm(vm);
let time = borrow_global<Timer>(@VMReserved);
time.epoch = epoch;
time.height_start = 0;
time.seconds_start = DiemTimestamp::now_seconds();
}
// fun fork_migrate(vm: &signer, epoch: u64) {
// CoreAddresses::assert_vm(vm);
// let time = borrow_global<Timer>(@VMReserved);
// time.epoch = epoch;
// time.height_start = 0;
// time.seconds_start = DiemTimestamp::now_seconds();
// }

/// Check to see if epoch is finished
/// Simply checks if the elapsed time is greater than the epoch time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module GenesisMigration {


/// Called by root in genesis to initialize the GAS coin
public fun migrate_user(
public fun fork_migrate_account(
vm: &signer,
user_sig: &signer,
// user_addr: address,
Expand Down
5 changes: 3 additions & 2 deletions diem-move/diem-framework/DPN/sources/0L/Receipts.move
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module Receipts {
use DiemFramework::DiemTimestamp;
use Std::Signer;
use DiemFramework::CoreAddresses;
use DiemFramework::Globals;

struct UserReceipts has key {
destination: vector<address>,
Expand All @@ -40,7 +41,7 @@ module Receipts {
}

// should only be called from the genesis script.
fun migrate_one(
fun fork_migrate(
vm: &signer,
account: &signer,
destination: address,
Expand All @@ -56,7 +57,7 @@ module Receipts {
Vector::push_back(&mut state.destination, destination);
Vector::push_back(&mut state.cumulative, cumulative * Globals::get_coin_split_factor());
Vector::push_back(&mut state.last_payment_timestamp, last_payment_timestamp);
Vector::push_back(&mut state.last_payment_value, last_payment_value * get_coin_split_factor());
Vector::push_back(&mut state.last_payment_value, last_payment_value * Globals::get_coin_split_factor());
}

public fun is_init(addr: address):bool {
Expand Down
2 changes: 1 addition & 1 deletion diem-move/diem-framework/DPN/sources/0L/TowerState.move
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ module TowerState {
}

/// fork tools. Migrate user state
public fun migrate_user_tower_history(
public fun fork_migrate_user_tower_history(
vm: &signer,
miner_sig: &signer,
previous_proof_hash: vector<u8>,
Expand Down
8 changes: 4 additions & 4 deletions diem-move/vm-genesis/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ fn migrate_end_users(session: &mut Session<StateViewCache<GenesisStateView>>, le
exec_function(
session,
"GenesisMigration",
"migrate_user",
"fork_migrate_account",
vec![],
serialize_values(&args)
);
Expand All @@ -349,7 +349,7 @@ fn migrate_end_users(session: &mut Session<StateViewCache<GenesisStateView>>, le
exec_function(
session,
"TowerState",
"migrate_user_tower_history",
"fork_migrate_user_tower_history",
vec![],
serialize_values(&tower_args)
);
Expand Down Expand Up @@ -384,7 +384,7 @@ fn migrate_end_users(session: &mut Session<StateViewCache<GenesisStateView>>, le
exec_function(
session,
"Ancestry",
"migrate",
"fork_migrate",
vec![],
serialize_values(&args)
);
Expand Down Expand Up @@ -413,7 +413,7 @@ fn migrate_end_users(session: &mut Session<StateViewCache<GenesisStateView>>, le
exec_function(
session,
"Receipts",
"migrate_one",
"fork_migrate",
vec![],
serialize_values(&args)
);
Expand Down

0 comments on commit fc79bd4

Please sign in to comment.