pub enum MigratableExecuteMsg {
SubscribeToMigrationCompleteEvent {
address: String,
code_hash: String,
},
BroadcastMigrationCompleteNotification {
addresses: Vec<String>,
code_hash: String,
data: Option<Binary>,
},
}Variants§
SubscribeToMigrationCompleteEvent
Sets a contract that should be notified when this contract completes the migration process
BroadcastMigrationCompleteNotification
Triggers a MigrationCompleteNotification to be sent to the address specified. If this contract has been migrated out, otherwise it will return an error.
Consider the case where you have a FactoryContract which only instantiates ChildContracts and only maintains a list of them which can become very large. In this scenario note that the only time a ChildContract needs to interact with the FactoryContract is when it migrates out. When a child Contract migrates out only then does it need to notify the FactoryContract of its new address. Now consider that the FactoryContract can also migrate. Instead of having each ChildContract call SubscribeToMigrationCompleteEvent on the FactoryContract (which could get very expensive with a large number of ChildContracts when the FactoryContract wants to migrate because it needs to notify every ChildContract before completing migration). The ChildContract can instead upon migration just query the FactoryContract address it has stored to check if it is the latest version before allowing a migration to continue. If the FactoryContract has migrated out the sender can call BroadcastMigrationCompleteNotification on the FactoryContract to notify the ChildContract of the new address. After that the ChildContract can proceed with its own migration.
Trait Implementations§
Source§impl Clone for MigratableExecuteMsg
impl Clone for MigratableExecuteMsg
Source§fn clone(&self) -> MigratableExecuteMsg
fn clone(&self) -> MigratableExecuteMsg
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MigratableExecuteMsg
impl Debug for MigratableExecuteMsg
Source§impl<'de> Deserialize<'de> for MigratableExecuteMsg
impl<'de> Deserialize<'de> for MigratableExecuteMsg
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for MigratableExecuteMsg
impl JsonSchema for MigratableExecuteMsg
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more