pub trait UpgradeableMigratableInternal {
type MigrationData: FromVal<Env, Val>;
// Required methods
fn _migrate(e: &Env, migration_data: &Self::MigrationData);
fn _require_auth(e: &Env, operator: &Address);
}Expand description
Trait to be implemented for custom migration. Requires defining access control and custom business logic for a migration after an upgrade.
Required Associated Types§
Sourcetype MigrationData: FromVal<Env, Val>
type MigrationData: FromVal<Env, Val>
Type representing structured data needed during migration.
Required Methods§
Sourcefn _migrate(e: &Env, migration_data: &Self::MigrationData)
fn _migrate(e: &Env, migration_data: &Self::MigrationData)
Applies migration logic using the given data.
§Arguments
e- The Soroban environment.migration_data- Migration-specific input data.
Sourcefn _require_auth(e: &Env, operator: &Address)
fn _require_auth(e: &Env, operator: &Address)
Ensures the operator has signed and is authorized to perform the
upgrade and the migration.
This must be implemented by the consuming contract.
§Arguments
e- The Soroban environment.operator- The address attempting the upgrade and the migration. Can be a G-account, or another contract (C-account) such as timelock or governor.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.