From 56f8903f69f10317d3a08f654be8435bed0ea596 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Thu, 21 Mar 2019 11:19:39 +1000 Subject: [PATCH 1/3] Increase coverage of PackfileSpec --- src/Cardano/Wallet/Binary/Packfile.hs | 3 +-- test/unit/Cardano/Wallet/Binary/PackfileSpec.hs | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) 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 [] From 8e871ec415609bcc1b4768047f7c285b3957a951 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Thu, 21 Mar 2019 14:09:29 +1000 Subject: [PATCH 2/3] Add more information to README.md --- README.md | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) 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/). + +

From d2dfa676798f7f5677fc7b7bf4b979638b30323f Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Thu, 21 Mar 2019 13:47:37 +1000 Subject: [PATCH 3/3] Add API to gh-pages build --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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