Skip to main content

Module sui_system::validator_wrapper

use std::address;
use std::ascii;
use std::bcs;
use std::internal;
use std::option;
use std::string;
use std::type_name;
use std::u128;
use std::u64;
use std::vector;
use sui::accumulator;
use sui::accumulator_settlement;
use sui::address;
use sui::bag;
use sui::balance;
use sui::bcs;
use sui::coin;
use sui::config;
use sui::deny_list;
use sui::dynamic_field;
use sui::dynamic_object_field;
use sui::event;
use sui::funds_accumulator;
use sui::hash;
use sui::hex;
use sui::object;
use sui::party;
use sui::protocol_config;
use sui::sui;
use sui::table;
use sui::transfer;
use sui::tx_context;
use sui::types;
use sui::url;
use sui::vec_map;
use sui::vec_set;
use sui::versioned;
use sui_system::staking_pool;
use sui_system::validator;
use sui_system::validator_cap;

Struct ValidatorWrapper

public struct ValidatorWrapper has store
Click to open
Fields

Constants

const EInvalidVersion: u64 = 0;

Function create_v1

public(package) fun create_v1(validator: sui_system::validator::Validator, ctx: &mut sui::tx_context::TxContext): sui_system::validator_wrapper::ValidatorWrapper

Function load_validator_maybe_upgrade

This function should always return the latest supported version.
If the inner version is old, we upgrade it lazily in-place.

public(package) fun load_validator_maybe_upgrade(self: &mut sui_system::validator_wrapper::ValidatorWrapper): &mut sui_system::validator::Validator

Function destroy

Destroy the wrapper and retrieve the inner validator object.

public(package) fun destroy(self: sui_system::validator_wrapper::ValidatorWrapper): sui_system::validator::Validator

Function upgrade_to_latest

fun upgrade_to_latest(self: &sui_system::validator_wrapper::ValidatorWrapper)

Function version

fun version(self: &sui_system::validator_wrapper::ValidatorWrapper): u64