Skip to content

Commit

Permalink
Add CLI test to demonstrate that we can list transactions for an empt…
Browse files Browse the repository at this point in the history
…y wallet.
  • Loading branch information
jonathanknowles committed Jul 22, 2019
1 parent 9075fb7 commit 940d516
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ module Test.Integration.Scenario.CLI.Transactions

import Prelude

import Cardano.CLI
( Iso8601Time (..) )
import Cardano.Wallet.Api.Types
( ApiFee, ApiTransaction, ApiWallet, getApiT )
import Cardano.Wallet.Primitive.Types
Expand Down Expand Up @@ -61,6 +63,7 @@ import Test.Integration.Framework.DSL
, fixtureWalletWith
, getWalletViaCLI
, listAddresses
, listTransactionsViaCLI
, postTransactionFeeViaCLI
, postTransactionViaCLI
, status
Expand All @@ -79,6 +82,10 @@ import Test.Integration.Framework.TestData
, polishWalletName
, wildcardsWalletName
)
import Test.QuickCheck
( property, withMaxSuccess )
import Test.QuickCheck.Instances.Time
()

import qualified Data.Text as T

Expand Down Expand Up @@ -644,6 +651,17 @@ spec = do
out `shouldBe` ""
c `shouldBe` ExitFailure 1

it "TRANS_LIST_01 - Listing transactions for an empty wallet" $ \ctx ->
withMaxSuccess 10 $ property $ \mAfter mBefore -> do
wallet <- emptyWallet ctx
(Exit code, Stdout out, Stderr err) <-
listTransactionsViaCLI @t ctx wallet
(Iso8601Time <$> mAfter)
(Iso8601Time <$> mBefore)
err `shouldBe` "Ok.\n"
out `shouldBe` "[]\n"
code `shouldBe` ExitSuccess

where
longAddr = replicate 10000 '1'
encodeErr = "Unable to decode Address:"
Expand Down
2 changes: 2 additions & 0 deletions lib/http-bridge/cardano-wallet-http-bridge.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ test-suite integration
, http-types
, iohk-monitoring
, process
, QuickCheck
, quickcheck-instances
, retry
, template-haskell
, temporary
Expand Down
1 change: 1 addition & 0 deletions lib/jormungandr/cardano-wallet-jormungandr.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ test-suite integration
, persistent
, process
, QuickCheck
, quickcheck-instances
, retry
, servant
, template-haskell
Expand Down
2 changes: 2 additions & 0 deletions nix/.stack.nix/cardano-wallet-http-bridge.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nix/.stack.nix/cardano-wallet-jormungandr.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 940d516

Please sign in to comment.