This commit is contained in:
Dmitry Zuikov 2023-01-25 05:26:16 +03:00
parent e2f06f0757
commit 3511003e66
2 changed files with 39 additions and 37 deletions

View File

@ -4,6 +4,9 @@ module HBS2.Net.Messaging.Fake
-- , Messaging(..)
) where
import HBS2.Net.Proto
import HBS2.Net.Messaging
import Control.Concurrent.STM (atomically) -- as STM
import Control.Concurrent.STM.TChan qualified as Chan
import Control.Concurrent.STM.TChan (TChan,newTChanIO)
@ -14,8 +17,6 @@ import Data.List qualified as List
import Data.Maybe
import Data.Hashable
import HBS2.Net.Proto
import HBS2.Net.Messaging
data FakeP2P proto msg =
FakeP2P
@ -25,7 +26,8 @@ data FakeP2P proto msg =
}
newFakeP2P :: Bool -> IO (FakeP2P peer msg)
newFakeP2P block = FakeP2P block <$> Cache.newCache Nothing
newFakeP2P block =
FakeP2P block <$> Cache.newCache Nothing
instance ( (HasPeer proto, Hashable (Peer proto))
) => Messaging (FakeP2P proto msg) proto msg where

View File

@ -102,41 +102,41 @@ test-suite test-skey
main-is: TestSKey.hs
-- executable test-peer-run
-- import: shared-properties
-- import: common-deps
-- default-language: Haskell2010
executable test-peer-run
import: shared-properties
import: common-deps
default-language: Haskell2010
-- other-modules:
other-modules:
-- -- other-extensions:
-- other-extensions:
-- -- type: exitcode-stdio-1.0
-- hs-source-dirs: test
-- main-is: Peer2Main.hs
-- type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Peer2Main.hs
-- build-depends:
-- base ^>=4.15.1.0, hbs2-core, hbs2-storage-simple
-- , async
-- , bytestring
-- , cache
-- , containers
-- , directory
-- , filepath
-- , hashable
-- , microlens-platform
-- , mtl
-- , prettyprinter
-- , QuickCheck
-- , random
-- , safe
-- , serialise
-- , stm
-- , streaming
-- , tasty
-- , tasty-hunit
-- , transformers
-- , uniplate
-- , vector
-- , data-default
-- , mwc-random
build-depends:
base ^>=4.15.1.0, hbs2-core, hbs2-storage-simple
, async
, bytestring
, cache
, containers
, directory
, filepath
, hashable
, microlens-platform
, mtl
, prettyprinter
, QuickCheck
, random
, safe
, serialise
, stm
, streaming
, tasty
, tasty-hunit
, transformers
, uniplate
, vector
, data-default
, mwc-random