VaultFiller

class VaultFiller constructor(services: <Error class: unknown class>, defaultNotary: <Error class: unknown class>, altNotary: <Error class: unknown class> = defaultNotary.party, rngFactory: () -> Random = { Random(0L) })

The service hub should provide at least a key management service and a storage service.

Parameters

altNotary

used in fillWithSomeTestCash, fillWithSomeTestCommodity and consume/evolve methods. If not specified, same as defaultNotary.

rngFactory

used by fillWithSomeTestCash if no custom Random provided.

Constructors

Link copied to clipboard
constructor(services: <Error class: unknown class>, defaultNotary: <Error class: unknown class>, altNotary: <Error class: unknown class> = defaultNotary.party, rngFactory: () -> Random = { Random(0L) })

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun consumeCash(amount: <Error class: unknown class><Currency>, to: <Error class: unknown class>): <Error class: unknown class><<Error class: unknown class>>

Consume cash, sending any change to the default identity for this node. Only suitable for use in test scenarios, where nodes have a default identity.

Link copied to clipboard
fun consumeDeals(dealStates: List<<Error class: unknown class><<Error class: unknown class>>>)
Link copied to clipboard
fun consumeLinearStates(linearStates: List<<Error class: unknown class><<Error class: unknown class>>>)
Link copied to clipboard
fun consumeStates(states: Iterable<<Error class: unknown class><out <Error class: unknown class>>>)
Link copied to clipboard
fun evolveLinearState(linearState: <Error class: unknown class><<Error class: unknown class>>): <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
fun evolveLinearStates(linearStates: List<<Error class: unknown class><<Error class: unknown class>>>): <Error class: unknown class>
Link copied to clipboard
fun fillWithDummyState(participants: List<<Error class: unknown class>> = listOf(services.myInfo.singleIdentity())): <Error class: unknown class><<Error class: unknown class>>

Records a dummy state in the Vault (useful for creating random states when testing vault queries)

Link copied to clipboard
fun fillWithSomeTestCash(howMuch: <Error class: unknown class><Currency>, issuerServices: <Error class: unknown class>, atLeastThisManyStates: Int, issuedBy: <Error class: unknown class>, owner: <Error class: unknown class>? = null, rng: Random? = null, statesToRecord: <Error class: unknown class> = StatesToRecord.ONLY_RELEVANT, atMostThisManyStates: Int = atLeastThisManyStates): <Error class: unknown class><<Error class: unknown class>>

Creates a random set of between (by default) 3 and 10 cash states that add up to the given amount and adds them to the vault. This is intended for unit tests. By default the cash is owned by the legal identity key from the storage service.

Link copied to clipboard
fun fillWithSomeTestCommodity(amount: <Error class: unknown class><<Error class: unknown class>>, issuerServices: <Error class: unknown class>, issuedBy: <Error class: unknown class>): <Error class: unknown class><CommodityState>
Link copied to clipboard
fun fillWithSomeTestDeals(dealIds: List<String>, issuerServices: <Error class: unknown class> = services, participants: List<<Error class: unknown class>> = emptyList(), includeMe: Boolean = true): <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
fun fillWithSomeTestLinearAndDealStates(txCount: Int, externalId: String? = null, participants: List<<Error class: unknown class>> = emptyList(), linearString: String = "", linearNumber: Long = 0, linearBoolean: Boolean = false, linearTimestamp: Instant = now()): <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
fun fillWithSomeTestLinearStates(txCount: Int, externalId: String? = null, participants: List<<Error class: unknown class>> = emptyList(), uniqueIdentifier: <Error class: unknown class>? = null, linearString: String = "", linearNumber: Long = 0, linearBoolean: Boolean = false, linearTimestamp: Instant = now(), constraint: <Error class: unknown class> = AutomaticPlaceholderConstraint, includeMe: Boolean = true): <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
fun <T> fillWithTestStates(txCount: Int = 1, statesPerTx: Int = 1, participants: List<<Error class: unknown class>> = emptyList(), constraint: <Error class: unknown class> = AutomaticPlaceholderConstraint, includeMe: Boolean = true, services: <Error class: unknown class> = this.services, genOutputState: (participantsToUse: List<<Error class: unknown class>>, txIndex: Int, stateIndex: Int) -> T): <Error class: unknown class><T>