Skip to content

Commit

Permalink
Rebase and code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Stachyra committed Jun 5, 2019
1 parent 900765a commit 07aac25
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 23 deletions.
2 changes: 0 additions & 2 deletions exe/wallet/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ import Cardano.Wallet.Primitive.Mnemonic
( entropyToMnemonic, genEntropy, mnemonicToText )
import Cardano.Wallet.Primitive.Types
( DecodeAddress, EncodeAddress )
import Control.Applicative
( many )
import Control.Arrow
( second )
import Control.Monad
Expand Down
21 changes: 3 additions & 18 deletions lib/http-bridge/test/integration/Test/Integration/Framework/DSL.hs
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,11 @@ expectEventually ctx getter target (_, res) = case res of
let target' = getFromResponse getter r
unless (target' >= target) $ loopUntilRestore wid

-- | Same as `expectEventually` but work directly on ApiWallet
-- , not response from the API
expectEventually'
:: (MonadIO m, MonadCatch m, MonadFail m, Ord a)
=> Context
=> Context t
-> Lens' ApiWallet a
-> a
-> ApiWallet
Expand All @@ -345,23 +347,6 @@ expectValidJSON _ str =
Left e -> fail $ "expected valid JSON but failed decoding: " <> show e
Right a -> return a

-- | Expects wallet from the request to eventually reach the given state or
-- beyond
-- expectCliEventually
-- :: (MonadIO m, MonadCatch m, MonadFail m, Ord a)
-- => Lens' ApiWallet a
-- -> a
-- -> ApiWallet
-- -> m ()
-- expectCliEventually getter target w = loopUntilRestore (w ^. walletId)
-- where
-- loopUntilRestore :: (MonadIO m, MonadCatch m) => Text -> IO ()
-- loopUntilRestore wid = do
-- Stdout out <- getWalletViaCLI (T.unpack wid)
-- outJson <- expectValidJSON (Proxy @ApiWallet) out
-- let target' = view getter outJson
-- unless (target' >= target) $ loopUntilRestore wid

expectCliFieldBetween
:: (MonadIO m, MonadFail m, Show a, Ord a)
=> Lens' s a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec = do
walId <- emptyWallet' ctx
(Exit c, Stdout out, Stderr err) <- listAddressesViaCLI walId
err `shouldBe` "Ok.\n"
expectValidJSON (Proxy @[ApiAddress t]) out
_ <- expectValidJSON (Proxy @[ApiAddress t]) out
c `shouldBe` ExitSuccess

where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ module Test.Integration.Scenario.CLI.Transactions
import Prelude

import Cardano.Wallet.Api.Types
( ApiAddress, ApiTransaction, getApiT )
( ApiTransaction, ApiWallet, getApiT )
import Cardano.Wallet.Primitive.Types
( DecodeAddress (..)
, EncodeAddress (..)
, Direction (..)
, EncodeAddress (..)
, TxStatus (..)
, encodeAddress
)
Expand Down

0 comments on commit 07aac25

Please sign in to comment.