Простой способ сделать это будет следующим:
private companion object {
val testIssuance = bigCorp.ref(111)
val testPounds: Cash.State = 1999.POUNDS.CASH issuedBy testIssuance
}
fun getPaper(): CommercialPaperState {
return CommercialPaperState(testIssuance, testIssuance.party, testPounds.amount , Instant.now()+10.days)
}
Или ниже приведен еще один более сложный способ сделать это без использования денежных средств, предоставляемых в составе Finance CorDapp, поставляемого вместе с Corda 4
import net.corda.finance.`issued by`
private companion object {
val bigCorp = TestIdentity((CordaX500Name("BigCorp", "New York", "GB")))
val testIssuance = bigCorp.ref((("JoinKey").toByte()))
val testAmount = Amount<Currency>(1000,Currency.getInstance(Locale.GERMANY))
}
fun getPaper(): CommercialPaperState {
return CommercialPaperState(testIssuance, testIssuance.party, testAmount `issued by` testIssuance, Instant.now()+10.days)
}