pub trait UpgradeExecutionContext: UpgradeValidationContext {
// Required methods
fn schedule_upgrade(&mut self, plan: Plan) -> Result<(), UpgradeClientError>;
fn clear_upgrade_plan(
&mut self,
plan_height: u64
) -> Result<(), UpgradeClientError>;
fn store_upgraded_client_state(
&mut self,
upgrade_path: UpgradeClientPath,
client_state: UpgradedClientStateRef<Self>
) -> Result<(), UpgradeClientError>;
fn store_upgraded_consensus_state(
&mut self,
upgrade_path: UpgradeClientPath,
consensus_state: UpgradedConsensusStateRef<Self>
) -> Result<(), UpgradeClientError>;
}
Expand description
Helper context to execute client upgrades, providing methods to schedule an upgrade and store related upgraded client and consensus states.
Required Methods§
sourcefn schedule_upgrade(&mut self, plan: Plan) -> Result<(), UpgradeClientError>
fn schedule_upgrade(&mut self, plan: Plan) -> Result<(), UpgradeClientError>
Schedules an upgrade based on the specified plan. If there is another Plan
it should be overwritten.
sourcefn clear_upgrade_plan(
&mut self,
plan_height: u64
) -> Result<(), UpgradeClientError>
fn clear_upgrade_plan( &mut self, plan_height: u64 ) -> Result<(), UpgradeClientError>
Clears the upgrade plan at the specified height.
sourcefn store_upgraded_client_state(
&mut self,
upgrade_path: UpgradeClientPath,
client_state: UpgradedClientStateRef<Self>
) -> Result<(), UpgradeClientError>
fn store_upgraded_client_state( &mut self, upgrade_path: UpgradeClientPath, client_state: UpgradedClientStateRef<Self> ) -> Result<(), UpgradeClientError>
Stores the upgraded client state at the specified upgrade path.
sourcefn store_upgraded_consensus_state(
&mut self,
upgrade_path: UpgradeClientPath,
consensus_state: UpgradedConsensusStateRef<Self>
) -> Result<(), UpgradeClientError>
fn store_upgraded_consensus_state( &mut self, upgrade_path: UpgradeClientPath, consensus_state: UpgradedConsensusStateRef<Self> ) -> Result<(), UpgradeClientError>
Stores the upgraded consensus state at the specified upgrade path.