Pointer

scalus.cardano.address.Pointer
See thePointer companion class
object Pointer

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Pointer.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def fromBytes(bytes: Array[Byte]): Try[Pointer]

Parse a pointer that takes the whole byte array, as a node reads one in a new transaction (protocol version 9 and later): bytes after the pointer fail.

Parse a pointer that takes the whole byte array, as a node reads one in a new transaction (protocol version 9 and later): bytes after the pointer fail.

Attributes

def fromBytes(bytes: Array[Byte], protocolVersion: ProtocolVersion): Try[Pointer]

Parse a pointer that takes the whole byte array, as a node reads one at protocolVersion (see parseFrom).

Parse a pointer that takes the whole byte array, as a node reads one at protocolVersion (see parseFrom).

From version 7 bytes after the pointer fail, as the ledger's ensureBufIsConsumed; before it they are dropped, as a node drops them.

Attributes

def parseFrom(bytes: Array[Byte], startIndex: Int): Try[(Pointer, Int)]

Parse pointer from bytes starting at given index, as a node reads one in a new transaction (protocol version 9 and later).

Parse pointer from bytes starting at given index, as a node reads one in a new transaction (protocol version 9 and later).

A slot past MaxSlot, or an index past MaxIndex, fails, as does a number that takes more bytes than its width needs. This is the ledger's decodePtr.

Value parameters

bytes

Source byte array

startIndex

Index to start parsing from

Attributes

Returns

Tuple of (parsed pointer, bytes consumed). A number written with zero groups in front takes more bytes than in pointer.toBytes.

def parseFrom(bytes: Array[Byte], startIndex: Int, protocolVersion: ProtocolVersion): Try[(Pointer, Int)]

Parse pointer from bytes starting at given index, as a node reads one at protocolVersion.

Parse pointer from bytes starting at given index, as a node reads one at protocolVersion.

From version 9 a pointer that does not fit fails, as without a protocol version. Before it, each number may take any number of bytes and keeps its low 64 bits, and a slot past MaxSlot, or an index past MaxIndex, makes the whole pointer Pointer(Slot(0), 0, 0). This is the ledger's decodePtrLenient and mkPtrNormalized, and so what a node holds for such an address in its UTxO set.

Attributes

Returns

Tuple of (parsed pointer, bytes consumed), which can be more bytes than in pointer.toBytes

Concrete fields

val MaxIndex: Long

The largest transaction or certificate index a pointer holds: the ledger's are 16 bits.

The largest transaction or certificate index a pointer holds: the ledger's are 16 bits.

Attributes

val MaxSlot: Long

The largest slot a pointer holds: the ledger's slot is 32 bits.

The largest slot a pointer holds: the ledger's slot is 32 bits.

Attributes