-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create cardano-node-emulator package
Move Params and TimeSlot modules to cardano-node-emulator Move some functions from Validation to CardanoAPI
- Loading branch information
Showing
121 changed files
with
871 additions
and
615 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
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,117 @@ | ||
cabal-version: 3.0 | ||
name: cardano-node-emulator | ||
version: 1.0.0.0 | ||
|
||
common lang | ||
default-language: Haskell2010 | ||
default-extensions: | ||
DeriveFoldable | ||
DeriveFunctor | ||
DeriveGeneric | ||
DeriveLift | ||
DeriveTraversable | ||
ExplicitForAll | ||
FlexibleContexts | ||
GeneralizedNewtypeDeriving | ||
ImportQualifiedPost | ||
LambdaCase | ||
NamedFieldPuns | ||
ScopedTypeVariables | ||
StandaloneDeriving | ||
|
||
ghc-options: | ||
-Wall -Widentities -Wincomplete-record-updates | ||
-Wincomplete-uni-patterns -Wnoncanonical-monad-instances | ||
-Wredundant-constraints -Wunused-packages | ||
|
||
library | ||
import: lang | ||
hs-source-dirs: src | ||
exposed-modules: | ||
Cardano.Node.Emulator | ||
Cardano.Node.Emulator.Chain | ||
Cardano.Node.Emulator.Effects | ||
Cardano.Node.Emulator.Fee | ||
Cardano.Node.Emulator.Generators | ||
Cardano.Node.Emulator.Params | ||
Cardano.Node.Emulator.TimeSlot | ||
Cardano.Node.Emulator.Validation | ||
|
||
-------------------- | ||
-- Local components | ||
-------------------- | ||
build-depends: | ||
, freer-extras >=1.0.0 | ||
, plutus-ledger >=1.0.0 | ||
, plutus-script-utils >=1.0.0 | ||
|
||
-------------------------- | ||
-- Other IOG dependencies | ||
-------------------------- | ||
build-depends: | ||
, cardano-api:{cardano-api, gen} >=1.35 | ||
, cardano-crypto | ||
, cardano-ledger-alonzo | ||
, cardano-ledger-babbage | ||
, cardano-ledger-core | ||
, cardano-ledger-shelley | ||
, cardano-ledger-shelley-ma | ||
, cardano-slotting | ||
, ouroboros-consensus | ||
, plutus-core >=1.0.0 | ||
, plutus-ledger-api >=1.0.0 | ||
, plutus-tx >=1.0.0 | ||
|
||
------------------------ | ||
-- Non-IOG dependencies | ||
------------------------ | ||
build-depends: | ||
, aeson >=1.5.2 | ||
, array | ||
, base >=4.9 && <5 | ||
, bytestring | ||
, containers | ||
, data-default | ||
, deepseq | ||
, either | ||
, freer-simple | ||
, hedgehog | ||
, lens | ||
, mtl | ||
, openapi3 | ||
, prettyprinter >=1.1.0.1 | ||
, serialise | ||
, strict-containers | ||
, text | ||
, time | ||
|
||
test-suite cardano-node-emulator-test | ||
import: lang | ||
type: exitcode-stdio-1.0 | ||
main-is: Spec.hs | ||
hs-source-dirs: test | ||
default-language: Haskell2010 | ||
default-extensions: ImportQualifiedPost | ||
other-modules: Cardano.Node.Emulator.GeneratorsSpec | ||
|
||
-------------------- | ||
-- Local components | ||
-------------------- | ||
build-depends: | ||
, cardano-node-emulator >=1.0.0 | ||
, plutus-ledger >=1.0.0 | ||
|
||
-------------------------- | ||
-- Other IOG dependencies | ||
-------------------------- | ||
build-depends: plutus-tx >=1.0.0 | ||
|
||
------------------------ | ||
-- Non-IOG dependencies | ||
------------------------ | ||
build-depends: | ||
, aeson | ||
, base >=4.9 && <5 | ||
, hedgehog | ||
, tasty | ||
, tasty-hedgehog |
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,11 @@ | ||
module Cardano.Node.Emulator | ||
( module Export | ||
) where | ||
|
||
import Cardano.Node.Emulator.Chain as Export | ||
import Cardano.Node.Emulator.Effects as Export | ||
import Cardano.Node.Emulator.Fee as Export | ||
import Cardano.Node.Emulator.Generators as Export | ||
import Cardano.Node.Emulator.Params as Export | ||
import Cardano.Node.Emulator.TimeSlot as Export | ||
import Cardano.Node.Emulator.Validation as Export |
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
29 changes: 29 additions & 0 deletions
29
cardano-node-emulator/src/Cardano/Node/Emulator/Effects.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,29 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE DeriveAnyClass #-} | ||
{-# LANGUAGE DeriveGeneric #-} | ||
{-# LANGUAGE DerivingVia #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# LANGUAGE GADTs #-} | ||
{-# LANGUAGE KindSignatures #-} | ||
{-# LANGUAGE LambdaCase #-} | ||
{-# LANGUAGE NamedFieldPuns #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
{-# LANGUAGE TemplateHaskell #-} | ||
|
||
module Cardano.Node.Emulator.Effects( | ||
-- * Node client | ||
NodeClientEffect(..) | ||
, publishTx | ||
, getClientSlot | ||
, getClientParams | ||
) where | ||
|
||
import Cardano.Node.Emulator.Params (Params) | ||
import Control.Monad.Freer.TH (makeEffect) | ||
import Ledger (CardanoTx, Slot) | ||
|
||
data NodeClientEffect r where | ||
PublishTx :: CardanoTx -> NodeClientEffect () | ||
GetClientSlot :: NodeClientEffect Slot | ||
GetClientParams :: NodeClientEffect Params | ||
makeEffect ''NodeClientEffect |
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
17 changes: 9 additions & 8 deletions
17
plutus-ledger/src/Ledger/TimeSlot.hs → ...tor/src/Cardano/Node/Emulator/TimeSlot.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
Oops, something went wrong.