Function diem_transaction_builder::stdlib::encode_rotate_authentication_key_with_recovery_address_script_function
source · pub fn encode_rotate_authentication_key_with_recovery_address_script_function(
recovery_address: AccountAddress,
to_recover: AccountAddress,
new_key: Vec<u8>
) -> TransactionPayload
Expand description
Summary
Rotates the authentication key of a specified account that is part of a recovery address to a
new authentication key. Only used for accounts that are part of a recovery address (see
AccountAdministrationScripts::add_recovery_rotation_capability
for account restrictions).
Technical Description
Rotates the authentication key of the to_recover
account to new_key
using the
DiemAccount::KeyRotationCapability
stored in the RecoveryAddress::RecoveryAddress
resource
published under recovery_address
. new_key
must be a valide authentication key as described
here.
This transaction can be sent either by the to_recover
account, or by the account where the
RecoveryAddress::RecoveryAddress
resource is published that contains to_recover
’s DiemAccount::KeyRotationCapability
.
Parameters
Name | Type | Description |
---|---|---|
account | signer | Signer of the sending account of the transaction. |
recovery_address | address | Address where RecoveryAddress::RecoveryAddress that holds to_recover ’s DiemAccount::KeyRotationCapability is published. |
to_recover | address | The address of the account whose authentication key will be updated. |
new_key | vector<u8> | New authentication key to be used for the account at the to_recover address. |
Common Abort Conditions
Error Category | Error Reason | Description |
---|---|---|
Errors::NOT_PUBLISHED | RecoveryAddress::ERECOVERY_ADDRESS | recovery_address does not have a RecoveryAddress::RecoveryAddress resource published under it. |
Errors::INVALID_ARGUMENT | RecoveryAddress::ECANNOT_ROTATE_KEY | The address of account is not recovery_address or to_recover . |
Errors::INVALID_ARGUMENT | RecoveryAddress::EACCOUNT_NOT_RECOVERABLE | to_recover ’s DiemAccount::KeyRotationCapability is not in the RecoveryAddress::RecoveryAddress resource published under recovery_address . |
Errors::INVALID_ARGUMENT | DiemAccount::EMALFORMED_AUTHENTICATION_KEY | new_key was an invalid length. |
Related Scripts
AccountAdministrationScripts::rotate_authentication_key
AccountAdministrationScripts::rotate_authentication_key_with_nonce
AccountAdministrationScripts::rotate_authentication_key_with_nonce_admin