com.r3corda.contracts.testing

Package com.r3corda.contracts.testing

Types

JavaTestHelpers object JavaTestHelpers

Properties

CASH val Amount<Currency>.CASH: State

Allows you to write 100.DOLLARS.CASH

DUMMY_CASH_ISSUER val DUMMY_CASH_ISSUER: PartyAndReference
DUMMY_CASH_ISSUER_KEY val DUMMY_CASH_ISSUER_KEY: <ERROR CLASS>
OBLIGATION val Amount<Issued<Currency>>.OBLIGATION: State<Currency>
OBLIGATION_DEF val Issued<Currency>.OBLIGATION_DEF: StateTemplate<Currency>

Allows you to write 100.DOLLARS.CASH

STATE val Amount<Issued<Currency>>.STATE: State
TEST_PROGRAM_MAP val TEST_PROGRAM_MAP: Map<Contract, Class<out Contract>>

Functions

at infix fun <T> State<T>.at(dueBefore: Instant): State<T>
infix fun <T> IssuanceDefinition<T>.at(dueBefore: Instant): IssuanceDefinition<T>
between infix fun <T> State<T>.between(parties: <ERROR CLASS><Party, PublicKey>): State<T>
fillWithSomeTestCash fun ServiceHub.fillWithSomeTestCash(howMuch: Amount<Currency>, notary: Party = DUMMY_NOTARY, atLeastThisManyStates: Int = 3, atMostThisManyStates: Int = 10, rng: Random = Random(), ref: OpaqueBytes = OpaqueBytes(ByteArray(1, { 0 }))): Wallet

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 wallet. This is intended for unit tests.

generateState fun generateState(): DummyState
issued by infix fun State.issued by(party: Party): State
infix fun State.issued by(deposit: PartyAndReference): State
infix fun <T> State<T>.issued by(party: Party): State<T>
owned by infix fun State.owned by(owner: PublicKey): <ERROR CLASS>
infix fun <T> State<T>.owned by(owner: PublicKey): <ERROR CLASS>
infix fun State.owned by(owner: PublicKey): <ERROR CLASS>
infix fun <ERROR CLASS>.owned by(new_owner: PublicKey): <ERROR CLASS>
with deposit infix fun State.with deposit(deposit: PartyAndReference): State
with notary infix fun State.with notary(notary: Party): TransactionState<State>
infix fun State.with notary(notary: Party): TransactionState<State>
infix fun ContractState.with notary(notary: Party): TransactionState<ContractState>