fix tests
This commit is contained in:
parent
1a0de55b8c
commit
578cc362b9
|
@ -7,6 +7,7 @@ import Control.Concurrent.STM.TVar
|
|||
import Control.Exception
|
||||
import Data.ASN1.Parse (runParseASN1)
|
||||
import qualified Data.ByteString as BS
|
||||
import qualified Data.HashMap.Strict as HMap
|
||||
import qualified Data.Map.Strict as Map
|
||||
import Data.Maybe (fromJust, isJust)
|
||||
import qualified Data.Set as Set
|
||||
|
@ -227,6 +228,7 @@ spec = do
|
|||
qLoadResPayload = LoadResponsePayload
|
||||
{ loadSum = 3.141
|
||||
, loadRemainingTarget = -1.337
|
||||
, loadTotalCapacity = 2.21
|
||||
, loadSegmentLowerBound = 12
|
||||
}
|
||||
|
||||
|
@ -238,7 +240,7 @@ spec = do
|
|||
, action = undefined
|
||||
, payload = undefined
|
||||
}
|
||||
requestWith senderNode a pa = mkRequest senderNode 4545 a (Just pa) $ 2342
|
||||
requestWith senderNode a pa = mkRequest senderNode 4545 a (Just pa) 2342
|
||||
responseWith a pa = responseTemplate {action = a, payload = Just pa}
|
||||
|
||||
encodeDecodeAndCheck msg = runParseASN1 parseMessage (encodeMessage msg) `shouldBe` pure msg
|
||||
|
@ -301,13 +303,13 @@ exampleNodeState = RemoteNodeState {
|
|||
|
||||
exampleLocalNode :: IO (LocalNodeState MockService)
|
||||
exampleLocalNode = do
|
||||
realNode <- newTVarIO $ RealNode {
|
||||
vservers = []
|
||||
realNodeSTM <- newTVarIO $ RealNode {
|
||||
vservers = HMap.empty
|
||||
, nodeConfig = exampleFediConf
|
||||
, bootstrapNodes = confBootstrapNodes exampleFediConf
|
||||
, nodeService = MockService
|
||||
}
|
||||
nodeStateInit realNode
|
||||
nodeStateInit realNodeSTM 0
|
||||
|
||||
|
||||
exampleFediConf :: FediChordConf
|
||||
|
|
Loading…
Reference in a new issue