mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
Add generics to Vault.Update
This commit is contained in:
@ -3,6 +3,7 @@ package net.corda.docs
|
||||
import com.google.common.util.concurrent.Futures
|
||||
import com.google.common.util.concurrent.ListenableFuture
|
||||
import net.corda.contracts.asset.Cash
|
||||
import net.corda.core.contracts.ContractState
|
||||
import net.corda.core.contracts.DOLLARS
|
||||
import net.corda.core.getOrThrow
|
||||
import net.corda.core.messaging.startFlow
|
||||
@ -82,8 +83,8 @@ class IntegrationTestingTutorial {
|
||||
parallel(
|
||||
(1..10).map { i ->
|
||||
expect(
|
||||
match = { update: Vault.Update ->
|
||||
(update.produced.first().state.data as Cash.State).amount.quantity == i * 100L
|
||||
match = { update: Vault.Update<Cash.State> ->
|
||||
update.produced.first().state.data.amount.quantity == i * 100L
|
||||
}
|
||||
) { update ->
|
||||
println("Bob vault update of $update")
|
||||
@ -101,9 +102,9 @@ class IntegrationTestingTutorial {
|
||||
aliceVaultUpdates.expectEvents {
|
||||
sequence(
|
||||
(1..10).map { i ->
|
||||
expect { update: Vault.Update ->
|
||||
expect { update: Vault.Update<Cash.State> ->
|
||||
println("Alice got vault update of $update")
|
||||
assertEquals((update.produced.first().state.data as Cash.State).amount.quantity, i * 100L)
|
||||
assertEquals(update.produced.first().state.data.amount.quantity, i * 100L)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
Reference in New Issue
Block a user