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