Function diem_transaction_builder::stdlib::encode_rotate_authentication_key_with_nonce_admin_script_function
source · pub fn encode_rotate_authentication_key_with_nonce_admin_script_function(
sliding_nonce: u64,
new_key: Vec<u8>
) -> TransactionPayload
Expand description
Summary
Rotates the specified account’s authentication key to the supplied new authentication key. May only be sent by the Diem Root account as a write set transaction.
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 |
---|---|---|
dr_account | signer | The signer of the sending account of the write set transaction. May only be the Diem Root signer. |
account | signer | Signer of account specified in the execute_as field of the write set transaction. |
sliding_nonce | u64 | The sliding_nonce (see: SlidingNonce ) to be used for this transaction for Diem Root. |
new_key | vector<u8> | New authentication key to be used for account . |
Common Abort Conditions
Error Category | Error Reason | Description |
---|---|---|
Errors::NOT_PUBLISHED | SlidingNonce::ESLIDING_NONCE | A SlidingNonce resource is not published under dr_account . |
Errors::INVALID_ARGUMENT | SlidingNonce::ENONCE_TOO_OLD | The sliding_nonce in dr_account is too old and it’s impossible to determine if it’s duplicated or not. |
Errors::INVALID_ARGUMENT | SlidingNonce::ENONCE_TOO_NEW | The sliding_nonce in dr_account is too far in the future. |
Errors::INVALID_ARGUMENT | SlidingNonce::ENONCE_ALREADY_RECORDED | The sliding_nonce in dr_account has been previously recorded. |
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
AccountAdministrationScripts::rotate_authentication_key_with_nonce
AccountAdministrationScripts::rotate_authentication_key_with_recovery_address