Skip to content
Permalink
Browse files

Jormungandr.NetworkSpec: Cover sending request via Jörmungandr networ…

…k layer on a not-started Jörmungandr backend

Relates to #460
  • Loading branch information...
rvl committed Jul 12, 2019
1 parent 0fcd557 commit 7aeeaa69142ddee817ecc4f11012297d975fc31c
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/jormungandr/test/integration/Cardano/Wallet/Jormungandr/NetworkSpec.hs
@@ -187,6 +187,16 @@ spec = do
res <- runExceptT (Jormungandr.getDescendantIds jml nonexistent 42)
res `shouldBe` Left (ErrGetDescendantsParentNotFound nonexistent)

it "returns correct error when backend is not started" $ \_ -> do
mgr <- newManager defaultManagerSettings
-- connect with a base URL for which the backend is not started on
let url' = url { baseUrlPort = baseUrlPort url + 5 }
let jml = Jormungandr.mkJormungandrLayer mgr url'
res <- runExceptT (Jormungandr.getBlock jml (Hash "xyzzy"))
res `shouldSatisfy` \case
Left (ErrGetBlockNetworkUnreachable _) -> True
_ -> False

-- NOTE: 'Right ()' just means that the format wasn't obviously wrong.
-- The tx may still be rejected.
describe "Submitting signed transactions (that are not obviously wrong)"

0 comments on commit 7aeeaa6

Please sign in to comment.
You can’t perform that action at this time.