Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 5de3c4e

Browse files
committed
[CDEC-437] Move Arbitrary instances from wallet to wallet-test
1 parent e22d4c1 commit 5de3c4e

File tree

10 files changed

+100
-14
lines changed

10 files changed

+100
-14
lines changed

pkgs/default.nix

+35-1
Original file line numberDiff line numberDiff line change
@@ -18134,6 +18134,7 @@ license = stdenv.lib.licenses.mit;
1813418134
, cardano-sl-update
1813518135
, cardano-sl-util
1813618136
, cardano-sl-util-test
18137+
, cardano-sl-wallet-test
1813718138
, containers
1813818139
, cpphs
1813918140
, cryptonite
@@ -18207,7 +18208,6 @@ cardano-sl
1820718208
cardano-sl-block
1820818209
cardano-sl-client
1820918210
cardano-sl-core
18210-
cardano-sl-core-test
1821118211
cardano-sl-crypto
1821218212
cardano-sl-db
1821318213
cardano-sl-delegation
@@ -18291,6 +18291,7 @@ cardano-sl-txp
1829118291
cardano-sl-update
1829218292
cardano-sl-util
1829318293
cardano-sl-util-test
18294+
cardano-sl-wallet-test
1829418295
containers
1829518296
data-default
1829618297
deepseq
@@ -18352,6 +18353,7 @@ license = stdenv.lib.licenses.mit;
1835218353
, cardano-sl-util
1835318354
, cardano-sl-util-test
1835418355
, cardano-sl-wallet
18356+
, cardano-sl-wallet-test
1835518357
, cassava
1835618358
, conduit
1835718359
, connection
@@ -18460,6 +18462,7 @@ cardano-sl-txp
1846018462
cardano-sl-update
1846118463
cardano-sl-util
1846218464
cardano-sl-wallet
18465+
cardano-sl-wallet-test
1846318466
conduit
1846418467
connection
1846518468
containers
@@ -18635,6 +18638,37 @@ homepage = "https://github.com/input-output-hk/cardano-sl/#readme";
1863518638
description = "The Wallet Backend for a Cardano node";
1863618639
license = stdenv.lib.licenses.mit;
1863718640

18641+
}) {};
18642+
"cardano-sl-wallet-test" = callPackage
18643+
({
18644+
mkDerivation
18645+
, base
18646+
, bytestring
18647+
, cardano-sl-core-test
18648+
, cardano-sl-wallet
18649+
, QuickCheck
18650+
, serokell-util
18651+
, stdenv
18652+
, universum
18653+
}:
18654+
mkDerivation {
18655+
18656+
pname = "cardano-sl-wallet-test";
18657+
version = "1.3.0";
18658+
src = ./../wallet/test;
18659+
libraryHaskellDepends = [
18660+
base
18661+
bytestring
18662+
cardano-sl-core-test
18663+
cardano-sl-wallet
18664+
QuickCheck
18665+
serokell-util
18666+
universum
18667+
];
18668+
doHaddock = false;
18669+
description = "Cardano SL - wallet (Arbitrary instances)";
18670+
license = stdenv.lib.licenses.mit;
18671+
1863818672
}) {};
1863918673
"carray" = callPackage
1864018674
({

stack.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ packages:
4444
- node
4545
- tools
4646
- wallet
47+
- wallet/test
4748
- wallet-new # The new (unreleased) version of the wallet
4849
- node-ipc
4950
- acid-state-exts

wallet-new/cardano-sl-wallet-new.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ library
152152
, cardano-sl-update
153153
, cardano-sl-util
154154
, cardano-sl-wallet
155+
, cardano-sl-wallet-test
155156
, conduit
156157
, connection
157158
, containers

wallet-new/src/Cardano/Wallet/API/V1/Swagger/Example.hs

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ module Cardano.Wallet.API.V1.Swagger.Example where
22

33
import Universum
44

5-
import Test.QuickCheck (Arbitrary (..), Gen, listOf1, oneof)
6-
75
import Cardano.Wallet.API.Response
86
import Cardano.Wallet.API.V1.Types
97
import Cardano.Wallet.Orphans.Arbitrary ()
108
import Data.Default (Default (def))
9+
import qualified Data.Map.Strict as Map
1110
import Node (NodeId (..))
12-
import Pos.Arbitrary.Wallet.Web.ClientTypes ()
11+
import Test.QuickCheck (Arbitrary (..), Gen, listOf1, oneof)
12+
1313
import Pos.Client.Txp.Util (InputSelectionPolicy (..))
14+
import qualified Pos.Core.Common as Core
15+
import qualified Pos.Crypto.Signing as Core
1416
import Pos.Util.Mnemonic (Mnemonic)
1517
import Pos.Wallet.Web.ClientTypes (CUpdateInfo)
1618
import Pos.Wallet.Web.Methods.Misc (WalletStateSnapshot (..))
1719

18-
import qualified Data.Map.Strict as Map
19-
import qualified Pos.Core.Common as Core
20-
import qualified Pos.Crypto.Signing as Core
20+
import Test.Pos.Wallet.Arbitrary.Web.ClientTypes ()
2121

2222

2323
class Arbitrary a => Example a where

wallet/cardano-sl-wallet.cabal

+2-4
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ Flag for-installer
2121

2222
library
2323
hs-source-dirs: src test
24-
exposed-modules: Pos.Arbitrary.Wallet.Web.ClientTypes
25-
Pos.Wallet
24+
exposed-modules: Pos.Wallet
2625
Pos.Wallet.Redirect
2726
Pos.Wallet.WalletMode
2827

@@ -120,7 +119,6 @@ library
120119
, cardano-sl-block
121120
, cardano-sl-client
122121
, cardano-sl-core
123-
, cardano-sl-core-test
124122
, cardano-sl-crypto
125123
, cardano-sl-delegation
126124
, cardano-sl-generator
@@ -165,7 +163,6 @@ library
165163
, stm
166164
, swagger2
167165
, text
168-
, text
169166
, formatting
170167
, time
171168
, time-units
@@ -265,6 +262,7 @@ test-suite cardano-wallet-test
265262
, cardano-sl-util
266263
, cardano-sl-util-test
267264
, cardano-sl-wallet
265+
, cardano-sl-wallet-test
268266
, containers
269267
, data-default
270268
, deepseq

wallet/test/LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2018 IOHK
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included
12+
in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

wallet/test/Setup.hs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Distribution.Simple
2+
main = defaultMain

wallet/src/Pos/Arbitrary/Wallet/Web/ClientTypes.hs renamed to wallet/test/Test/Pos/Wallet/Arbitrary/Web/ClientTypes.hs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{-# OPTIONS_GHC -fno-warn-orphans #-}
22

3+
{-# LANGUAGE RecordWildCards #-}
4+
35
-- | Arbitrary instances for client types
46

5-
module Pos.Arbitrary.Wallet.Web.ClientTypes
7+
module Test.Pos.Wallet.Arbitrary.Web.ClientTypes
68
(
79
) where
810

wallet/test/Test/Pos/Wallet/Web/Tracking/SyncSpec.hs

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ import Test.QuickCheck (Arbitrary (..), Property, choose, oneof,
1818
sublistOf, suchThat, vectorOf, (===))
1919
import Test.QuickCheck.Monadic (pick)
2020

21-
import Pos.Arbitrary.Wallet.Web.ClientTypes ()
2221
import Pos.Block.Logic (rollbackBlocks)
2322
import Pos.Core (Address, BlockCount (..), blkSecurityParam)
2423
import Pos.Core.Chrono (nonEmptyOldestFirst, toNewestFirst)
2524
import Pos.Crypto (emptyPassphrase)
2625
import Pos.Launcher (HasConfigurations)
27-
2826
import qualified Pos.Wallet.Web.State as WS
2927
import Pos.Wallet.Web.State.Storage (WalletStorage (..))
3028
import Pos.Wallet.Web.Tracking.Decrypt (eskToWalletDecrCredentials)
@@ -43,6 +41,7 @@ import Test.Pos.Block.Logic.Util (EnableTxPayload (..),
4341
import Test.Pos.Configuration (withDefConfigurations)
4442
import Test.Pos.Crypto.Dummy (dummyProtocolMagic)
4543
import Test.Pos.Util.QuickCheck.Property (assertProperty)
44+
import Test.Pos.Wallet.Arbitrary.Web.ClientTypes ()
4645
import Test.Pos.Wallet.Web.Mode (walletPropertySpec)
4746
import Test.Pos.Wallet.Web.Util (importSomeWallets, wpGenBlocks)
4847

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: cardano-sl-wallet-test
2+
version: 1.3.0
3+
synopsis: Cardano SL - wallet (Arbitrary instances)
4+
description: QuickCheck Arbitrary instances for the Cardano SL wallet
5+
functionality.
6+
license: MIT
7+
license-file: LICENSE
8+
author: IOHK
9+
maintainer: IOHK <[email protected]>
10+
copyright: 2018 IOHK
11+
category: Currency
12+
build-type: Simple
13+
cabal-version: >=1.10
14+
15+
library
16+
exposed-modules: Test.Pos.Wallet.Arbitrary.Web.ClientTypes
17+
18+
build-depends: QuickCheck
19+
, base
20+
, bytestring
21+
, cardano-sl-core-test
22+
, cardano-sl-wallet
23+
, serokell-util >= 0.1.3.4
24+
, universum
25+
26+
default-language: Haskell2010
27+
28+
ghc-options: -Wall
29+
-O2

0 commit comments

Comments
 (0)