1616
1717//
1818
19+ import ContainerizationError
1920import ContainerizationError
2021import ContainerizationIO
2122import Crypto
23+ import Crypto
2224import Foundation
25+ import NIOCore
2326import NIO
2427import Synchronization
2528import Testing
@@ -176,8 +179,8 @@ struct OCIClientTests: ~Copyable {
176179 let imageConfig = Image (
177180 architecture: " amd64 " ,
178181 os: " linux " ,
179- config: Image . Config ( labels: [ " test " : " value " ] ) ,
180- rootfs: Image . Rootfs ( type: " layers " , diffIDs: [ " sha256: \( layerDigest. hexString) " ] )
182+ config: ImageConfig ( labels: [ " test " : " value " ] ) ,
183+ rootfs: Rootfs ( type: " layers " , diffIDs: [ " sha256: \( layerDigest. hexString) " ] )
181184 )
182185 let configData = try JSONEncoder ( ) . encode ( imageConfig)
183186 let configDigest = SHA256 . hash ( data: configData)
@@ -222,7 +225,7 @@ struct OCIClientTests: ~Copyable {
222225 ref: ref,
223226 descriptor: layerDescriptor,
224227 streamGenerator: { layerStream } ,
225- progress: nil
228+ progress: nil as ProgressHandler ?
226229 )
227230
228231 // Push config
@@ -232,7 +235,7 @@ struct OCIClientTests: ~Copyable {
232235 ref: ref,
233236 descriptor: configDescriptor,
234237 streamGenerator: { configStream } ,
235- progress: nil
238+ progress: nil as ProgressHandler ?
236239 )
237240
238241 // Push manifest
@@ -242,7 +245,7 @@ struct OCIClientTests: ~Copyable {
242245 ref: ref,
243246 descriptor: manifestDescriptor,
244247 streamGenerator: { manifestStream } ,
245- progress: nil
248+ progress: nil as ProgressHandler ?
246249 )
247250
248251 // Push index
@@ -260,7 +263,7 @@ struct OCIClientTests: ~Copyable {
260263 ref: ref,
261264 descriptor: indexDescriptor,
262265 streamGenerator: { indexStream } ,
263- progress: nil
266+ progress: nil as ProgressHandler ?
264267 )
265268
266269 // Verify all push operations were recorded
@@ -348,7 +351,7 @@ struct OCIClientTests: ~Copyable {
348351 ref: ref,
349352 descriptor: descriptor,
350353 streamGenerator: generator,
351- progress: nil
354+ progress: nil as ProgressHandler ?
352355 )
353356 return descriptor
354357 }
@@ -408,7 +411,7 @@ struct TestByteBufferSequence: Sendable, AsyncSequence {
408411}
409412
410413// Helper class to create a mock ContentClient for testing
411- final class MockRegistryClient : ContentClient {
414+ final class MockRegistryClient : ContentClient , @ unchecked Sendable {
412415 private var pushedContent : [ String : [ Descriptor : Data ] ] = [ : ]
413416 private var fetchableContent : [ String : [ Descriptor : Data ] ] = [ : ]
414417
@@ -446,7 +449,7 @@ final class MockRegistryClient: ContentClient {
446449 return try JSONDecoder ( ) . decode ( T . self, from: data)
447450 }
448451
449- func fetchBlob( name: String , descriptor: Descriptor , into file: URL , progress: ProgressHandler ? ) async throws -> ( Int64 , SHA256Digest ) {
452+ func fetchBlob( name: String , descriptor: Descriptor , into file: URL , progress: ProgressHandler ? ) async throws -> ( Int64 , SHA256 . Digest ) {
450453 guard let imageContent = fetchableContent [ name] ,
451454 let data = imageContent [ descriptor]
452455 else {
@@ -455,7 +458,7 @@ final class MockRegistryClient: ContentClient {
455458
456459 try data. write ( to: file)
457460 let digest = SHA256 . hash ( data: data)
458- return ( Int64 ( data. count) , SHA256Digest ( digest: digest . hexString ) )
461+ return ( Int64 ( data. count) , digest)
459462 }
460463
461464 func fetchData( name: String , descriptor: Descriptor ) async throws -> Data {
0 commit comments