diff --git a/experimental/src/main/kotlin/com/r3corda/contracts/BillOfLadingAgreement.kt b/experimental/src/main/kotlin/com/r3corda/contracts/BillOfLadingAgreement.kt index 4bf0cad38c..c6839ca306 100644 --- a/experimental/src/main/kotlin/com/r3corda/contracts/BillOfLadingAgreement.kt +++ b/experimental/src/main/kotlin/com/r3corda/contracts/BillOfLadingAgreement.kt @@ -3,7 +3,10 @@ package com.r3corda.contracts import com.r3corda.core.contracts.* import com.r3corda.core.crypto.Party import com.r3corda.core.crypto.SecureHash +import com.r3corda.core.days +import com.r3corda.core.testing.DUMMY_NOTARY import java.security.PublicKey +import java.time.Instant import java.time.LocalDate ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -109,9 +112,11 @@ class BillOfLadingAgreement : Contract { /** * Returns a transaction that issues a Bill of Lading Agreement */ - fun generateIssue(owner: PublicKey, beneficiary: Party, props: BillOfLadingProperties, notary: Party? = null): TransactionBuilder { + fun generateIssue(owner: PublicKey, beneficiary: Party, props: BillOfLadingProperties, notary: Party = DUMMY_NOTARY): TransactionBuilder { val state = State(owner, beneficiary, props) - return TransactionType.General.Builder(notary = notary).withItems(state, Command(Commands.IssueBL(), props.carrierOwner.owningKey)) + val builder = TransactionType.General.Builder(notary = notary) + builder.setTime(Instant.now(), notary, 1.days) + return builder.withItems(state, Command(Commands.IssueBL(), props.carrierOwner.owningKey)) } /** diff --git a/experimental/src/main/kotlin/com/r3corda/contracts/LOC.kt b/experimental/src/main/kotlin/com/r3corda/contracts/LOC.kt index 846b0fd5b7..7fc58657f0 100644 --- a/experimental/src/main/kotlin/com/r3corda/contracts/LOC.kt +++ b/experimental/src/main/kotlin/com/r3corda/contracts/LOC.kt @@ -4,7 +4,10 @@ import com.r3corda.contracts.asset.sumCashBy import com.r3corda.core.contracts.* import com.r3corda.core.crypto.Party import com.r3corda.core.crypto.SecureHash +import com.r3corda.core.days +import com.r3corda.core.testing.DUMMY_NOTARY import java.security.PublicKey +import java.time.Instant import java.time.LocalDate import java.time.Period import java.time.ZoneOffset @@ -142,7 +145,9 @@ class LOC : Contract { fun generateIssue(beneficiaryPaid: Boolean, issued: Boolean, terminated: Boolean, props: LOCProperties, notary: Party): TransactionBuilder { val state = State(beneficiaryPaid, issued, terminated, props) - return TransactionType.General.Builder(notary = notary).withItems(state, Command(Commands.Issuance(), props.issuingbank.owningKey)) + val builder = TransactionType.General.Builder(notary = notary) + builder.setTime(Instant.now(), notary, 1.days) + return builder.withItems(state, Command(Commands.Issuance(), props.issuingbank.owningKey)) } diff --git a/experimental/src/test/kotlin/com/r3corda/contracts/BillOfLadingAgreementTests.kt b/experimental/src/test/kotlin/com/r3corda/contracts/BillOfLadingAgreementTests.kt index 200d32ff64..1b81c75cde 100644 --- a/experimental/src/test/kotlin/com/r3corda/contracts/BillOfLadingAgreementTests.kt +++ b/experimental/src/test/kotlin/com/r3corda/contracts/BillOfLadingAgreementTests.kt @@ -48,8 +48,9 @@ class BillOfLadingAgreementTests { @Test fun issueGenerationMethod() { - val ptx = BillOfLadingAgreement().generateIssue(Bill.owner, Bill.beneficiary,Bill.props, notary = DUMMY_NOTARY).apply { + val ptx = BillOfLadingAgreement().generateIssue(Bill.owner, Bill.beneficiary,Bill.props).apply { signWith(ALICE_KEY) + signWith(DUMMY_NOTARY_KEY) } val stx = ptx.toSignedTransaction() stx.verifyToLedgerTransaction(MOCK_IDENTITY_SERVICE,attachments) diff --git a/experimental/src/test/kotlin/com/r3corda/contracts/LOCTests.kt b/experimental/src/test/kotlin/com/r3corda/contracts/LOCTests.kt index e8a5a31087..3c1f7d8c78 100644 --- a/experimental/src/test/kotlin/com/r3corda/contracts/LOCTests.kt +++ b/experimental/src/test/kotlin/com/r3corda/contracts/LOCTests.kt @@ -120,6 +120,7 @@ class LOCTests { fun issueSignedByBank() { val ptx = LOC().generateIssue(LOCstate.beneficiaryPaid, LOCstate.issued, LOCstate.terminated, LOCstate.props, DUMMY_NOTARY).apply { signWith(MEGA_CORP_KEY) + signWith(DUMMY_NOTARY_KEY) } val stx = ptx.toSignedTransaction() stx.verify()