mirror of
https://github.com/corda/corda.git
synced 2025-06-23 09:25:36 +00:00
[CORDA-2636] Ensure states created with contract upgrades can be migrated (#4786)
* Ensure states created with contract upgrades can be migrated * Remove line from api-current.txt representing an uncallable constructor
This commit is contained in:
committed by
Tommy Lillehagen
parent
21d32681ff
commit
efabab35c4
@ -307,12 +307,12 @@ object AttachmentsClassLoaderBuilder {
|
||||
*
|
||||
* @param txId The transaction ID that triggered this request; it's unused except for error messages and exceptions that can occur during setup.
|
||||
*/
|
||||
fun <T> withAttachmentsClassloaderContext(attachments: List<Attachment>, params: NetworkParameters, txId: SecureHash, block: (ClassLoader) -> T): T {
|
||||
fun <T> withAttachmentsClassloaderContext(attachments: List<Attachment>, params: NetworkParameters, txId: SecureHash, parent: ClassLoader = ClassLoader.getSystemClassLoader(), block: (ClassLoader) -> T): T {
|
||||
val attachmentIds = attachments.map { it.id }.toSet()
|
||||
|
||||
val serializationContext = cache.computeIfAbsent(Key(attachmentIds, params)) {
|
||||
// Create classloader and load serializers, whitelisted classes
|
||||
val transactionClassLoader = AttachmentsClassLoader(attachments, params, txId)
|
||||
val transactionClassLoader = AttachmentsClassLoader(attachments, params, txId, parent)
|
||||
val serializers = createInstancesOfClassesImplementing(transactionClassLoader, SerializationCustomSerializer::class.java)
|
||||
val whitelistedClasses = ServiceLoader.load(SerializationWhitelist::class.java, transactionClassLoader)
|
||||
.flatMap { it.whitelist }
|
||||
|
Reference in New Issue
Block a user