pub(crate) fn resolve_pubkey(
    deploy_set: &DeploySet,
    image: &ContractImage,
    signer_pubkey: &Option<String>,
) -> ClientResult<Option<String>> {
    if deploy_set.initial_pubkey.is_some() {
        return Ok(deploy_set.initial_pubkey.clone());
    }

    if let Some(pubkey) = image.get_public_key()
        .map_err(|err| Error::invalid_tvc_image(err))?
    {
        if !is_empty_pubkey(&pubkey) {
            return Ok(Some(hex::encode(pubkey.as_ref())))
        }
    };

    Ok(signer_pubkey.clone())
}
/// Resolves public key from deploy set, tvc or signer, using this priority:
/// 1. Initial public key from the deploy set
/// 2. Public key from TVC image
/// 3. Signer
/// Returns None, if no public key was resolved.
Resolves public key from deploy set, tvc or signer, using this priority:
1. Initial public key from the deploy set
2. Public key from TVC image
3. Signer
Returns None, if no public key was resolved.
Resolves public key from deploy set tvc or signer using this priority : 1 . Initial public key from the deploy set 2 . Public key from TVC image 3 . Signer Returns None if no public key was resolved .
pub(crate) fn resolve_pubkey(
    deploy_set: &DeploySet,
    image: &ContractImage,
    signer_pubkey: &Option<String>,
) -> ClientResult<Option<String>> {
    if deploy_set.initial_pubkey.is_some() {
        return Ok(deploy_set.initial_pubkey.clone());
    }
    if let Some(pubkey) = image.get_public_key()
        .map_err(|err| Error::invalid_tvc_image(err))?
    {
        if !is_empty_pubkey(&pubkey) {
            return Ok(Some(hex::encode(pubkey.as_ref())))
        }
    };
    Ok(signer_pubkey.clone())
}
pub ( crate ) fn resolve_pubkey ( deploy_set : & DeploySet , image : & ContractImage , signer_pubkey : & Option < String > , ) -> ClientResult < Option < String > > { if deploy_set . initial_pubkey . is_some ( ) { return Ok ( deploy_set . initial_pubkey . clone ( ) ) ; } if let Some ( pubkey ) = image . get_public_key ( ) . map_err ( | err | Error :: invalid_tvc_image ( err ) ) ? { if ! is_empty_pubkey ( & pubkey ) { return Ok ( Some ( hex :: encode ( pubkey . as_ref ( ) ) ) ) } } ; Ok ( signer_pubkey . clone ( ) ) }
Resolves public key from deploy set, tvc or signer, using this priority:
1.
Resolves public key from deploy set tvc or signer using this priority : 1 .
deploy_set
&DeploySet
image
&ContractImage
signer_pubkey
&Option<String>