Skip to content

Commit

Permalink
remove migration code
Browse files Browse the repository at this point in the history
  • Loading branch information
moodysalem committed Jan 6, 2025
1 parent 4678217 commit aba35f4
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/governor.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ pub trait IGovernor<TContractState> {

// Sends a message to L1 via syscall
fn send_message_to_l1(self: @TContractState, to_address: EthAddress, payload: Span<felt252>);

// Migrates to the latest version of storage layout, from the version of storage before v2.1.0
fn _migrate_old_config_storage(ref self: TContractState);
}

#[starknet::contract(account)]
Expand Down Expand Up @@ -469,29 +466,6 @@ pub mod Governor {

send_message_to_l1_syscall(to_address.into(), payload).expect('SYSCALL_FAILED')
}

fn _migrate_old_config_storage(ref self: ContractState) {
let old_config_storage_address = storage_base_address_from_felt252(selector!("config"));
let old_config: Config = Store::read(0, old_config_storage_address).unwrap();
// voting period of 0 is assumed to be invalid
assert(old_config.voting_period.is_non_zero(), 'NO_OLD_CONFIG');
self.config_versions.write(0, old_config);
self.emit(Reconfigured { version: 0, new_config: old_config });
Store::write(
0,
old_config_storage_address,
Config {
voting_start_delay: 0,
voting_period: 0,
voting_weight_smoothing_duration: 0,
quorum: 0,
proposal_creation_threshold: 0,
execution_delay: 0,
execution_window: 0,
},
)
.expect('FAILED_TO_DELETE');
}
}

// This implementation exists solely for the purpose of allowing simulation of calls from the
Expand Down

0 comments on commit aba35f4

Please sign in to comment.