Skip to content

Commit 18992c5

Browse files
committed
Fix
1 parent 9b8f5bc commit 18992c5

File tree

3 files changed

+23
-28
lines changed

3 files changed

+23
-28
lines changed

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ packages: ./typed-protocols
2222

2323
source-repository-package
2424
type: git
25-
location: git@github.com:input-output-hk/serdoc
25+
location: https://github.com/input-output-hk/serdoc
2626
tag: 2cd52c768c32c6c61ccc355bc8cfd8e67f25d8ca
2727
subdir: serdoc-core
2828

typed-protocols-doc/test/Network/TypedProtocol/Tests/ControlProtocol.hs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,17 @@
1818
module Network.TypedProtocol.Tests.ControlProtocol where
1919

2020
import Network.TypedProtocol.Documentation
21-
import Network.TypedProtocol.Documentation.TestProtocol (TestCodec (..))
21+
import Network.TypedProtocol.Documentation.TestProtocol (TestCodec)
2222

2323
import Data.ByteString ( ByteString )
24-
import qualified Data.ByteString as BS
2524
import Data.Kind
26-
import Data.Proxy ( Proxy (..) )
2725
import Data.SerDoc.Class
2826
import Data.SerDoc.Info
2927
import Data.SerDoc.TH
3028
import Data.Text ( Text )
31-
import qualified Data.Text as Text
3229
import Data.Typeable
3330
import Data.Word
34-
import GHC.Generics ( Generic )
3531
import Network.TypedProtocol.Core
36-
import Data.Text.Encoding
3732

3833
data AgentInfo c =
3934
AgentInfo
@@ -75,10 +70,10 @@ newtype VersionIdentifier = VersionIdentifier { versionIdentifierData :: ByteStr
7570
deriving (Show, Eq, Ord)
7671

7772
instance HasInfo (TestCodec ()) VersionIdentifier where
78-
info codec _ = basicField "Bytes" (FixedSize 32)
73+
info _ _ = basicField "Bytes" (FixedSize 32)
7974

8075
instance HasInfo (TestCodec ()) (FakeKey k) where
81-
info codec _ = basicField "Bytes" (FixedSize 128)
76+
info _ _ = basicField "Bytes" (FixedSize 128)
8277

8378
data BootstrapInfo =
8479
BootstrapInfo

typed-protocols-doc/test/Network/TypedProtocol/Tests/Documentation.hs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,48 +31,48 @@ p_correctAgencies :: ProtocolDescription (TestCodec ()) -> Property
3131
p_correctAgencies d =
3232
counterexample (show stateAgencyMap) .
3333
once $
34-
counterexample "EndState" (lookup "EndState" stateAgencyMap === Just NobodyAgencyID)
34+
counterexample "EndState" (lookup (State "EndState") stateAgencyMap === Just NobodyAgencyID)
3535
.&&.
36-
counterexample "InitialState" (lookup "InitialState" stateAgencyMap === Just ServerAgencyID)
36+
counterexample "InitialState" (lookup (State "InitialState") stateAgencyMap === Just ServerAgencyID)
3737
.&&.
38-
counterexample "IdleState" (lookup "IdleState" stateAgencyMap === Just ServerAgencyID)
38+
counterexample "IdleState" (lookup (State "IdleState") stateAgencyMap === Just ServerAgencyID)
3939
.&&.
40-
counterexample "WaitForConfirmationState" (lookup "WaitForConfirmationState" stateAgencyMap === Just ClientAgencyID)
40+
counterexample "WaitForConfirmationState" (lookup (State "WaitForConfirmationState") stateAgencyMap === Just ClientAgencyID)
4141
.&&.
42-
counterexample "WaitForInfoState" (lookup "WaitForInfoState" stateAgencyMap === Just ClientAgencyID)
42+
counterexample "WaitForInfoState" (lookup (State "WaitForInfoState") stateAgencyMap === Just ClientAgencyID)
4343
.&&.
44-
counterexample "WaitForPublicKeyState" (lookup "WaitForPublicKeyState" stateAgencyMap === Just ClientAgencyID)
44+
counterexample "WaitForPublicKeyState" (lookup (State "WaitForPublicKeyState") stateAgencyMap === Just ClientAgencyID)
4545
where
4646
stateAgencyMap = [(state, agency) | (state, _, agency) <- protocolStates d]
4747

4848
p_correctStateTransitions :: ProtocolDescription (TestCodec ()) -> Property
4949
p_correctStateTransitions d =
5050
once $
51-
checkMessage "VersionMessage" "InitialState" "IdleState"
51+
checkMessage "VersionMessage" (State "InitialState") (State "IdleState")
5252
.&&.
53-
checkMessage "GenStagedKeyMessage" "IdleState" "WaitForPublicKeyState"
53+
checkMessage "GenStagedKeyMessage" (State "IdleState") (State "WaitForPublicKeyState")
5454
.&&.
55-
checkMessage "QueryStagedKeyMessage" "IdleState" "WaitForPublicKeyState"
55+
checkMessage "QueryStagedKeyMessage" (State "IdleState") (State "WaitForPublicKeyState")
5656
.&&.
57-
checkMessage "DropStagedKeyMessage" "IdleState" "WaitForPublicKeyState"
57+
checkMessage "DropStagedKeyMessage" (State "IdleState") (State "WaitForPublicKeyState")
5858
.&&.
59-
checkMessage "PublicKeyMessage" "WaitForPublicKeyState" "IdleState"
59+
checkMessage "PublicKeyMessage" (State "WaitForPublicKeyState") (State "IdleState")
6060
.&&.
61-
checkMessage "InstallKeyMessage" "IdleState" "WaitForConfirmationState"
61+
checkMessage "InstallKeyMessage" (State "IdleState") (State "WaitForConfirmationState")
6262
.&&.
63-
checkMessage "InstallResultMessage" "WaitForConfirmationState" "IdleState"
63+
checkMessage "InstallResultMessage" (State "WaitForConfirmationState") (State "IdleState")
6464
.&&.
65-
checkMessage "RequestInfoMessage" "IdleState" "WaitForInfoState"
65+
checkMessage "RequestInfoMessage" (State "IdleState") (State "WaitForInfoState")
6666
.&&.
67-
checkMessage "InfoMessage" "WaitForInfoState" "IdleState"
67+
checkMessage "InfoMessage" (State "WaitForInfoState") (State "IdleState")
6868
.&&.
69-
checkMessage "AbortMessage" "InitialState" "EndState"
69+
checkMessage "AbortMessage" (State "InitialState") (State "EndState")
7070
.&&.
71-
checkMessage "EndMessage" "IdleState" "EndState"
71+
checkMessage "EndMessage" (State "IdleState") (State "EndState")
7272
.&&.
73-
checkMessage "ProtocolErrorMessage" "st" "EndState"
73+
checkMessage "ProtocolErrorMessage" AnyState (State "EndState")
7474
where
75-
checkMessage :: String -> String -> String -> Property
75+
checkMessage :: String -> StateRef -> StateRef -> Property
7676
checkMessage msgName fromState toState =
7777
counterexample msgName $ do
7878
msg <- findMessage msgName

0 commit comments

Comments
 (0)