From 717f24deab95bcf61a453a9666b19aaf4b3b8b4d Mon Sep 17 00:00:00 2001 From: Dmitry Zuikov Date: Sun, 22 Jan 2023 13:02:21 +0300 Subject: [PATCH] wip --- hbs2-core/lib/HBS2/Actors/Peer.hs | 3 ++- hbs2-tests/test/Peer2Main.hs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hbs2-core/lib/HBS2/Actors/Peer.hs b/hbs2-core/lib/HBS2/Actors/Peer.hs index e08d1fa5..42892cd1 100644 --- a/hbs2-core/lib/HBS2/Actors/Peer.hs +++ b/hbs2-core/lib/HBS2/Actors/Peer.hs @@ -333,11 +333,12 @@ instance ( HasProtocol e p thatPeer _ = asks (view answTo) deferred _ action = do + me <- lift $ ownPeer @e who <- asks (view answTo) fab <- lift $ getFabriq @e pip <- lift $ asks (view envDeferred) ss <- lift getStorage - liftIO $ addJob pip $ runPeerM ss fab who (runResponseM who action) + liftIO $ addJob pip $ runPeerM ss fab me (runResponseM who action) response msg = do let proto = protoId @e @p (Proxy @p) diff --git a/hbs2-tests/test/Peer2Main.hs b/hbs2-tests/test/Peer2Main.hs index 848d6e34..45c8857f 100644 --- a/hbs2-tests/test/Peer2Main.hs +++ b/hbs2-tests/test/Peer2Main.hs @@ -93,7 +93,6 @@ type instance SessionData e (BlockChunks e) = BlockDownload newtype instance SessionKey e (BlockChunks e) = DownloadSessionKey (Peer e, Cookie e) deriving stock (Generic,Typeable) - deriving newtype (Hashable) newtype BlockSizeSession e = BlockSizeSession @@ -259,6 +258,7 @@ mkAdapter cww = do when ( h1 == h ) $ do liftIO $ commitBlock cww cKey h expire cKey + debug $ "BLOCK IS READY" <+> pretty h -- FIXME: return this event! -- lift $ runEngineM env $ emitBlockReadyEvent ev h -- TODO: fix this crazy shit