Updating a program allows you to:
- Change the owner of a program
- Update libraries configs
- Add/Modify/Enable/Disable authorizations
The manager will NOT perform those operations directly, rather output a list of messages that needs to be executed by the owner to achieve the updated program.
pub struct ProgramConfigUpdate {
/// The id of a program to update
pub id: u64,
/// New owner, if the owner is to be updated
pub owner: Option<String>,
/// The list of library config updates to perform
pub libraries: BTreeMap<Id, LibraryConfigUpdate>,
/// A list of authorizations
pub authorizations: Vec<AuthorizationInfoUpdate>,
}The id of the program to perform the update on, the manager will look for this id in the on-chain registry and pull the current program config that exists.
Optional field to update the owner, it takes the new owner address.
A map of library_id => library_config.
LibraryConfigUpdate is an enum that includes all possible libraries and their LibraryConfigUpdate type
A list of operations to do on the authorizations table
pub enum AuthorizationInfoUpdate {
Add(AuthorizationInfo),
Modify {
label: String,
not_before: Option<Expiration>,
expiration: Option<Expiration>,
max_concurrent_executions: Option<u64>,
priority: Option<Priority>,
},
/// Disable by label
Disable(String),
/// Disable by label
Enable(String),
}Adds a new authorization with that info
Modifies an existing authorization with that label
Disables an existing authorization by label
Enable a disabled authorization by label