From 7081d9d799c93b62c18703b2a44a54e4760afb32 Mon Sep 17 00:00:00 2001 From: Andreas Triantafyllos Date: Wed, 5 Sep 2018 17:56:01 +0300 Subject: [PATCH 1/2] [CBR-275] Changes for wallet-new & tools --- src/Cardano/Wallet/Kernel/Keystore.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Cardano/Wallet/Kernel/Keystore.hs b/src/Cardano/Wallet/Kernel/Keystore.hs index 6d3db18ca..90e89b56e 100644 --- a/src/Cardano/Wallet/Kernel/Keystore.hs +++ b/src/Cardano/Wallet/Kernel/Keystore.hs @@ -41,8 +41,7 @@ import Pos.Crypto (EncryptedSecretKey, hash) import Pos.Util.UserSecret (UserSecret, getUSPath, isEmptyUserSecret, readUserSecret, takeUserSecret, usKeys, usWallet, writeRaw, writeUserSecretRelease, _wusRootKey) -import Pos.Util.Wlog (CanLog (..), HasLoggerName (..), - LoggerName (..), logMessage) +import Pos.Util.Wlog (CanLog (..), HasLoggerName (..), logMessage) import Cardano.Wallet.Kernel.DB.HdWallet (eskToHdRootId) import Cardano.Wallet.Kernel.Types (WalletId (..)) @@ -59,7 +58,7 @@ newtype KeystoreM a = KeystoreM { fromKeystore :: IO a } deriving (Functor, Applicative, Monad, MonadIO) instance HasLoggerName KeystoreM where - askLoggerName = return (LoggerName "Keystore") + askLoggerName = return "Keystore" modifyLoggerName _ action = action instance CanLog KeystoreM where From d712da3fbffa3777abb34544fc63ae1caa0206c8 Mon Sep 17 00:00:00 2001 From: Andreas Triantafyllos Date: Thu, 6 Sep 2018 19:23:52 +0300 Subject: [PATCH 2/2] [CBR-275] Revive tests and startup code --- cardano-sl-wallet-new.cabal | 1 + integration/TransactionSpecs.hs | 5 +++-- test/InternalAPISpec.hs | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cardano-sl-wallet-new.cabal b/cardano-sl-wallet-new.cabal index c87b7d3a5..ec8a3287f 100755 --- a/cardano-sl-wallet-new.cabal +++ b/cardano-sl-wallet-new.cabal @@ -367,6 +367,7 @@ executable wal-integr-test , cardano-sl , cardano-sl-core , cardano-sl-chain + , cardano-sl-util , cardano-sl-wallet , cardano-sl-wallet-new , containers diff --git a/integration/TransactionSpecs.hs b/integration/TransactionSpecs.hs index 1756e53af..414b9d9fe 100644 --- a/integration/TransactionSpecs.hs +++ b/integration/TransactionSpecs.hs @@ -18,6 +18,8 @@ import Util import qualified Data.Map.Strict as Map import qualified Pos.Chain.Txp as Txp import qualified Pos.Core as Core +import Pos.Util.Log.LoggerConfig (defaultTestConfiguration) +import Pos.Util.Wlog (Severity (Debug), setupLogging) {-# ANN module ("HLint: ignore Reduce duplication" :: Text) #-} @@ -29,8 +31,7 @@ ppShowT :: Show a => a -> Text ppShowT = fromString . ppShow transactionSpecs :: WalletRef -> WalletClient IO -> Spec -transactionSpecs wRef wc = - +transactionSpecs wRef wc = beforeAll_ (setupLogging (defaultTestConfiguration Debug)) $ describe "Transactions" $ do randomTest "posted transactions appear in the index" 1 $ do diff --git a/test/InternalAPISpec.hs b/test/InternalAPISpec.hs index 1af67eb61..9dd6c9beb 100644 --- a/test/InternalAPISpec.hs +++ b/test/InternalAPISpec.hs @@ -20,9 +20,11 @@ import Pos.Client.KeyStorage (getSecretKeysPlain) import Pos.Wallet.Web.Account (genSaveRootKey) import Pos.Launcher (HasConfigurations) +import Pos.Util.Log.LoggerConfig (defaultTestConfiguration) +import Pos.Util.Wlog (Severity (Debug), setupLogging) import Test.Pos.Util.QuickCheck.Property (assertProperty) -import Test.Hspec (Spec, describe) +import Test.Hspec (Spec, beforeAll_, describe) import Test.Hspec.QuickCheck (modifyMaxSuccess) import Test.Pos.Configuration (withDefConfigurations) import Test.Pos.Wallet.Web.Mode (walletPropertySpec) @@ -35,7 +37,7 @@ import Servant {-# ANN module ("HLint: ignore Reduce duplication" :: Text) #-} spec :: Spec -spec = +spec = beforeAll_ (setupLogging (defaultTestConfiguration Debug)) $ withDefConfigurations $ \_ _ _ -> describe "development endpoint" $ describe "secret-keys" $ modifyMaxSuccess (const 10) deleteAllSecretKeysSpec