0x1::Version
Version
tracks version of something, like current VM version.
use 0x1::Config;
Version
Version.
struct Version has copy, drop, store
major: u64
const EMAJOR_TO_OLD: u64 = 101;
new_version
Create a new version.
public fun new_version(major: u64): Version::Version
public fun new_version(major: u64): Version {
Version { major }
}
aborts_if false;
get
Get version under addr
.
public fun get(addr: address): u64
public fun get(addr: address): u64 {
let version = Config::get_by_address<Self::Version>(addr);
version.major
}
aborts_if !exists<Config::Config<Version>>(addr);
pragma verify;
pragma aborts_if_is_strict;