Function diem_transaction_builder::stdlib::encode_set_validator_operator_with_nonce_admin_script[][src]

pub fn encode_set_validator_operator_with_nonce_admin_script(
    sliding_nonce: u64,
    operator_name: Vec<u8>,
    operator_account: AccountAddress
) -> Script
Expand description

Summary

Sets the validator operator for a validator in the validator’s configuration resource “locally” and does not reconfigure the system. Changes from this transaction will not picked up by the system until a reconfiguration of the system is triggered. May only be sent by the Diem Root account as a write set transaction.

Technical Description

Sets the account at operator_account address and with the specified human_name as an operator for the validator account. The account at operator_account address must have a Validator Operator role and have a ValidatorOperatorConfig::ValidatorOperatorConfig resource published under it. The account represented by the account signer must be a Validator and have a ValidatorConfig::ValidatorConfig resource published under it. No reconfiguration of the system is initiated by this script.

Parameters

NameTypeDescription
dr_account&signerThe signer reference of the sending account of the write set transaction. May only be the Diem Root signer.
account&signerSigner reference of account specified in the execute_as field of the write set transaction.
sliding_nonceu64The sliding_nonce (see: SlidingNonce) to be used for this transaction for Diem Root.
operator_namevector<u8>Validator operator’s human name.
operator_accountaddressAddress of the validator operator account to be added as the account validator’s operator.

Common Abort Conditions

Error CategoryError ReasonDescription
Errors::NOT_PUBLISHEDSlidingNonce::ESLIDING_NONCEA SlidingNonce resource is not published under dr_account.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_TOO_OLDThe sliding_nonce in dr_account is too old and it’s impossible to determine if it’s duplicated or not.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_TOO_NEWThe sliding_nonce in dr_account is too far in the future.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_ALREADY_RECORDEDThe sliding_nonce in dr_account has been previously recorded.
Errors::NOT_PUBLISHEDSlidingNonce::ESLIDING_NONCEThe sending account is not the Diem Root account or Treasury Compliance account
Errors::NOT_PUBLISHEDValidatorOperatorConfig::EVALIDATOR_OPERATOR_CONFIGThe ValidatorOperatorConfig::ValidatorOperatorConfig resource is not published under operator_account.
00The human_name field of the ValidatorOperatorConfig::ValidatorOperatorConfig resource under operator_account does not match the provided human_name.
Errors::REQUIRES_ROLERoles::EVALIDATORaccount does not have a Validator account role.
Errors::INVALID_ARGUMENTValidatorConfig::ENOT_A_VALIDATOR_OPERATORThe account at operator_account does not have a ValidatorOperatorConfig::ValidatorOperatorConfig resource.
Errors::NOT_PUBLISHEDValidatorConfig::EVALIDATOR_CONFIGA ValidatorConfig::ValidatorConfig is not published under account.

Related Scripts

  • Script::create_validator_account
  • Script::create_validator_operator_account
  • Script::register_validator_config
  • Script::remove_validator_and_reconfigure
  • Script::add_validator_and_reconfigure
  • Script::set_validator_operator
  • Script::set_validator_config_and_reconfigure