diff --git a/.travis.yml b/.travis.yml index dd95abaa5cd..62984bf9c01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -98,8 +98,9 @@ jobs: name: "Haddock" script: - tar xzf $STACK_WORK_CACHE + - cp -Rv specifications/api api - mkdir -p haddock && mv $(stack path --local-doc-root)/* haddock - - git add haddock && git commit -m $TRAVIS_COMMIT + - git add api haddock && git commit -m $TRAVIS_COMMIT - git checkout gh-pages && git cherry-pick -X theirs -n - && git commit --allow-empty --no-edit - git push -f -q https://WilliamKingNoel-Bot:$GITHUB_ACCESS_TOKEN@github.com/input-output-hk/cardano-wallet gh-pages &>/dev/null diff --git a/README.md b/README.md index e04a88b9307..31738f4be1d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
- Cardano-Wallet + Cardano Wallet
@@ -7,11 +7,48 @@
+diff --git a/src/Cardano/Wallet/Binary/Packfile.hs b/src/Cardano/Wallet/Binary/Packfile.hs index b0b87fac30a..f9c48e11d08 100644 --- a/src/Cardano/Wallet/Binary/Packfile.hs +++ b/src/Cardano/Wallet/Binary/Packfile.hs @@ -45,8 +45,7 @@ decodePackfile pf = case runGetOrFail getHeader pf of Left e -> Left e Right () -> case runGetOrFail getBlobs rest of Left (_, _, msg) -> Left (BlobDecodeError msg) - Right ("", _, res) -> Right res - Right (_, _, _) -> Left (BlobDecodeError "Unconsumed data") + Right (_, _, res) -> Right res data Header = Header !BS.ByteString !Int diff --git a/test/unit/Cardano/Wallet/Binary/PackfileSpec.hs b/test/unit/Cardano/Wallet/Binary/PackfileSpec.hs index cf2cdd507c7..16ec6ce787b 100644 --- a/test/unit/Cardano/Wallet/Binary/PackfileSpec.hs +++ b/test/unit/Cardano/Wallet/Binary/PackfileSpec.hs @@ -47,10 +47,14 @@ spec = do let decoded = decodePackfile "\254CARDANOYOLO\NUL\NUL\NUL\SOH" decoded `shouldBe` Left WrongFileTypeError - it "should ensure pack file version" $ do + it "should ensure pack file version is lesser" $ do let decoded = decodePackfile "\254CARDANOPACK\NUL\NUL\NUL\2" decoded `shouldBe` Left VersionTooNewError + it "should ensure pack file version is greater" $ do + let decoded = decodePackfile "\254CARDANOPACK\NUL\NUL\NUL\0" + decoded `shouldBe` Left VersionTooOldError + it "should decode an empty pack file" $ do decodePackfile packFileHeader `shouldBe` Right []