Skip to main content

CommandArgumentError

CommandArgumentError​

enum CommandArgumentError

An error with an argument to a command

BCS

The BCS serialized form of this type is specified in bcs-schema.abnf.

CommandArgumentError.indexOutOfBounds(index:)​

case indexOutOfBounds(index: UInt16)

Out of bounds access to input or results

CommandArgumentError.invalidArgumentArity​

case invalidArgumentArity

Invalid argument arity. Expected a single argument but found a result that expanded to multiple arguments.

CommandArgumentError.invalidArgumentToPrivateEntryFunction​

case invalidArgumentToPrivateEntryFunction

Invalid argument to private entry function. Private entry functions cannot take arguments from other Move functions.

CommandArgumentError.invalidBcsBytes​

case invalidBcsBytes

The argument cannot be deserialized into a value of the specified type

CommandArgumentError.invalidGasCoinUsage​

case invalidGasCoinUsage

Invalid usage of Gas coin. The Gas coin can only be used by-value with a TransferObjects command.

CommandArgumentError.invalidObjectByMutRef​

case invalidObjectByMutRef

Immutable objects cannot be passed by mutable reference, &mut.

CommandArgumentError.invalidObjectByValue​

case invalidObjectByValue

Immutable objects cannot be passed by-value.

CommandArgumentError.invalidResultArity(result:)​

case invalidResultArity(result: UInt16)

Invalid usage of result. Expected a single result but found either no return value or multiple.

CommandArgumentError.invalidUsageOfPureArgument​

case invalidUsageOfPureArgument

The argument cannot be instantiated from raw bytes

CommandArgumentError.invalidValueUsage​

case invalidValueUsage

Invalid usage of move value.

CommandArgumentError.secondaryIndexOutOfBounds(result:subresult:)​

case secondaryIndexOutOfBounds(result: UInt16, subresult: UInt16)

Out of bounds access to subresult

CommandArgumentError.sharedObjectOperationNotAllowed​

case sharedObjectOperationNotAllowed

Shared object operations such a wrapping, freezing, or converting to owned are not allowed.

CommandArgumentError.typeMismatch​

case typeMismatch

The type of the value does not match the expected type

toBcs()​

func toBcs() throws -> Data

Convert this type to BCS encoded bytes.

toDisplayString()​

func toDisplayString() -> String

Render this type as human-readable text.

The layout is meant for reading and can change between releases. Use the JSON or BCS conversions for output that gets parsed.

toJson()​

func toJson() throws -> String

Convert this type to a JSON encoded string.

!=(_:_:)​

static func != (lhs: Self, rhs: Self) -> Bool

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values a and b, a != b implies that a == b is false.

This is the default implementation of the not-equal-to operator (!=) for any type that conforms to Equatable.

  • Parameters:
    • lhs: A value to compare.
    • rhs: Another value to compare.