mirror of
https://github.com/corda/corda.git
synced 2025-02-18 16:40:55 +00:00
TwoPartyDealProtocol fix: don't check Notary identity if the transaction has no inputs
This commit is contained in:
parent
06cf7a21be
commit
e8ae3be38d
@ -1,7 +1,6 @@
|
||||
package protocols
|
||||
|
||||
import co.paralleluniverse.fibers.Suspendable
|
||||
import core.*
|
||||
import core.contracts.*
|
||||
import core.crypto.DigitalSignature
|
||||
import core.crypto.Party
|
||||
@ -9,6 +8,8 @@ import core.crypto.signWithECDSA
|
||||
import core.messaging.SingleMessageRecipient
|
||||
import core.node.NodeInfo
|
||||
import core.protocols.ProtocolLogic
|
||||
import core.random63BitValue
|
||||
import core.seconds
|
||||
import core.utilities.ProgressTracker
|
||||
import core.utilities.UntrustworthyData
|
||||
import core.utilities.trace
|
||||
@ -258,6 +259,7 @@ object TwoPartyDealProtocol {
|
||||
}
|
||||
|
||||
private fun verifyCorrectNotary(wtx: WireTransaction, sig: DigitalSignature.LegallyIdentifiable) {
|
||||
if (wtx.inputs.isEmpty()) return // Can choose any Notary if there are no inputs
|
||||
val notary = serviceHub.loadState(wtx.inputs.first()).notary
|
||||
check(sig.signer == notary) { "Transaction not signed by the required Notary" }
|
||||
}
|
||||
|
@ -2,13 +2,12 @@ package core.testing
|
||||
|
||||
import com.google.common.base.Throwables
|
||||
import core.utilities.BriefLogFormatter
|
||||
import org.junit.Ignore
|
||||
import org.junit.Test
|
||||
|
||||
class IRSSimulationTest {
|
||||
// TODO: These tests should be a lot more complete.
|
||||
|
||||
@Test @Ignore fun `runs to completion`() {
|
||||
@Test fun `runs to completion`() {
|
||||
BriefLogFormatter.initVerbose("messaging")
|
||||
val sim = IRSSimulation(false, null)
|
||||
val future = sim.start()
|
||||
|
Loading…
x
Reference in New Issue
Block a user