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 @@

- +

+
+ +Cardano Wallet helps you manage your Ada. You can use it to send and +receive payments on the [Cardano](https://www.cardano.org) blockchain. + +This project provides an HTTP Application Programming Interface (API) +and command-line interface (CLI) for working with your wallet. + +It can be used as a component of a frontend such as +[Daedalus](https://daedaluswallet.io), which provides a friendly user +interface for wallets. Most users who would like to use Cardano should +start with Daedalus. + +## Development + +This source code repository contains the next major version of Cardano +Wallet, which has been completely rewritten for the +[Shelley](https://cardanoroadmap.com/) phase. + +The Byron version of Cardano Wallet is in the +[cardano-sl](https://github.com/input-output-hk/cardano-sl) +repository. + +## How to build + +Use [Haskell Stack](https://haskellstack.org/) to build this project: + + stack build --test + + +## Documentation + + * Users of the Cardano Wallet API can refer to the [API Documentation](https://input-output-hk.github.io/cardano-wallet/api/). + * Development-related information can be found in the [Wiki](https://github.com/input-output-hk/cardano-wallet/wiki). + * To help understand the source code, refer to the [Haddock Documentation](https://input-output-hk.github.io/cardano-wallet/haddock/). + +

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 []