diff --git a/hbs2-core/lib/HBS2/Actors/ChunkWriter.hs b/hbs2-core/lib/HBS2/Actors/ChunkWriter.hs index 24c40a88..3ddd735b 100644 --- a/hbs2-core/lib/HBS2/Actors/ChunkWriter.hs +++ b/hbs2-core/lib/HBS2/Actors/ChunkWriter.hs @@ -40,7 +40,10 @@ newtype ChunkId = ChunkId FilePath deriving newtype (IsString) deriving stock (Eq,Ord,Show) -data ChunkWriter h m = forall a . (MonadIO m, Storage a h ByteString m, Block ByteString ~ ByteString) => +data ChunkWriter h m = forall a . ( MonadIO m + , Storage a h ByteString m + , Block ByteString ~ ByteString + ) => ChunkWriter { pipeline :: Pipeline m () , dir :: FilePath @@ -57,7 +60,7 @@ runChunkWriter w = do stopChunkWriter :: MonadIO m => ChunkWriter h m -> m () stopChunkWriter w = stopPipeline ( pipeline w ) -newChunkWriterIO :: forall h a m . ( Key h ~ Hash h +newChunkWriterIO :: forall h a m . ( Key h ~ Hash h, h ~ HbSync , Storage a h ByteString m , Block ByteString ~ ByteString , MonadIO m @@ -155,6 +158,7 @@ getHash w salt h = liftIO do commitBlock :: forall salt h m . ( Hashable salt , Hashed h ByteString + , Block ByteString ~ ByteString , MonadIO m , Pretty (Hash h) ) diff --git a/hbs2-tests/test/Peer2Main.hs b/hbs2-tests/test/Peer2Main.hs index 879d56eb..e2bf33b7 100644 --- a/hbs2-tests/test/Peer2Main.hs +++ b/hbs2-tests/test/Peer2Main.hs @@ -161,11 +161,11 @@ makeResponse h = AnyProtocol { myProtoId = natVal (Proxy @(ProtocolId p)) data PeerEnv e = PeerEnv - { _envSelf :: Peer e - , _envFab :: Fabriq e - , _envStorage :: AnyStorage - , _envDeferred :: Pipeline IO () - , _envSessions :: Cache SKey Dynamic + { _envSelf :: Peer e + , _envFab :: Fabriq e + , _envStorage :: AnyStorage + , _envDeferred :: Pipeline IO () + , _envSessions :: Cache SKey Dynamic } newtype PeerM e m a = PeerM { fromPeerM :: ReaderT (PeerEnv e) m a } @@ -374,8 +374,8 @@ runTestPeer p zu = do let opts = [ StoragePrefix dir ] - stor <- simpleStorageInit @_ @_ @HbSync opts - cww <- newChunkWriterIO stor (Just chDir) + stor <- simpleStorageInit opts + cww <- newChunkWriterIO stor (Just chDir) sw <- liftIO $ async $ simpleStorageWorker stor cw <- liftIO $ async $ runChunkWriter cww