mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
Remove TransactionForContract and just use LedgerTransaction
Fix minor doc error Get rid of @deprecated method that was only present for technical reasons. Minor fix and include in changelog
This commit is contained in:
@ -14,6 +14,7 @@ import net.corda.core.identity.Party
|
||||
import net.corda.core.node.ServiceHub
|
||||
import net.corda.core.node.services.linearHeadsOfType
|
||||
import net.corda.core.serialization.CordaSerializable
|
||||
import net.corda.core.transactions.LedgerTransaction
|
||||
import net.corda.core.transactions.SignedTransaction
|
||||
import net.corda.core.utilities.seconds
|
||||
import net.corda.core.utilities.unwrap
|
||||
@ -69,7 +70,7 @@ data class TradeApprovalContract(override val legalContractReference: SecureHash
|
||||
* The verify method locks down the allowed transactions to contain just a single proposal being
|
||||
* created/modified and the only modification allowed is to the state field.
|
||||
*/
|
||||
override fun verify(tx: TransactionForContract) {
|
||||
override fun verify(tx: LedgerTransaction) {
|
||||
val command = tx.commands.requireSingleCommand<TradeApprovalContract.Commands>()
|
||||
require(tx.timeWindow?.midpoint != null) { "must have a time-window" }
|
||||
when (command.value) {
|
||||
@ -78,7 +79,7 @@ data class TradeApprovalContract(override val legalContractReference: SecureHash
|
||||
"Issue of new WorkflowContract must not include any inputs" using (tx.inputs.isEmpty())
|
||||
"Issue of new WorkflowContract must be in a unique transaction" using (tx.outputs.size == 1)
|
||||
}
|
||||
val issued = tx.outputs[0] as TradeApprovalContract.State
|
||||
val issued = tx.outputs[0].data as TradeApprovalContract.State
|
||||
requireThat {
|
||||
"Issue requires the source Party as signer" using (command.signers.contains(issued.source.owningKey))
|
||||
"Initial Issue state must be NEW" using (issued.state == WorkflowState.NEW)
|
||||
|
Reference in New Issue
Block a user