Module 0x3::validator_wrapper
- Struct
ValidatorWrapper
- Constants
- Function
create_v1
- Function
load_validator_maybe_upgrade
- Function
destroy
- Function
upgrade_to_latest
- Function
version
use 0x2::tx_context;
use 0x2::versioned;
use 0x3::validator;
Struct ValidatorWrapper
struct ValidatorWrapper has store
Fields
Constants
const EInvalidVersion: u64 = 0;
Function create_v1
public(friend) fun create_v1(validator: validator::Validator, ctx: &mut tx_context::TxContext): validator_wrapper::ValidatorWrapper
Implementation
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(friend) fun load_validator_maybe_upgrade(self: &mut validator_wrapper::ValidatorWrapper): &mut validator::Validator
Implementation
Function destroy
Destroy the wrapper and retrieve the inner validator object.
public(friend) fun destroy(self: validator_wrapper::ValidatorWrapper): validator::Validator
Implementation
Function upgrade_to_latest
fun upgrade_to_latest(self: &validator_wrapper::ValidatorWrapper)
Implementation
Function version
fun version(self: &validator_wrapper::ValidatorWrapper): u64