pub fn encode_rotate_authentication_key_script_function(
new_key: Vec<u8, Global>
) -> TransactionPayload
Expand description
Summary
Rotates the account
’s authentication key to the supplied new authentication key. May be sent by any account.
Technical Description
Rotate the account
’s DiemAccount::DiemAccount
authentication_key
field to new_key
. new_key
must be a valid authentication key that
corresponds to an ed25519 public key as described here,
and account
must not have previously delegated its DiemAccount::KeyRotationCapability
.
Parameters
Name | Type | Description |
---|---|---|
account | signer | Signer of the sending account of the transaction. |
new_key | vector<u8> | New authentication key to be used for account . |
Common Abort Conditions
Error Category | Error Reason | Description |
---|---|---|
Errors::INVALID_STATE | DiemAccount::EKEY_ROTATION_CAPABILITY_ALREADY_EXTRACTED | account has already delegated/extracted its DiemAccount::KeyRotationCapability . |
Errors::INVALID_ARGUMENT | DiemAccount::EMALFORMED_AUTHENTICATION_KEY | new_key was an invalid length. |
Related Scripts
AccountAdministrationScripts::rotate_authentication_key_with_nonce
AccountAdministrationScripts::rotate_authentication_key_with_nonce_admin
AccountAdministrationScripts::rotate_authentication_key_with_recovery_address