mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
e2f06f0757
commit
3511003e66
|
@ -4,6 +4,9 @@ module HBS2.Net.Messaging.Fake
|
||||||
-- , Messaging(..)
|
-- , Messaging(..)
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import HBS2.Net.Proto
|
||||||
|
import HBS2.Net.Messaging
|
||||||
|
|
||||||
import Control.Concurrent.STM (atomically) -- as STM
|
import Control.Concurrent.STM (atomically) -- as STM
|
||||||
import Control.Concurrent.STM.TChan qualified as Chan
|
import Control.Concurrent.STM.TChan qualified as Chan
|
||||||
import Control.Concurrent.STM.TChan (TChan,newTChanIO)
|
import Control.Concurrent.STM.TChan (TChan,newTChanIO)
|
||||||
|
@ -14,8 +17,6 @@ import Data.List qualified as List
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import Data.Hashable
|
import Data.Hashable
|
||||||
|
|
||||||
import HBS2.Net.Proto
|
|
||||||
import HBS2.Net.Messaging
|
|
||||||
|
|
||||||
data FakeP2P proto msg =
|
data FakeP2P proto msg =
|
||||||
FakeP2P
|
FakeP2P
|
||||||
|
@ -25,7 +26,8 @@ data FakeP2P proto msg =
|
||||||
}
|
}
|
||||||
|
|
||||||
newFakeP2P :: Bool -> IO (FakeP2P peer 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))
|
instance ( (HasPeer proto, Hashable (Peer proto))
|
||||||
) => Messaging (FakeP2P proto msg) proto msg where
|
) => Messaging (FakeP2P proto msg) proto msg where
|
||||||
|
|
|
@ -102,41 +102,41 @@ test-suite test-skey
|
||||||
main-is: TestSKey.hs
|
main-is: TestSKey.hs
|
||||||
|
|
||||||
|
|
||||||
-- executable test-peer-run
|
executable test-peer-run
|
||||||
-- import: shared-properties
|
import: shared-properties
|
||||||
-- import: common-deps
|
import: common-deps
|
||||||
-- default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
||||||
-- other-modules:
|
other-modules:
|
||||||
|
|
||||||
-- -- other-extensions:
|
-- other-extensions:
|
||||||
|
|
||||||
-- -- type: exitcode-stdio-1.0
|
-- type: exitcode-stdio-1.0
|
||||||
-- hs-source-dirs: test
|
hs-source-dirs: test
|
||||||
-- main-is: Peer2Main.hs
|
main-is: Peer2Main.hs
|
||||||
|
|
||||||
-- build-depends:
|
build-depends:
|
||||||
-- base ^>=4.15.1.0, hbs2-core, hbs2-storage-simple
|
base ^>=4.15.1.0, hbs2-core, hbs2-storage-simple
|
||||||
-- , async
|
, async
|
||||||
-- , bytestring
|
, bytestring
|
||||||
-- , cache
|
, cache
|
||||||
-- , containers
|
, containers
|
||||||
-- , directory
|
, directory
|
||||||
-- , filepath
|
, filepath
|
||||||
-- , hashable
|
, hashable
|
||||||
-- , microlens-platform
|
, microlens-platform
|
||||||
-- , mtl
|
, mtl
|
||||||
-- , prettyprinter
|
, prettyprinter
|
||||||
-- , QuickCheck
|
, QuickCheck
|
||||||
-- , random
|
, random
|
||||||
-- , safe
|
, safe
|
||||||
-- , serialise
|
, serialise
|
||||||
-- , stm
|
, stm
|
||||||
-- , streaming
|
, streaming
|
||||||
-- , tasty
|
, tasty
|
||||||
-- , tasty-hunit
|
, tasty-hunit
|
||||||
-- , transformers
|
, transformers
|
||||||
-- , uniplate
|
, uniplate
|
||||||
-- , vector
|
, vector
|
||||||
-- , data-default
|
, data-default
|
||||||
-- , mwc-random
|
, mwc-random
|
||||||
|
|
Loading…
Reference in New Issue