Skip to content

Commit

Permalink
Fix e2e tests using some "Party" magic
Browse files Browse the repository at this point in the history
This is debatable as we avoided introducing hydra-node specific
knowledge to the end-to-end test in the past.
  • Loading branch information
ch1bo committed Sep 13, 2021
1 parent 07b1502 commit 79c72e3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions local-cluster/test/Test/EndToEndSpec.hs
Expand Up @@ -76,6 +76,7 @@ import qualified Data.ByteString as BS
import qualified Data.ByteString.Base16 as Base16
import qualified Data.Map as Map
import Hydra.Logging (showLogsOnFailure)
import Hydra.Party (Party, deriveParty)
import HydraNode (
getMetrics,
hydraNodeProcess,
Expand Down Expand Up @@ -111,7 +112,7 @@ spec = around showLogsOnFailure $
let contestationPeriod = 10 :: Natural
send n1 $ input "Init" ["contestationPeriod" .= contestationPeriod]
waitFor tracer 3 [n1, n2, n3] $
output "ReadyToCommit" ["parties" .= [int 10, 20, 30]]
output "ReadyToCommit" ["parties" .= [alice, bob, carol]]

let someUtxo =
Map.singleton
Expand Down Expand Up @@ -181,7 +182,7 @@ spec = around showLogsOnFailure $
withHydraNode tracer tmpDir mockPorts 3 carolSk [aliceVk, bobVk] allNodeIds $ \_n3 -> do
waitForNodesConnected tracer allNodeIds [n1]
send n1 $ input "Init" ["contestationPeriod" .= int 10]
waitFor tracer 3 [n1] $ output "ReadyToCommit" ["parties" .= [int 10, 20, 30]]
waitFor tracer 3 [n1] $ output "ReadyToCommit" ["parties" .= [alice, bob, carol]]
metrics <- getMetrics n1
metrics `shouldSatisfy` ("hydra_head_events 4" `BS.isInfixOf`)

Expand All @@ -205,6 +206,11 @@ aliceVk = deriveVerKeyDSIGN aliceSk
bobVk = deriveVerKeyDSIGN bobSk
carolVk = deriveVerKeyDSIGN carolSk

alice, bob, carol :: Party
alice = deriveParty aliceSk
bob = deriveParty bobSk
carol = deriveParty carolSk

someTxId :: IsString s => s
someTxId = "9fdc525c20bc00d9dfa9d14904b65e01910c0dfe3bb39865523c1e20eaeb0903"

Expand Down

0 comments on commit 79c72e3

Please sign in to comment.