mirror of
https://github.com/corda/corda.git
synced 2025-06-23 09:25:36 +00:00
CORDA-2576 Viral update propagation: select attachments from those loaded by node on startup. (#4745)
* Retrieve contract attachment(s) loaded by node. * Remove redundant integration test case (downgrade rule checking) * Address PR review comments. * Revert changes to classloading dependencies hack.
This commit is contained in:
@ -441,9 +441,8 @@ open class TransactionBuilder(
|
||||
require(constraints.none { it in automaticConstraints })
|
||||
require(isReference || constraints.none { it is HashAttachmentConstraint })
|
||||
|
||||
val minimumRequiredContractClassVersion = stateRefs?.map { services.loadContractAttachment(it).contractVersion }?.max() ?: DEFAULT_CORDAPP_VERSION
|
||||
return services.attachments.getLatestContractAttachments(contractClassName, minimumRequiredContractClassVersion).firstOrNull()
|
||||
?: throw MissingContractAttachments(states, contractClassName, minimumRequiredContractClassVersion)
|
||||
return services.cordappProvider.getContractAttachmentID(contractClassName)
|
||||
?: throw MissingContractAttachments(states, contractClassName)
|
||||
}
|
||||
|
||||
private fun useWhitelistedByZoneAttachmentConstraint(contractClassName: ContractClassName, networkParameters: NetworkParameters) = contractClassName in networkParameters.whitelistedContractImplementations.keys
|
||||
|
Reference in New Issue
Block a user