Search code examples
kotlindistributedblockchaincorda

Corda WireTransaction type mismatch - TransactionSignature inferred but DigitalSignature.WithKey expected


I am building a flow modelling the Corda IRS RatesFixFlow (I'm guessing M15 compatible.) But my app is working against the M14 build.

This is the source code:

override fun call(): TransactionSignature {
    val resp = sendAndReceive<TransactionSignature>(oracle, SignRequest(partialMerkleTx))
    return resp.unwrap { sig ->
        check(oracle.owningKey.isFulfilledBy(listOf(sig.by)))
        tx.toWireTransaction().checkSignature(sig)
        sig
    }
}

My code:

override fun call(): TransactionSignature {
    val resp = sendAndReceive<TransactionSignature>(agency, SignRequest(partialMerkleTx))
    return resp.unwrap { sig ->
        check(agency.owningKey.isFulfilledBy( listOf(sig.by)))
        tx.toWireTransaction().checkSignature(sig)
        sig
    }
}

The IRS checkSignature is pointing back to the WireTransaction.kt implementation that uses TransactionSignature as return rather than (I assume) deprecated M14 WireTransaction.checkSignature() that uses DigitalKey.WithKey

Are there any quick workarounds or hacks to reconcile the type update?


Solution

  • If you're on M14, checkSignature should take a DigitalSignature.WithKey.

    Try clearing out your local maven repository and cleaning out your caches if you're using IntelliJ: https://www.jetbrains.com/help/idea/cleaning-system-cache.html.