fix types and packaging to make inserting testable

This commit is contained in:
Trolli Schmittlauch 2020-04-14 00:35:19 +02:00
parent aed80263a7
commit f4847da295
3 changed files with 4 additions and 3 deletions

View file

@ -55,10 +55,10 @@ library
import: deps
-- Modules exported by the library.
exposed-modules: Hash2Pub.FediChord
exposed-modules: Hash2Pub.FediChord, Hash2Pub.DHTProtocol
-- Modules included in this library but not exported.
other-modules: Hash2Pub.Utils, Hash2Pub.DHTProtocol
other-modules: Hash2Pub.Utils
-- LANGUAGE extensions used by modules in this package.
other-extensions: GeneralizedNewtypeDeriving, DataKinds, OverloadedStrings

View file

@ -21,6 +21,7 @@ data QueryResponse = FORWARD [CacheEntry] -- ^return closest nodes from local ca
-- the entry time stamp available to the
-- protocol serialiser
| FOUND NodeState -- ^node is the responsible node for queried ID
deriving (Show, Eq)
-- TODO: evaluate more fine-grained argument passing to allow granular locking
-- | look up an ID to either claim responsibility for it or return the closest l nodes from the local cache

View file

@ -120,7 +120,7 @@ data NodeState = NodeState {
, jEntriesPerSlice :: Int
-- ^ number of desired entries per cache slice
-- needs to be parameterisable for simulation purposes
} deriving (Show)
} deriving (Show, Eq)
type NodeCache = Map.Map NodeID CacheEntry