- Resource
AuthValidatorWithType
- Resource
ValidatorRegistry
- Constants
- Function
genesis_init
- Function
register
- Function
register_by_system
- Function
register_internal
- Function
is_registered
- Function
borrow_validator
- Function
borrow_validator_by_type
use 0x1::string;
use 0x2::account;
use 0x2::core_addresses;
use 0x2::features;
use 0x2::table;
use 0x2::type_info;
use 0x2::type_table;
use 0x3::auth_validator;
struct AuthValidatorWithType<ValidatorType: store> has store, key
struct ValidatorRegistry has key
const ErrorValidatorAlreadyRegistered: u64 = 2;
const ErrorValidatorUnregistered: u64 = 1;
Init function called by genesis.
public(friend) fun genesis_init(sender: &signer)
Register a new validator. This feature not enabled in the mainnet.
#[private_generics(#[ValidatorType])]
public fun register<ValidatorType: store>(): u64
Register a new validator by system. This function is only called by system.
public fun register_by_system<ValidatorType: store>(system: &signer): u64
public(friend) fun register_internal<ValidatorType: store>(): u64
public fun is_registered<ValidatorType: store>(): bool
public fun borrow_validator(id: u64): &auth_validator::AuthValidator
public fun borrow_validator_by_type<ValidatorType: store>(): &auth_validator::AuthValidator