Skip to main content

Version

open class Version : Disposable, AutoCloseable, VersionInterface

Functions

NameSummary
asU64open override fun asU64(): ULong
Get the underlying u64 value of this version
close@Synchronized
open override fun close()
destroyopen override fun destroy()
getCongestedVersionSuggestedGasPriceopen override fun getCongestedVersionSuggestedGasPrice(): ULong
Returns the suggested_gas_price embedded in this congested shared object version. The suggested_gas_price here is used for a gas price feedback mechanism for transactions canceled due to shared object congestion.
isCanceledopen override fun isCanceled(): Boolean
Checks if this version is canceled, i.e., the corresponding object appears in a canceled transaction.
isCongestedopen override fun isCongested(): Boolean
Check if this version is congested, i.e., the corresponding object is the reason for transaction cancellation.
isValidopen override fun isValid(): Boolean
Checks if this version is valid, i.e., the corresponding object does not appear in a canceled transaction.
nextopen override fun next(): Version
Returns the next version, or an error if overflow occurs.
previousopen override fun previous(): Version
Returns the previous version, or an error if underflow occurs.

Companion object functions

NameSummary
canceledReadfun canceledRead(): Version
Special version that is assigned to objects which are accessed immutably in a canceled transaction.
congestedPriorToGasPriceFeedbackfun congestedPriorToGasPriceFeedback(): Version
Special version that was assigned to congested objects which cause transaction cancellations. Note that this special version was only used prior to the introduction of a gas price feedback mechanism, but it is kept for backward compatibility.
fromU64fun fromU64(value: ULong): Version
Create a new Version from a u64 value
lamportIncrementfun lamportIncrement(inputs: List<Version>): Version
Returns a new version that is greater than all versions in inputs, assuming this operation will not overflow.
maxValidExclfun maxValidExcl(): Version
An exclusive upper limit on a valid version: versions strictly smaller than this limit are valid versions.
minValidInclfun minValidIncl(): Version
An inclusive lower limit on a valid version.
newCongestedWithSuggestedGasPricefun newCongestedWithSuggestedGasPrice(suggestedGasPrice: ULong): Version
Returns a special version used for congested shared objects: Version::MIN_CONGESTED + suggested_gas_price, where suggested_gas_price is embedded into a congested version to facilitate a gas price feedback mechanism for transactions canceled due to shared object congestion.
randomnessUnavailablefun randomnessUnavailable(): Version