Address review comments

This commit is contained in:
Mike Hearn
2016-07-11 18:47:24 +02:00
parent 2be91ff516
commit e28ecae8c0
8 changed files with 6 additions and 16 deletions

View File

@ -81,12 +81,11 @@ class CommercialPaper : Contract {
val command = tx.commands.requireSingleCommand<CommercialPaper.Commands>()
// If it's an issue, we can't take notary from inputs, so it must be specified in the command
val cmdVal = command.value
val timestamp: TimestampCommand? = if (cmdVal is Commands.Issue)
tx.getTimestampBy(cmdVal.notary)
else if (cmdVal is Commands.Redeem)
tx.getTimestampBy(cmdVal.notary)
else
null
val timestamp: TimestampCommand? = when (cmdVal) {
is Commands.Issue -> tx.getTimestampBy(cmdVal.notary)
is Commands.Redeem -> tx.getTimestampBy(cmdVal.notary)
else -> null
}
for ((inputs, outputs, key) in groups) {
when (command.value) {