mirror of
https://github.com/corda/corda.git
synced 2025-06-15 21:58:17 +00:00
CORDA-2375 Ensure node has unique attachment contract classname/version from signed JARs (#4535)
Corda Node ensures a given contract class and version can be sourced from only one signed and trusted Attachment (JAR). An attempt to import a signed JAR as a trusted uploader (or promote to be trusted) with a class and version already present in the other trusted Attachment will raise DuplicateContractClassException. Minor fixes to Hibernate Attachment Query parser (original query to select attachment without signers would always return no attachments)
This commit is contained in:
@ -11,6 +11,12 @@ import net.corda.core.serialization.CordaSerializable
|
||||
*/
|
||||
class DuplicateAttachmentException(attachmentHash: String) : java.nio.file.FileAlreadyExistsException(attachmentHash), ClientRelevantError
|
||||
|
||||
/**
|
||||
* Thrown to indicate that a contract class name of the same version was already uploaded to a Corda node.
|
||||
*/
|
||||
class DuplicateContractClassException(contractClassName: String, version: Int, attachmentHashes: List<String>) :
|
||||
Exception("Contract $contractClassName version '$version' already present in the attachments $attachmentHashes"), ClientRelevantError
|
||||
|
||||
/**
|
||||
* Thrown to indicate that a flow was not designed for RPC and should be started from an RPC client.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user