Version
Namespace: IotaSdk
public class Version : IVersion, System.IDisposable
Inheritance Object → Version
Implements IVersion, IDisposable
Attributes NullableContextAttribute, NullableAttribute
Constructors
Version(UInt64)
public Version(ulong pointer)
Parameters
pointer UInt64
Methods
Destroy()
public void Destroy()
Dispose()
public void Dispose()
AsU64()
Get the underlying u64 value of this version
public ulong AsU64()
Returns
GetCongestedVersionSuggestedGasPrice()
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.
public ulong GetCongestedVersionSuggestedGasPrice()
Returns
Exceptions
IsCanceled()
Checks if this version is canceled, i.e., the corresponding object appears in a canceled transaction.
public bool IsCanceled()
Returns
IsCongested()
Check if this version is congested, i.e., the corresponding object is the reason for transaction cancellation.
public bool IsCongested()
Returns
IsValid()
Checks if this version is valid, i.e., the corresponding object does not appear in a canceled transaction.
public bool IsValid()
Returns
Next()
Returns the next version, or an error if overflow occurs.
public Version Next()
Returns
Exceptions
Previous()
Returns the previous version, or an error if underflow occurs.
public Version Previous()
Returns
Exceptions
CanceledRead()
Special version that is assigned to objects which are accessed immutably in a canceled transaction.
public static Version CanceledRead()
Returns
CongestedPriorToGasPriceFeedback()
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.
public static Version CongestedPriorToGasPriceFeedback()
Returns
FromU64(UInt64)
Create a new Version from a u64 value
public static Version FromU64(ulong value)
Parameters
value UInt64
Returns
LamportIncrement(Version[])
Returns a new version that is greater than all versions
in inputs, assuming this operation will not overflow.
public static Version LamportIncrement(Version[] inputs)
Parameters
inputs Version[]
Returns
Exceptions
MaxValidExcl()
An exclusive upper limit on a valid version: versions strictly smaller than this limit are valid versions.
A valid version means an object, which this version is assigned to, does not appear in a canceled transaction. Versions larger than this value are "special" and assigned to objects that appear in canceled transactions.
public static Version MaxValidExcl()
Returns
MinValidIncl()
An inclusive lower limit on a valid version.
A valid version means an object, which this version is assigned to, does not appear in a canceled transaction.
public static Version MinValidIncl()
Returns
NewCongestedWithSuggestedGasPrice(UInt64)
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.
public static Version NewCongestedWithSuggestedGasPrice(ulong suggestedGasPrice)
Parameters
suggestedGasPrice UInt64
Returns
Exceptions
RandomnessUnavailable()
public static Version RandomnessUnavailable()