VaultFiller

class VaultFiller constructor(services: ServiceHub, defaultNotary: <Error class: unknown class>, altNotary: Party = 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: ServiceHub, defaultNotary: <Error class: unknown class>, altNotary: Party = defaultNotary.party, rngFactory: () -> Random = { Random(0L) })

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun fillWithDummyState(participants: List<AbstractParty> = listOf(services.myInfo.singleIdentity())): Vault<<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: Amount<Currency>, issuerServices: ServiceHub, atLeastThisManyStates: Int, issuedBy: PartyAndReference, owner: AbstractParty? = null, rng: Random? = null, statesToRecord: StatesToRecord = StatesToRecord.ONLY_RELEVANT, atMostThisManyStates: Int = atLeastThisManyStates): Vault<Cash.State>

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
Link copied to clipboard
fun fillWithSomeTestDeals(dealIds: List<String>, issuerServices: ServiceHub = services, participants: List<AbstractParty> = emptyList(), includeMe: Boolean = true): Vault<DealState>
Link copied to clipboard
fun fillWithSomeTestLinearAndDealStates(txCount: Int, externalId: String? = null, participants: List<AbstractParty> = emptyList(), linearString: String = "", linearNumber: Long = 0, linearBoolean: Boolean = false, linearTimestamp: Instant = now()): Vault<ContractState>
Link copied to clipboard
fun fillWithSomeTestLinearStates(txCount: Int, externalId: String? = null, participants: List<AbstractParty> = emptyList(), uniqueIdentifier: UniqueIdentifier? = null, linearString: String = "", linearNumber: Long = 0, linearBoolean: Boolean = false, linearTimestamp: Instant = now(), constraint: AttachmentConstraint = AutomaticPlaceholderConstraint, includeMe: Boolean = true): Vault<LinearState>
Link copied to clipboard
fun <T : ContractState> fillWithTestStates(txCount: Int = 1, statesPerTx: Int = 1, participants: List<AbstractParty> = emptyList(), constraint: AttachmentConstraint = AutomaticPlaceholderConstraint, includeMe: Boolean = true, services: ServiceHub = this.services, genOutputState: (participantsToUse: List<AbstractParty>, txIndex: Int, stateIndex: Int) -> T): Vault<T>