mirror of
https://github.com/corda/corda.git
synced 2024-12-19 04:57:58 +00:00
core: Suppress cast warnings
This commit is contained in:
parent
0f29067680
commit
63e2ec32cf
@ -63,18 +63,21 @@ class StateRefGenerator: Generator<StateRef>(StateRef::class.java) {
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("CAST_NEVER_SUCCEEDS")
|
||||
class TransactionStateGenerator<T : ContractState>(val stateGenerator: Generator<T>) : Generator<TransactionState<T>>(TransactionState::class.java as Class<TransactionState<T>>) {
|
||||
override fun generate(random: SourceOfRandomness, status: GenerationStatus): TransactionState<T> {
|
||||
return TransactionState(stateGenerator.generate(random, status), PartyGenerator().generate(random, status))
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("CAST_NEVER_SUCCEEDS")
|
||||
class IssuedGenerator<T>(val productGenerator: Generator<T>) : Generator<Issued<T>>(Issued::class.java as Class<Issued<T>>) {
|
||||
override fun generate(random: SourceOfRandomness, status: GenerationStatus): Issued<T> {
|
||||
return Issued(PartyAndReferenceGenerator().generate(random, status), productGenerator.generate(random, status))
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("CAST_NEVER_SUCCEEDS")
|
||||
class AmountGenerator<T>(val tokenGenerator: Generator<T>) : Generator<Amount<T>>(Amount::class.java as Class<Amount<T>>) {
|
||||
override fun generate(random: SourceOfRandomness, status: GenerationStatus): Amount<T> {
|
||||
return Amount(random.nextLong(0, 1000000), tokenGenerator.generate(random, status))
|
||||
|
Loading…
Reference in New Issue
Block a user