StaticPointer

class StaticPointer<T : ContractState>(val pointer: StateRef, val type: Class<T>, val isResolved: Boolean = false) : StatePointer<T>

A StaticPointer contains a pointer to a specific StateRef and can be resolved by looking up the StateRef via ServiceHub. There are a number of things to keep in mind when using StaticPointers:

Constructors

Link copied to clipboard
constructor(pointer: StateRef, type: Class<T>)

Allows this class to be evolved through backwards compatibility with version 1 of this class.

constructor(pointer: StateRef, type: Class<T>, isResolved: Boolean = false)

Properties

Link copied to clipboard
open override val isResolved: Boolean = false

Determines whether the state pointer should be resolved to a reference input when used in a transaction.

Link copied to clipboard
open override val pointer: StateRef

An identifier for the ContractState that this StatePointer points to.

Link copied to clipboard
open override val type: Class<T>

Type of the state which is being pointed to.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun resolve(services: ServiceHub): StateAndRef<T>

Resolves a StaticPointer to a StateAndRef via a StateRef look-up.

open override fun resolve(ltx: LedgerTransaction): StateAndRef<T>

Resolves a StatePointer to a StateAndRef from inside a LedgerTransaction. The intuition here is that all of the pointed-to states will be included in the transaction as reference states.