Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move integration framework context to dedicated module.
The `Context` type is not really related to the `Request` type, and yet it's currently located in the `Request` module. This change moves `Context` into its own module, so that contexts and requests can be kept separate from one another.
- Loading branch information
1 parent
37c70ff
commit 4bb7e3a
Showing
6 changed files
with
78 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
lib/core-integration/src/Test/Integration/Framework/Context.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE DeriveGeneric #-} | ||
|
||
module Test.Integration.Framework.Context | ||
( Context (..) | ||
, TxDescription (..) | ||
) where | ||
|
||
import Prelude | ||
|
||
import Cardano.CLI | ||
( Port (..) ) | ||
import Cardano.Wallet.Primitive.Types | ||
( NetworkParameters ) | ||
import Cardano.Wallet.Transaction | ||
( DelegationAction ) | ||
import Data.Proxy | ||
( Proxy (..) ) | ||
import Data.Text | ||
( Text ) | ||
import GHC.Generics | ||
( Generic ) | ||
import Network.HTTP.Client | ||
( Manager ) | ||
import Numeric.Natural | ||
( Natural ) | ||
import Test.Integration.Faucet | ||
( Faucet ) | ||
|
||
-- | Context for integration tests. | ||
-- | ||
data Context t = Context | ||
{ _cleanup | ||
:: IO () | ||
-- ^ A cleanup action. | ||
, _manager | ||
:: (Text, Manager) | ||
-- ^ The underlying base URL and manager used by the wallet client. | ||
, _walletPort | ||
:: Port "wallet" | ||
-- ^ Server TCP port. | ||
, _faucet | ||
:: Faucet | ||
-- ^ Provides access to funded wallets. | ||
, _feeEstimator :: TxDescription -> (Natural, Natural) | ||
-- ^ A fee estimator. | ||
, _networkParameters :: NetworkParameters | ||
-- ^ Blockchain parameters for the underlying chain. | ||
, _target | ||
:: Proxy t | ||
} | ||
deriving Generic | ||
|
||
-- | Describe a transaction in terms of its inputs and outputs. | ||
data TxDescription | ||
= DelegDescription DelegationAction | ||
| PaymentDescription | ||
{ nInputs | ||
:: Int | ||
, nOutputs | ||
:: Int | ||
, nChanges | ||
:: Int | ||
} | ||
deriving Show |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters