/// Submits a proposal for blessing a replica software version.
///
/// # Arguments
///
/// * `governance`  - Governance canister
/// * `sender`      - Sender of the proposal
/// * `neuron_id`   - ID of the proposing neuron. This neuron will automatically
///   vote in favor of the proposal.
/// * `version`     - Replica software version
/// * `sha256`      - Claimed SHA256 of the replica image file
/// * `upgrade_url` - URL leading to the replica image file
///
/// Note: The existing replica *may or may not* check that the
/// provided `sha256` corresponds to the image checksum. In case
/// this proposal is adopted, the replica *assumes* that the file
/// under `upgrade_url` has the provided `sha256`. If there has
/// been a mismatch (or if the image has been forged after blessing),
/// the replica will reject the follow-up proposal for updating the
/// replica version.
///
/// Eventually returns the identifier of the newly submitted proposal.
Submits a proposal for blessing a replica software version.
Submits a proposal for blessing a replica software version .
pub async fn submit_bless_replica_version_proposal(
    governance: &Canister<'_>,
    sender: Sender,
    neuron_id: NeuronId,
    version: ReplicaVersion,
    sha256: String,
    upgrade_url: String,
) -> ProposalId {
    submit_external_update_proposal_allowing_error(
        governance,
        sender,
        neuron_id,
        NnsFunction::BlessReplicaVersion,
        BlessReplicaVersionPayload {
            replica_version_id: String::from(version.clone()),
            release_package_url: upgrade_url,
            release_package_sha256_hex: sha256.clone(),
        },
        format!(
            "Bless replica version: {} with hash: {}",
            String::from(version),
            sha256
        ),
        "".to_string(),
    )
    .await
    .expect("submit_bless_replica_version_proposal failed")
}
pub async fn submit_bless_replica_version_proposal ( governance : & Canister < ' _ > , sender : Sender , neuron_id : NeuronId , version : ReplicaVersion , sha256 : String , upgrade_url : String , ) -> ProposalId { submit_external_update_proposal_allowing_error ( governance , sender , neuron_id , NnsFunction :: BlessReplicaVersion , BlessReplicaVersionPayload { replica_version_id : String :: from ( version . clone ( ) ) , release_package_url : upgrade_url , release_package_sha256_hex : sha256 . clone ( ) , } , format ! ( " " String from ( version ) sha256 ) , " " . to_string ( ) , ) . await . expect ( " " ) }
Submits a proposal for blessing a replica software version.
Submits a proposal for blessing a replica software version .
governance
&Canister<'_>
sender
Sender
neuron_id
NeuronId
version
ReplicaVersion
sha256
String
upgrade_url
String