Реализация по умолчанию StatePointer
в Corda не поддерживает разрешение указателя с использованием CordaRPCOps
. Это может быть решено только с помощью ServiceHub
или LedgerTransation
. Ниже приведены методы, определенные в классе StatePointer
в Corda.
/**
* Resolves a [StatePointer] to a [StateAndRef] via a vault query. This method will either return a [StateAndRef]
* or return an exception.
*
* @param services a [ServiceHub] implementation is required to resolve the pointer.
*/
@DeleteForDJVM
abstract fun resolve(services: ServiceHub): 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.
*
* @param ltx the [LedgerTransaction] containing the [pointer] and pointed-to states.
*/
abstract fun resolve(ltx: LedgerTransaction): StateAndRef<T>
Ни ServiceHub
, ни LedgerTransaction
не доступны в клиенте rp c, следовательно, для разрешения указателя используя CordaRPCOps
, вам нужно написать собственную реализацию, как описано в блоге , который вы упомянули.