Trait UpgradeExecutionContext

Source
pub trait UpgradeExecutionContext: UpgradeValidationContext {
    // Required methods
    fn schedule_upgrade(&mut self, plan: Plan) -> Result<(), HostError>;
    fn clear_upgrade_plan(&mut self, plan_height: u64) -> Result<(), HostError>;
    fn store_upgraded_client_state(
        &mut self,
        upgrade_path: UpgradeClientStatePath,
        client_state: UpgradedClientStateRef<Self>,
    ) -> Result<(), HostError>;
    fn store_upgraded_consensus_state(
        &mut self,
        upgrade_path: UpgradeConsensusStatePath,
        consensus_state: UpgradedConsensusStateRef<Self>,
    ) -> Result<(), HostError>;
}
Expand description

Helper context to execute client upgrades, providing methods to schedule an upgrade and store related upgraded client and consensus states.

Required Methods§

Source

fn schedule_upgrade(&mut self, plan: Plan) -> Result<(), HostError>

Schedules an upgrade based on the specified plan. If there is another Plan it should be overwritten.

Source

fn clear_upgrade_plan(&mut self, plan_height: u64) -> Result<(), HostError>

Clears the upgrade plan at the specified height.

Source

fn store_upgraded_client_state( &mut self, upgrade_path: UpgradeClientStatePath, client_state: UpgradedClientStateRef<Self>, ) -> Result<(), HostError>

Stores the upgraded client state at the specified upgrade path.

Source

fn store_upgraded_consensus_state( &mut self, upgrade_path: UpgradeConsensusStatePath, consensus_state: UpgradedConsensusStateRef<Self>, ) -> Result<(), HostError>

Stores the upgraded consensus state at the specified upgrade path.

Implementors§