diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index d57531a1..56e23c79 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -3,8 +3,8 @@ on: paths: - '**.hs' - '**.nix' - - 'nix/sources.json' - - 'mlabs-pab.cabal' + - '*.cabal' + - '.gitmodules' branches: - master - staging @@ -12,8 +12,8 @@ on: paths: - '**.hs' - '**.nix' - - 'nix/sources.json' - - 'mlabs-pab.cabal' + - '*.cabal' + - '.gitmodules' jobs: check-formatting: runs-on: ubuntu-latest @@ -50,10 +50,12 @@ jobs: - run: ~/.local/bin/hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') name: Lint + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + submodules: true - uses: cachix/install-nix-action@v13 name: Set up nix and IOHK cache with: diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..33407bf1 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "plutus-config"] + path = plutus-config + url = git@github.com:mlabs-haskell/plutus-config.git diff --git a/README.md b/README.md index 60319c0d..48c9b272 100644 --- a/README.md +++ b/README.md @@ -62,49 +62,76 @@ instance HasDefinitions MyContracts where MyContract.contract params ``` -3. Write your main entrypoint for the application, with the preferred configurations +3. Write your main entrypoint for the application and the configuration ```haskell -import BotPlutusInterface.Types (CLILocation (Local), LogLevel (Debug), PABConfig (..)) -import Cardano.Api (NetworkId (Testnet), NetworkMagic (..)) -import Data.Aeson qualified as JSON -import Data.ByteString.Lazy qualified as LazyByteString -import Data.Default (def) -import Servant.Client.Core (BaseUrl (BaseUrl), Scheme (Http)) +import BotPlutusInterface qualified +import BotPlutusInterface.Config qualified as BotPlutusInterface +import Prelude main :: IO () main = do - protocolParams <- JSON.decode <$> LazyByteString.readFile "protocol.json" - let pabConf = - PABConfig - { -- Calling the cli locally or through an ssh connection - pcCliLocation = Local - , pcNetwork = Testnet (NetworkMagic 42) - , pcChainIndexUrl = BaseUrl Http "localhost" 9083 "" - , pcPort = 9080 - , pcProtocolParams = protocolParams - , pcTipPollingInterval = 10_000_000 - , -- | Slot configuration of the network, the default value can be used for the mainnet - pcSlotConfig = def - , pcOwnPubKeyHash = "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546" - , -- Directory name of the script and data files - pcScriptFileDir = "./scripts" - , -- Directory for the signing key file(s) - pcSigningKeyFileDir = "./signing-keys" - , -- Directory where the encoded transaction files will be saved - pcTxFileDir = "./txs" - , -- Dry run mode will build the tx, but skip the submit step - pcDryRun = False - , pcLogLevel = Debug - , -- | Forced budget for scripts, as optional (CPU Steps, Memory Units) - pcForceBudget = Nothing - , -- Protocol params file location relative to the cardano-cli working directory (needed for the cli) - , pcProtocolParamsFile = "./protocol.json" - , pcEnableTxEndpoint = True - } + pabConf <- + either error id + <$> BotPlutusInterface.loadPABConfig "config/pabConfig.value" BotPlutusInterface.runPAB @MyContracts pabConf ``` +Configuration format (example: ): + +``` console +Top-level configuration file fields: + cliLocation: `local` or destination text + calling the cli through ssh when set to destination (default: + local) + chainIndexUrl: url text + (default: "http://localhost:9083") + networkId: `mainnet` or 32-bit unsigned integral number + (default: 42) + slotConfig: SlotConfig configuration + (see default in example) + scriptFileDir: path text + Directory name of the script and data files (default: + "./result-scripts") + signingKeyFileDir: path text + Directory name of the signing key files (default: "./signing-keys") + txFileDir: path text + Directory name of the transaction files (default: "./txs") + protocolParamsFile: filepath text + Protocol params file location relative to the cardano-cli working + directory (needed for the cli) in JSON format. (default: + "./protocol.json") + dryRun: `true` or `false` + Dry run mode will build the tx, but skip the submit step (default: + true) + logLevel: `error` or `warn` or `notice` or `info` or `debug` + (default: info) + ownPubKeyHash: PubKeyHash text + (default: "") + tipPollingInterval: non-negative integral number + (default: 10000000) + forceBudget: `nothing` or ExecutionUnits configuration + Forced budget for scripts, as optional (CPU Steps, Memory Units) + (default: nothing) + port: port non-negative integral number + (default: 9080) + enableTxEndpoint: `true` or `false` + (default: false) + +ExecutionUnits configuration + steps: REQUIRED non-negative integral number + This corresponds roughly to the time to execute a script. + memory: REQUIRED non-negative integral number + This corresponds roughly to the peak memory used during script + execution. + +SlotConfig configuration + length: REQUIRED integral number + Length (number of milliseconds) of one slot + zeroTime: REQUIRED integral number + Beginning of slot 0 (in milliseconds) +``` + To run the fake PAB, you need to prepare a few more things: 4. Save the protocol params file to the root folder of your project using the cardano-cli @@ -128,6 +155,7 @@ The fake PAB consists of the following modules: - **BotPlutusInterface** main entry point - **BotPlutusInterface.Server** Servant server, handling http endpoint calls and websockets +- **BotPlutusInterface.Config** load/save PAB configuration file - **BotPlutusInterface.Contract** handling contract effects by creating the necessary files and calling cardano-cli commands (a few effects are mocked) - **BotPlutusInterface.Balance** doing some preparations so the cli can process the rest (non-ada asset balancing, addig tx inputs, adding minimum lovelaces, add signatories) - **BotPlutusInterface.CardanoCLI** wrappers for cardano-cli commands diff --git a/bot-plutus-interface.cabal b/bot-plutus-interface.cabal index 92d88fbb..b7fd4fc3 100644 --- a/bot-plutus-interface.cabal +++ b/bot-plutus-interface.cabal @@ -25,9 +25,9 @@ source-repository head common common-lang ghc-options: -Wall -Wcompat -Wincomplete-record-updates - -Wincomplete-uni-patterns -Wredundant-constraints -Werror - -fobject-code -fno-ignore-interface-pragmas - -fno-omit-interface-pragmas -fplugin=RecordDotPreprocessor + -Wincomplete-uni-patterns -Wredundant-constraints -fobject-code + -Werror -fno-ignore-interface-pragmas -fno-omit-interface-pragmas + -fplugin=RecordDotPreprocessor build-depends: , base ^>=4.14 @@ -76,15 +76,17 @@ library import: common-lang exposed-modules: BotPlutusInterface + BotPlutusInterface.Balance BotPlutusInterface.CardanoCLI BotPlutusInterface.ChainIndex + BotPlutusInterface.Config BotPlutusInterface.Contract BotPlutusInterface.Effects BotPlutusInterface.Files - BotPlutusInterface.Balance + BotPlutusInterface.Server BotPlutusInterface.Types BotPlutusInterface.UtxoParser - BotPlutusInterface.Server + build-depends: , aeson ^>=1.5.0.0 , attoparsec >=0.13.2.2 @@ -92,6 +94,8 @@ library , cardano-api , cardano-crypto , cardano-ledger-alonzo + , config-schema + , config-value , containers , data-default , data-default-class @@ -109,6 +113,7 @@ library , playground-common , plutus-chain-index , plutus-chain-index-core + , plutus-config , plutus-contract , plutus-core , plutus-ledger @@ -117,17 +122,21 @@ library , plutus-pab , plutus-tx , plutus-tx-plugin + , pretty , process , QuickCheck + , regex-compat , row-types , serialise , servant , servant-client + , servant-client-core , servant-server , servant-websockets , split , stm , text ^>=1.2.4.0 + , tostring , transformers , transformers-either , unordered-containers @@ -144,10 +153,11 @@ test-suite bot-plutus-interface-test main-is: Spec.hs ghc-options: -fplugin-opt PlutusTx.Plugin:defer-errors other-modules: - Spec.BotPlutusInterface.Contract Spec.BotPlutusInterface.Balance - Spec.BotPlutusInterface.UtxoParser + Spec.BotPlutusInterface.Config + Spec.BotPlutusInterface.Contract Spec.BotPlutusInterface.Server + Spec.BotPlutusInterface.UtxoParser Spec.MockContract build-depends: @@ -159,6 +169,8 @@ test-suite bot-plutus-interface-test , bytestring ^>=0.10.12.0 , cardano-api , cardano-crypto-class + , config-schema + , config-value , containers , data-default , data-default-class @@ -176,6 +188,7 @@ test-suite bot-plutus-interface-test , playground-common , plutus-chain-index , plutus-chain-index-core + , plutus-config , plutus-contract , plutus-core , plutus-ledger @@ -197,8 +210,8 @@ test-suite bot-plutus-interface-test , tasty-quickcheck , temporary , text ^>=1.2.4.0 - , uuid , utf8-string + , uuid , warp hs-source-dirs: test diff --git a/cabal.project b/cabal.project index e108cbfe..5093196d 100644 --- a/cabal.project +++ b/cabal.project @@ -1,6 +1,7 @@ -index-state: 2022-01-22T00:00:00Z +index-state: 2022-03-10T00:00:00Z -packages: ./. +packages: ./bot-plutus-interface.cabal + ./plutus-config/plutus-config.cabal ./examples/plutus-game/plutus-game.cabal ./examples/plutus-transfer/plutus-transfer.cabal ./examples/plutus-nft/plutus-nft.cabal diff --git a/examples/plutus-game/app/Main.hs b/examples/plutus-game/app/Main.hs index 25e306b3..69974f00 100644 --- a/examples/plutus-game/app/Main.hs +++ b/examples/plutus-game/app/Main.hs @@ -3,15 +3,12 @@ module Main (main) where import BotPlutusInterface qualified +import BotPlutusInterface.Config qualified as BotPlutusInterface import BotPlutusInterface.Types ( - CLILocation (Local), HasDefinitions (..), - LogLevel (Debug), - PABConfig (..), SomeBuiltin (..), endpointsToSchemas, ) -import Cardano.Api (NetworkId (Testnet), NetworkMagic (..)) import Cardano.PlutusExample.Game ( GameSchema, GuessParams, @@ -19,14 +16,9 @@ import Cardano.PlutusExample.Game ( guess, lock, ) -import Data.Aeson qualified as JSON import Data.Aeson.TH (defaultOptions, deriveJSON) -import Data.ByteString.Lazy qualified as LazyByteString -import Data.Default (def) -import Data.Maybe (fromMaybe) import Playground.Types (FunctionSchema) import Schema (FormSchema) -import Servant.Client.Core (BaseUrl (BaseUrl), Scheme (Http)) import Prelude instance HasDefinitions GameContracts where @@ -48,26 +40,7 @@ $(deriveJSON defaultOptions ''GameContracts) main :: IO () main = do - protocolParams <- - fromMaybe (error "protocol.json file not found") . JSON.decode - <$> LazyByteString.readFile "protocol.json" - let pabConf = - PABConfig - { pcCliLocation = Local - , pcNetwork = Testnet (NetworkMagic 1097911063) - , pcChainIndexUrl = BaseUrl Http "localhost" 9083 "" - , pcPort = 9080 - , pcProtocolParams = protocolParams - , pcTipPollingInterval = 10_000_000 - , pcSlotConfig = def - , pcOwnPubKeyHash = "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546" - , pcScriptFileDir = "./scripts" - , pcSigningKeyFileDir = "./signing-keys" - , pcTxFileDir = "./txs" - , pcDryRun = True - , pcLogLevel = Debug - , pcProtocolParamsFile = "./protocol.json" - , pcForceBudget = Just (1000, 1000) - , pcEnableTxEndpoint = True - } + pabConf <- + either error id + <$> BotPlutusInterface.loadPABConfig "config/pabConfig.value" BotPlutusInterface.runPAB @GameContracts pabConf diff --git a/examples/plutus-game/config/pabConfig.value b/examples/plutus-game/config/pabConfig.value new file mode 100644 index 00000000..27d9650a --- /dev/null +++ b/examples/plutus-game/config/pabConfig.value @@ -0,0 +1,26 @@ +-- Calling the cli locally or through an ssh connection +cliLocation: local +chainIndexUrl: "http://localhost:9083" +networkId: 1097911063 +-- Slot configuration of the network, the default value can be used for the mainnet +slotConfig: + length: 1000 + zeroTime: 1596059091000 +-- Directory name of the script and data files +scriptFileDir: "./scripts" +-- Directory for the signing key file(s) +signingKeyFileDir: "./signing-keys" +-- Directory where the encoded transaction files will be saved +txFileDir: "./txs" +-- Protocol params file location relative to the cardano-cli working directory (needed for the cli) +protocolParamsFile: "./config/protocol.json" +-- Dry run mode will build the tx, but skip the submit step +dryRun: true +logLevel: debug +ownPubKeyHash: "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546" +tipPollingInterval: 10000000 +forceBudget: + steps: 1000 + memory: 1000 +port: 9080 +enableTxEndpoint: true diff --git a/examples/plutus-game/protocol.json b/examples/plutus-game/config/protocol.json similarity index 100% rename from examples/plutus-game/protocol.json rename to examples/plutus-game/config/protocol.json diff --git a/examples/plutus-nft/app/Main.hs b/examples/plutus-nft/app/Main.hs index 98d1e907..d562c73f 100644 --- a/examples/plutus-nft/app/Main.hs +++ b/examples/plutus-nft/app/Main.hs @@ -4,28 +4,20 @@ module Main (main) where import BotPlutusInterface qualified +import BotPlutusInterface.Config qualified as BotPlutusInterface import BotPlutusInterface.Types ( - CLILocation (Local), HasDefinitions (..), - LogLevel (Debug), - PABConfig (..), SomeBuiltin (..), endpointsToSchemas, ) -import Cardano.Api (NetworkId (Testnet), NetworkMagic (..)) import Cardano.PlutusExample.NFT ( NFTSchema, mintNft, ) -import Data.Aeson qualified as JSON import Data.Aeson.TH (defaultOptions, deriveJSON) -import Data.ByteString.Lazy qualified as LazyByteString -import Data.Default (def) -import Data.Maybe (fromMaybe) import Ledger.Value (TokenName) import Playground.Types (FunctionSchema) import Schema (FormSchema) -import Servant.Client.Core (BaseUrl (BaseUrl), Scheme (Http)) import Prelude instance HasDefinitions MintNFTContracts where @@ -48,26 +40,7 @@ $(deriveJSON defaultOptions ''MintNFTContracts) main :: IO () main = do - protocolParams <- - fromMaybe (error "protocol.json file not found") . JSON.decode - <$> LazyByteString.readFile "protocol.json" - let pabConf = - PABConfig - { pcCliLocation = Local - , pcNetwork = Testnet (NetworkMagic 1097911063) - , pcChainIndexUrl = BaseUrl Http "localhost" 9083 "" - , pcPort = 9080 - , pcProtocolParams = protocolParams - , pcTipPollingInterval = 10_000_000 - , pcSlotConfig = def - , pcOwnPubKeyHash = "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546" - , pcScriptFileDir = "./scripts" - , pcSigningKeyFileDir = "./signing-keys" - , pcTxFileDir = "./txs" - , pcDryRun = True - , pcLogLevel = Debug - , pcProtocolParamsFile = "./protocol.json" - , pcForceBudget = Just (1000, 1000) - , pcEnableTxEndpoint = True - } + pabConf <- + either error id + <$> BotPlutusInterface.loadPABConfig "config/pabConfig.value" BotPlutusInterface.runPAB @MintNFTContracts pabConf diff --git a/examples/plutus-nft/config/pabConfig.value b/examples/plutus-nft/config/pabConfig.value new file mode 100644 index 00000000..27d9650a --- /dev/null +++ b/examples/plutus-nft/config/pabConfig.value @@ -0,0 +1,26 @@ +-- Calling the cli locally or through an ssh connection +cliLocation: local +chainIndexUrl: "http://localhost:9083" +networkId: 1097911063 +-- Slot configuration of the network, the default value can be used for the mainnet +slotConfig: + length: 1000 + zeroTime: 1596059091000 +-- Directory name of the script and data files +scriptFileDir: "./scripts" +-- Directory for the signing key file(s) +signingKeyFileDir: "./signing-keys" +-- Directory where the encoded transaction files will be saved +txFileDir: "./txs" +-- Protocol params file location relative to the cardano-cli working directory (needed for the cli) +protocolParamsFile: "./config/protocol.json" +-- Dry run mode will build the tx, but skip the submit step +dryRun: true +logLevel: debug +ownPubKeyHash: "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546" +tipPollingInterval: 10000000 +forceBudget: + steps: 1000 + memory: 1000 +port: 9080 +enableTxEndpoint: true diff --git a/examples/plutus-nft/protocol.json b/examples/plutus-nft/config/protocol.json similarity index 100% rename from examples/plutus-nft/protocol.json rename to examples/plutus-nft/config/protocol.json diff --git a/examples/plutus-transfer/app/Main.hs b/examples/plutus-transfer/app/Main.hs index e385200e..cbcb88f4 100644 --- a/examples/plutus-transfer/app/Main.hs +++ b/examples/plutus-transfer/app/Main.hs @@ -4,28 +4,20 @@ module Main (main) where import BotPlutusInterface qualified +import BotPlutusInterface.Config qualified as BotPlutusInterface import BotPlutusInterface.Types ( - CLILocation (Local), HasDefinitions (..), - LogLevel (Debug), - PABConfig (..), SomeBuiltin (..), endpointsToSchemas, ) -import Cardano.Api (NetworkId (Testnet), NetworkMagic (..)) import Cardano.PlutusExample.Transfer ( TransferParams, TransferSchema, transfer, ) -import Data.Aeson qualified as JSON import Data.Aeson.TH (defaultOptions, deriveJSON) -import Data.ByteString.Lazy qualified as LazyByteString -import Data.Default (def) -import Data.Maybe (fromMaybe) import Playground.Types (FunctionSchema) import Schema (FormSchema) -import Servant.Client.Core (BaseUrl (BaseUrl), Scheme (Http)) import Prelude instance HasDefinitions TransferContracts where @@ -47,26 +39,7 @@ $(deriveJSON defaultOptions ''TransferContracts) main :: IO () main = do - protocolParams <- - fromMaybe (error "protocol.json file not found") . JSON.decode - <$> LazyByteString.readFile "protocol.json" - let pabConf = - PABConfig - { pcCliLocation = Local - , pcNetwork = Testnet (NetworkMagic 1097911063) - , pcChainIndexUrl = BaseUrl Http "localhost" 9083 "" - , pcPort = 9080 - , pcProtocolParams = protocolParams - , pcTipPollingInterval = 10_000_000 - , pcSlotConfig = def - , pcOwnPubKeyHash = "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546" - , pcScriptFileDir = "./scripts" - , pcSigningKeyFileDir = "./signing-keys" - , pcTxFileDir = "./txs" - , pcDryRun = True - , pcLogLevel = Debug - , pcProtocolParamsFile = "./protocol.json" - , pcForceBudget = Nothing - , pcEnableTxEndpoint = True - } + pabConf <- + either error id + <$> BotPlutusInterface.loadPABConfig "config/pabConfig.value" BotPlutusInterface.runPAB @TransferContracts pabConf diff --git a/examples/plutus-transfer/config/pabConfig.value b/examples/plutus-transfer/config/pabConfig.value new file mode 100644 index 00000000..a83d8cae --- /dev/null +++ b/examples/plutus-transfer/config/pabConfig.value @@ -0,0 +1,24 @@ +-- Calling the cli locally or through an ssh connection +cliLocation: local +chainIndexUrl: "http://localhost:9083" +networkId: 1097911063 +-- Slot configuration of the network, the default value can be used for the mainnet +slotConfig: + length: 1000 + zeroTime: 1596059091000 +-- Directory name of the script and data files +scriptFileDir: "./scripts" +-- Directory for the signing key file(s) +signingKeyFileDir: "./signing-keys" +-- Directory where the encoded transaction files will be saved +txFileDir: "./txs" +-- Protocol params file location relative to the cardano-cli working directory (needed for the cli) +protocolParamsFile: "./config/protocol.json" +-- Dry run mode will build the tx, but skip the submit step +dryRun: true +logLevel: debug +ownPubKeyHash: "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546" +tipPollingInterval: 10000000 +forceBudget: nothing +port: 9080 +enableTxEndpoint: true diff --git a/examples/plutus-transfer/protocol.json b/examples/plutus-transfer/config/protocol.json similarity index 100% rename from examples/plutus-transfer/protocol.json rename to examples/plutus-transfer/config/protocol.json diff --git a/flake.lock b/flake.lock index 8c1a110e..4780f2a4 100644 --- a/flake.lock +++ b/flake.lock @@ -32,6 +32,54 @@ "type": "github" } }, + "HTTP_3": { + "flake": false, + "locked": { + "lastModified": 1451647621, + "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", + "owner": "phadej", + "repo": "HTTP", + "rev": "9bc0996d412fef1787449d841277ef663ad9a915", + "type": "github" + }, + "original": { + "owner": "phadej", + "repo": "HTTP", + "type": "github" + } + }, + "HTTP_4": { + "flake": false, + "locked": { + "lastModified": 1451647621, + "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", + "owner": "phadej", + "repo": "HTTP", + "rev": "9bc0996d412fef1787449d841277ef663ad9a915", + "type": "github" + }, + "original": { + "owner": "phadej", + "repo": "HTTP", + "type": "github" + } + }, + "HTTP_5": { + "flake": false, + "locked": { + "lastModified": 1451647621, + "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", + "owner": "phadej", + "repo": "HTTP", + "rev": "9bc0996d412fef1787449d841277ef663ad9a915", + "type": "github" + }, + "original": { + "owner": "phadej", + "repo": "HTTP", + "type": "github" + } + }, "Win32-network": { "flake": false, "locked": { @@ -67,6 +115,57 @@ } }, "cabal-32_2": { + "flake": false, + "locked": { + "lastModified": 1603716527, + "narHash": "sha256-sDbrmur9Zfp4mPKohCD8IDZfXJ0Tjxpmr2R+kg5PpSY=", + "owner": "haskell", + "repo": "cabal", + "rev": "94aaa8e4720081f9c75497e2735b90f6a819b08e", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.2", + "repo": "cabal", + "type": "github" + } + }, + "cabal-32_3": { + "flake": false, + "locked": { + "lastModified": 1603716527, + "narHash": "sha256-sDbrmur9Zfp4mPKohCD8IDZfXJ0Tjxpmr2R+kg5PpSY=", + "owner": "haskell", + "repo": "cabal", + "rev": "94aaa8e4720081f9c75497e2735b90f6a819b08e", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.2", + "repo": "cabal", + "type": "github" + } + }, + "cabal-32_4": { + "flake": false, + "locked": { + "lastModified": 1603716527, + "narHash": "sha256-sDbrmur9Zfp4mPKohCD8IDZfXJ0Tjxpmr2R+kg5PpSY=", + "owner": "haskell", + "repo": "cabal", + "rev": "94aaa8e4720081f9c75497e2735b90f6a819b08e", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.2", + "repo": "cabal", + "type": "github" + } + }, + "cabal-32_5": { "flake": false, "locked": { "lastModified": 1603716527, @@ -101,6 +200,57 @@ } }, "cabal-34_2": { + "flake": false, + "locked": { + "lastModified": 1622475795, + "narHash": "sha256-chwTL304Cav+7p38d9mcb+egABWmxo2Aq+xgVBgEb/U=", + "owner": "haskell", + "repo": "cabal", + "rev": "b086c1995cdd616fc8d91f46a21e905cc50a1049", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.4", + "repo": "cabal", + "type": "github" + } + }, + "cabal-34_3": { + "flake": false, + "locked": { + "lastModified": 1622475795, + "narHash": "sha256-chwTL304Cav+7p38d9mcb+egABWmxo2Aq+xgVBgEb/U=", + "owner": "haskell", + "repo": "cabal", + "rev": "b086c1995cdd616fc8d91f46a21e905cc50a1049", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.4", + "repo": "cabal", + "type": "github" + } + }, + "cabal-34_4": { + "flake": false, + "locked": { + "lastModified": 1622475795, + "narHash": "sha256-chwTL304Cav+7p38d9mcb+egABWmxo2Aq+xgVBgEb/U=", + "owner": "haskell", + "repo": "cabal", + "rev": "b086c1995cdd616fc8d91f46a21e905cc50a1049", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.4", + "repo": "cabal", + "type": "github" + } + }, + "cabal-34_5": { "flake": false, "locked": { "lastModified": 1640353650, @@ -118,6 +268,57 @@ } }, "cabal-36": { + "flake": false, + "locked": { + "lastModified": 1640163203, + "narHash": "sha256-TwDWP2CffT0j40W6zr0J1Qbu+oh3nsF1lUx9446qxZM=", + "owner": "haskell", + "repo": "cabal", + "rev": "ecf418050c1821f25e2e218f1be94c31e0465df1", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.6", + "repo": "cabal", + "type": "github" + } + }, + "cabal-36_2": { + "flake": false, + "locked": { + "lastModified": 1640163203, + "narHash": "sha256-TwDWP2CffT0j40W6zr0J1Qbu+oh3nsF1lUx9446qxZM=", + "owner": "haskell", + "repo": "cabal", + "rev": "ecf418050c1821f25e2e218f1be94c31e0465df1", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.6", + "repo": "cabal", + "type": "github" + } + }, + "cabal-36_3": { + "flake": false, + "locked": { + "lastModified": 1640163203, + "narHash": "sha256-TwDWP2CffT0j40W6zr0J1Qbu+oh3nsF1lUx9446qxZM=", + "owner": "haskell", + "repo": "cabal", + "rev": "ecf418050c1821f25e2e218f1be94c31e0465df1", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.6", + "repo": "cabal", + "type": "github" + } + }, + "cabal-36_4": { "flake": false, "locked": { "lastModified": 1641652457, @@ -219,30 +420,151 @@ "type": "github" } }, + "cardano-mainnet-mirror": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1642701714, + "narHash": "sha256-SR3luE+ePX6U193EKE/KSEuVzWAW0YsyPYDC4hOvALs=", + "owner": "input-output-hk", + "repo": "cardano-mainnet-mirror", + "rev": "819488be9eabbba6aaa7c931559bc584d8071e3d", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "nix", + "repo": "cardano-mainnet-mirror", + "type": "github" + } + }, + "cardano-mainnet-mirror_2": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1642701714, + "narHash": "sha256-SR3luE+ePX6U193EKE/KSEuVzWAW0YsyPYDC4hOvALs=", + "owner": "input-output-hk", + "repo": "cardano-mainnet-mirror", + "rev": "819488be9eabbba6aaa7c931559bc584d8071e3d", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "nix", + "repo": "cardano-mainnet-mirror", + "type": "github" + } + }, + "cardano-mainnet-mirror_3": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1642701714, + "narHash": "sha256-SR3luE+ePX6U193EKE/KSEuVzWAW0YsyPYDC4hOvALs=", + "owner": "input-output-hk", + "repo": "cardano-mainnet-mirror", + "rev": "819488be9eabbba6aaa7c931559bc584d8071e3d", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "nix", + "repo": "cardano-mainnet-mirror", + "type": "github" + } + }, "cardano-node": { "inputs": { "customConfig": "customConfig", "haskellNix": "haskellNix", "iohkNix": "iohkNix", + "membench": "membench", + "nixpkgs": [ + "cardano-node", + "haskellNix", + "nixpkgs-2105" + ], + "utils": "utils_4" + }, + "locked": { + "lastModified": 1646407906, + "narHash": "sha256-e4k1vCsZqUB/I3uPRDIKP9pZ81E/zosJn8kXySAfBcI=", + "owner": "input-output-hk", + "repo": "cardano-node", + "rev": "73f9a746362695dc2cb63ba757fbcabb81733d23", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-node", + "rev": "73f9a746362695dc2cb63ba757fbcabb81733d23", + "type": "github" + } + }, + "cardano-node-snapshot": { + "inputs": { + "customConfig": "customConfig_2", + "haskellNix": "haskellNix_2", + "iohkNix": "iohkNix_2", + "membench": "membench_2", + "nixpkgs": [ + "cardano-node", + "membench", + "cardano-node-snapshot", + "haskellNix", + "nixpkgs-2105" + ], + "plutus-example": "plutus-example", + "utils": "utils_3" + }, + "locked": { + "lastModified": 1645120669, + "narHash": "sha256-2MKfGsYS5n69+pfqNHb4IH/E95ok1MD7mhEYfUpRcz4=", + "owner": "input-output-hk", + "repo": "cardano-node", + "rev": "7f00e3ea5a61609e19eeeee4af35241571efdf5c", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-node", + "rev": "30d62b86e7b98da28ef8ad9412e4e00a1ba1231d", + "type": "github" + } + }, + "cardano-node-snapshot_2": { + "inputs": { + "customConfig": "customConfig_3", + "haskellNix": "haskellNix_3", + "iohkNix": "iohkNix_3", + "membench": "membench_3", "nixpkgs": [ "cardano-node", + "membench", + "cardano-node-snapshot", + "membench", + "cardano-node-snapshot", "haskellNix", "nixpkgs-2105" ], "utils": "utils" }, "locked": { - "lastModified": 1640022647, - "narHash": "sha256-M+YnF7Zj/7QK2pu0T75xNVaX0eEeijtBH8yz+jEHIMM=", + "lastModified": 1644954571, + "narHash": "sha256-c6MM1mQoS/AnTIrwaRmITK4L4i9lLNtkjOUHiseBtUs=", "owner": "input-output-hk", "repo": "cardano-node", - "rev": "814df2c146f5d56f8c35a681fe75e85b905aed5d", + "rev": "30d62b86e7b98da28ef8ad9412e4e00a1ba1231d", "type": "github" }, "original": { "owner": "input-output-hk", "repo": "cardano-node", - "rev": "814df2c146f5d56f8c35a681fe75e85b905aed5d", + "rev": "30d62b86e7b98da28ef8ad9412e4e00a1ba1231d", "type": "github" } }, @@ -295,20 +617,68 @@ "type": "github" } }, - "cardano-wallet": { + "cardano-shell_3": { "flake": false, "locked": { - "lastModified": 1642494510, - "narHash": "sha256-A3im2IkoumUx3NzgPooaXGC18/iYxbEooMa9ho93/6o=", + "lastModified": 1608537748, + "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", + "owner": "input-output-hk", + "repo": "cardano-shell", + "rev": "9392c75087cb9a3d453998f4230930dea3a95725", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-shell", + "type": "github" + } + }, + "cardano-shell_4": { + "flake": false, + "locked": { + "lastModified": 1608537748, + "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", + "owner": "input-output-hk", + "repo": "cardano-shell", + "rev": "9392c75087cb9a3d453998f4230930dea3a95725", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-shell", + "type": "github" + } + }, + "cardano-shell_5": { + "flake": false, + "locked": { + "lastModified": 1608537748, + "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", + "owner": "input-output-hk", + "repo": "cardano-shell", + "rev": "9392c75087cb9a3d453998f4230930dea3a95725", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-shell", + "type": "github" + } + }, + "cardano-wallet": { + "flake": false, + "locked": { + "lastModified": 1647614303, + "narHash": "sha256-3oeHsrAhDSSKBSzpGIAqmOcFmBdAJ5FR02UXPLb/Yz0=", "owner": "input-output-hk", "repo": "cardano-wallet", - "rev": "a5085acbd2670c24251cf8d76a4e83c77a2679ba", + "rev": "f6d4db733c4e47ee11683c343b440552f59beff7", "type": "github" }, "original": { "owner": "input-output-hk", "repo": "cardano-wallet", - "rev": "a5085acbd2670c24251cf8d76a4e83c77a2679ba", + "rev": "f6d4db733c4e47ee11683c343b440552f59beff7", "type": "github" } }, @@ -327,6 +697,68 @@ "type": "github" } }, + "customConfig_2": { + "locked": { + "lastModified": 1630400035, + "narHash": "sha256-MWaVOCzuFwp09wZIW9iHq5wWen5C69I940N1swZLEQ0=", + "owner": "input-output-hk", + "repo": "empty-flake", + "rev": "2040a05b67bf9a669ce17eca56beb14b4206a99a", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "empty-flake", + "type": "github" + } + }, + "customConfig_3": { + "locked": { + "lastModified": 1630400035, + "narHash": "sha256-MWaVOCzuFwp09wZIW9iHq5wWen5C69I940N1swZLEQ0=", + "owner": "input-output-hk", + "repo": "empty-flake", + "rev": "2040a05b67bf9a669ce17eca56beb14b4206a99a", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "empty-flake", + "type": "github" + } + }, + "customConfig_4": { + "locked": { + "lastModified": 1630400035, + "narHash": "sha256-MWaVOCzuFwp09wZIW9iHq5wWen5C69I940N1swZLEQ0=", + "owner": "input-output-hk", + "repo": "empty-flake", + "rev": "2040a05b67bf9a669ce17eca56beb14b4206a99a", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "empty-flake", + "type": "github" + } + }, + "ekg-forward": { + "flake": false, + "locked": { + "lastModified": 1642052814, + "narHash": "sha256-jwj/gh/A/PXhO6yVESV27k4yx9I8Id8fTa3m4ofPnP0=", + "owner": "input-output-hk", + "repo": "ekg-forward", + "rev": "297cd9db5074339a2fb2e5ae7d0780debb670c63", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "ekg-forward", + "rev": "297cd9db5074339a2fb2e5ae7d0780debb670c63", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -359,6 +791,51 @@ } }, "flake-utils_2": { + "locked": { + "lastModified": 1623875721, + "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "locked": { + "lastModified": 1623875721, + "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "locked": { + "lastModified": 1623875721, + "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { "locked": { "lastModified": 1644229661, "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", @@ -424,6 +901,57 @@ "type": "github" } }, + "ghc-8.6.5-iohk_3": { + "flake": false, + "locked": { + "lastModified": 1600920045, + "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", + "owner": "input-output-hk", + "repo": "ghc", + "rev": "95713a6ecce4551240da7c96b6176f980af75cae", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "release/8.6.5-iohk", + "repo": "ghc", + "type": "github" + } + }, + "ghc-8.6.5-iohk_4": { + "flake": false, + "locked": { + "lastModified": 1600920045, + "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", + "owner": "input-output-hk", + "repo": "ghc", + "rev": "95713a6ecce4551240da7c96b6176f980af75cae", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "release/8.6.5-iohk", + "repo": "ghc", + "type": "github" + } + }, + "ghc-8.6.5-iohk_5": { + "flake": false, + "locked": { + "lastModified": 1600920045, + "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", + "owner": "input-output-hk", + "repo": "ghc", + "rev": "95713a6ecce4551240da7c96b6176f980af75cae", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "release/8.6.5-iohk", + "repo": "ghc", + "type": "github" + } + }, "goblins": { "flake": false, "locked": { @@ -442,6 +970,54 @@ } }, "hackage": { + "flake": false, + "locked": { + "lastModified": 1643073363, + "narHash": "sha256-66oSXQKEDIOSQ2uKAS9facCX/Zuh/jFgyFDtxEqN9sk=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "4ef9bd3a32316ce236164c7ebff00ebeb33236e2", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, + "hackage_2": { + "flake": false, + "locked": { + "lastModified": 1643073363, + "narHash": "sha256-66oSXQKEDIOSQ2uKAS9facCX/Zuh/jFgyFDtxEqN9sk=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "4ef9bd3a32316ce236164c7ebff00ebeb33236e2", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, + "hackage_3": { + "flake": false, + "locked": { + "lastModified": 1643073363, + "narHash": "sha256-66oSXQKEDIOSQ2uKAS9facCX/Zuh/jFgyFDtxEqN9sk=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "4ef9bd3a32316ce236164c7ebff00ebeb33236e2", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, + "hackage_4": { "flake": false, "locked": { "lastModified": 1639098768, @@ -457,14 +1033,14 @@ "type": "github" } }, - "hackage_2": { + "hackage_5": { "flake": false, "locked": { - "lastModified": 1644887696, - "narHash": "sha256-o4gltv4npUl7+1gEQIcrRqZniwqC9kK8QsPaftlrawc=", + "lastModified": 1646874964, + "narHash": "sha256-tAtJ6Lmlkvzfj4uIQB2QKVigFpUzqwr6vAg2E0knUXQ=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "6ff64aa49b88e75dd6e0bbd2823c2a92c9174fa5", + "rev": "e6e27a79b160a023d0f93b7b38dbbfb7ddb998c0", "type": "github" }, "original": { @@ -475,33 +1051,33 @@ }, "haskell-nix": { "inputs": { - "HTTP": "HTTP_2", - "cabal-32": "cabal-32_2", - "cabal-34": "cabal-34_2", - "cabal-36": "cabal-36", - "cardano-shell": "cardano-shell_2", - "flake-utils": "flake-utils_2", - "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_2", - "hackage": "hackage_2", - "hpc-coveralls": "hpc-coveralls_2", - "nix-tools": "nix-tools_2", + "HTTP": "HTTP_5", + "cabal-32": "cabal-32_5", + "cabal-34": "cabal-34_5", + "cabal-36": "cabal-36_4", + "cardano-shell": "cardano-shell_5", + "flake-utils": "flake-utils_5", + "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_5", + "hackage": "hackage_5", + "hpc-coveralls": "hpc-coveralls_5", + "nix-tools": "nix-tools_5", "nixpkgs": [ "haskell-nix", "nixpkgs-unstable" ], - "nixpkgs-2003": "nixpkgs-2003_2", - "nixpkgs-2105": "nixpkgs-2105_2", - "nixpkgs-2111": "nixpkgs-2111_2", - "nixpkgs-unstable": "nixpkgs-unstable_2", - "old-ghc-nix": "old-ghc-nix_2", - "stackage": "stackage_2" + "nixpkgs-2003": "nixpkgs-2003_5", + "nixpkgs-2105": "nixpkgs-2105_5", + "nixpkgs-2111": "nixpkgs-2111_5", + "nixpkgs-unstable": "nixpkgs-unstable_5", + "old-ghc-nix": "old-ghc-nix_5", + "stackage": "stackage_5" }, "locked": { - "lastModified": 1644944726, - "narHash": "sha256-jJWdP/3Ne1y1akC3m9rSO5ItRoBc4UTdVQZBCuPmmrM=", + "lastModified": 1646940001, + "narHash": "sha256-sD9zKtamP6F7ixav+WyEDvz1B8b/lJuooDCE7r5qyjU=", "owner": "L-as", "repo": "haskell.nix", - "rev": "45c583b5580c130487eb5a342679f0bdbc2b23fc", + "rev": "64dcb66c49af14fc01e0e22b2fd15de15944ef6c", "type": "github" }, "original": { @@ -515,6 +1091,7 @@ "HTTP": "HTTP", "cabal-32": "cabal-32", "cabal-34": "cabal-34", + "cabal-36": "cabal-36", "cardano-shell": "cardano-shell", "flake-utils": "flake-utils", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", @@ -533,11 +1110,11 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1639098904, - "narHash": "sha256-7VrCNEaKGLm4pTOS11dt1dRL2033oqrNCfal0uONsqA=", + "lastModified": 1643073543, + "narHash": "sha256-g2l/KDWzMRTFRugNVcx3CPZeyA5BNcH9/zDiqFpprB4=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "b18c6ce0867fee77f12ecf41dc6c67f7a59d9826", + "rev": "14f740c7c8f535581c30b1697018e389680e24cb", "type": "github" }, "original": { @@ -546,18 +1123,154 @@ "type": "github" } }, - "hpc-coveralls": { - "flake": false, - "locked": { - "lastModified": 1607498076, - "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", - "owner": "sevanspowell", - "repo": "hpc-coveralls", - "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", - "type": "github" - }, - "original": { - "owner": "sevanspowell", + "haskellNix_2": { + "inputs": { + "HTTP": "HTTP_2", + "cabal-32": "cabal-32_2", + "cabal-34": "cabal-34_2", + "cabal-36": "cabal-36_2", + "cardano-shell": "cardano-shell_2", + "flake-utils": "flake-utils_2", + "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_2", + "hackage": "hackage_2", + "hpc-coveralls": "hpc-coveralls_2", + "nix-tools": "nix-tools_2", + "nixpkgs": [ + "cardano-node", + "membench", + "cardano-node-snapshot", + "nixpkgs" + ], + "nixpkgs-2003": "nixpkgs-2003_2", + "nixpkgs-2105": "nixpkgs-2105_2", + "nixpkgs-2111": "nixpkgs-2111_2", + "nixpkgs-unstable": "nixpkgs-unstable_2", + "old-ghc-nix": "old-ghc-nix_2", + "stackage": "stackage_2" + }, + "locked": { + "lastModified": 1643073543, + "narHash": "sha256-g2l/KDWzMRTFRugNVcx3CPZeyA5BNcH9/zDiqFpprB4=", + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "14f740c7c8f535581c30b1697018e389680e24cb", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "haskell.nix", + "type": "github" + } + }, + "haskellNix_3": { + "inputs": { + "HTTP": "HTTP_3", + "cabal-32": "cabal-32_3", + "cabal-34": "cabal-34_3", + "cabal-36": "cabal-36_3", + "cardano-shell": "cardano-shell_3", + "flake-utils": "flake-utils_3", + "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_3", + "hackage": "hackage_3", + "hpc-coveralls": "hpc-coveralls_3", + "nix-tools": "nix-tools_3", + "nixpkgs": [ + "cardano-node", + "membench", + "cardano-node-snapshot", + "membench", + "cardano-node-snapshot", + "nixpkgs" + ], + "nixpkgs-2003": "nixpkgs-2003_3", + "nixpkgs-2105": "nixpkgs-2105_3", + "nixpkgs-2111": "nixpkgs-2111_3", + "nixpkgs-unstable": "nixpkgs-unstable_3", + "old-ghc-nix": "old-ghc-nix_3", + "stackage": "stackage_3" + }, + "locked": { + "lastModified": 1643073543, + "narHash": "sha256-g2l/KDWzMRTFRugNVcx3CPZeyA5BNcH9/zDiqFpprB4=", + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "14f740c7c8f535581c30b1697018e389680e24cb", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "haskell.nix", + "type": "github" + } + }, + "haskellNix_4": { + "inputs": { + "HTTP": "HTTP_4", + "cabal-32": "cabal-32_4", + "cabal-34": "cabal-34_4", + "cardano-shell": "cardano-shell_4", + "flake-utils": "flake-utils_4", + "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_4", + "hackage": "hackage_4", + "hpc-coveralls": "hpc-coveralls_4", + "nix-tools": "nix-tools_4", + "nixpkgs": [ + "cardano-node", + "membench", + "cardano-node-snapshot", + "plutus-example", + "nixpkgs" + ], + "nixpkgs-2003": "nixpkgs-2003_4", + "nixpkgs-2105": "nixpkgs-2105_4", + "nixpkgs-2111": "nixpkgs-2111_4", + "nixpkgs-unstable": "nixpkgs-unstable_4", + "old-ghc-nix": "old-ghc-nix_4", + "stackage": "stackage_4" + }, + "locked": { + "lastModified": 1639098904, + "narHash": "sha256-7VrCNEaKGLm4pTOS11dt1dRL2033oqrNCfal0uONsqA=", + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "b18c6ce0867fee77f12ecf41dc6c67f7a59d9826", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "haskell.nix", + "type": "github" + } + }, + "hedgehog-extras": { + "flake": false, + "locked": { + "lastModified": 1626138074, + "narHash": "sha256-KYLGLpDGHWlb/Gcx6Q/2HTnRMzZQmPKz0JbIw+bHh3E=", + "owner": "input-output-hk", + "repo": "hedgehog-extras", + "rev": "edf6945007177a638fbeb8802397f3a6f4e47c14", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hedgehog-extras", + "rev": "edf6945007177a638fbeb8802397f3a6f4e47c14", + "type": "github" + } + }, + "hpc-coveralls": { + "flake": false, + "locked": { + "lastModified": 1607498076, + "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", + "type": "github" + }, + "original": { + "owner": "sevanspowell", "repo": "hpc-coveralls", "type": "github" } @@ -578,6 +1291,54 @@ "type": "github" } }, + "hpc-coveralls_3": { + "flake": false, + "locked": { + "lastModified": 1607498076, + "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", + "type": "github" + }, + "original": { + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "type": "github" + } + }, + "hpc-coveralls_4": { + "flake": false, + "locked": { + "lastModified": 1607498076, + "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", + "type": "github" + }, + "original": { + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "type": "github" + } + }, + "hpc-coveralls_5": { + "flake": false, + "locked": { + "lastModified": 1607498076, + "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", + "type": "github" + }, + "original": { + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "type": "github" + } + }, "iohk-monitoring-framework": { "flake": false, "locked": { @@ -598,11 +1359,11 @@ "iohk-nix": { "flake": false, "locked": { - "lastModified": 1643251385, - "narHash": "sha256-Czbd69lg0ARSZfC18V6h+gtPMioWDAEVPbiHgL2x9LM=", + "lastModified": 1646330344, + "narHash": "sha256-EbhMDeneH26wDi+x5kz8nfru/dE9JZ241hJed4a8lz8=", "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "9d6ee3dcb3482f791e40ed991ad6fc649b343ad4", + "rev": "0a0126d8fb1bdc61ce1fd2ef61cf396de800fdad", "type": "github" }, "original": { @@ -618,6 +1379,78 @@ "nixpkgs" ] }, + "locked": { + "lastModified": 1631778944, + "narHash": "sha256-N5eCcUYtZ5kUOl/JJGjx6ZzhA3uIn1itDRTiRV+3jLw=", + "owner": "input-output-hk", + "repo": "iohk-nix", + "rev": "db2c75a09c696271194bb3ef25ec8e9839b594b7", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "iohk-nix", + "type": "github" + } + }, + "iohkNix_2": { + "inputs": { + "nixpkgs": [ + "cardano-node", + "membench", + "cardano-node-snapshot", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1631778944, + "narHash": "sha256-N5eCcUYtZ5kUOl/JJGjx6ZzhA3uIn1itDRTiRV+3jLw=", + "owner": "input-output-hk", + "repo": "iohk-nix", + "rev": "db2c75a09c696271194bb3ef25ec8e9839b594b7", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "iohk-nix", + "type": "github" + } + }, + "iohkNix_3": { + "inputs": { + "nixpkgs": [ + "cardano-node", + "membench", + "cardano-node-snapshot", + "membench", + "cardano-node-snapshot", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1631778944, + "narHash": "sha256-N5eCcUYtZ5kUOl/JJGjx6ZzhA3uIn1itDRTiRV+3jLw=", + "owner": "input-output-hk", + "repo": "iohk-nix", + "rev": "db2c75a09c696271194bb3ef25ec8e9839b594b7", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "iohk-nix", + "type": "github" + } + }, + "iohkNix_4": { + "inputs": { + "nixpkgs": [ + "cardano-node", + "membench", + "cardano-node-snapshot", + "plutus-example", + "nixpkgs" + ] + }, "locked": { "lastModified": 1633964277, "narHash": "sha256-7G/BK514WiMRr90EswNBthe8SmH9tjPaTBba/RW/VA8=", @@ -632,6 +1465,120 @@ "type": "github" } }, + "membench": { + "inputs": { + "cardano-mainnet-mirror": "cardano-mainnet-mirror", + "cardano-node-measured": [ + "cardano-node" + ], + "cardano-node-process": [ + "cardano-node" + ], + "cardano-node-snapshot": "cardano-node-snapshot", + "nixpkgs": [ + "cardano-node", + "nixpkgs" + ], + "ouroboros-network": "ouroboros-network_3" + }, + "locked": { + "lastModified": 1645070579, + "narHash": "sha256-AxL6tCOnzYnE6OquoFzj+X1bLDr1PQx3d8/vXm+rbfA=", + "owner": "input-output-hk", + "repo": "cardano-memory-benchmark", + "rev": "65643e000186de1335e24ec89159db8ba85e1c1a", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-memory-benchmark", + "type": "github" + } + }, + "membench_2": { + "inputs": { + "cardano-mainnet-mirror": "cardano-mainnet-mirror_2", + "cardano-node-measured": [ + "cardano-node", + "membench", + "cardano-node-snapshot" + ], + "cardano-node-process": [ + "cardano-node", + "membench", + "cardano-node-snapshot" + ], + "cardano-node-snapshot": "cardano-node-snapshot_2", + "nixpkgs": [ + "cardano-node", + "membench", + "cardano-node-snapshot", + "nixpkgs" + ], + "ouroboros-network": "ouroboros-network_2" + }, + "locked": { + "lastModified": 1644547122, + "narHash": "sha256-8nWK+ScMACvRQLbA27gwXNoZver+Wx/cF7V37044koY=", + "owner": "input-output-hk", + "repo": "cardano-memory-benchmark", + "rev": "9d8ff4b9394de0421ee95caa511d01163de88b77", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-memory-benchmark", + "type": "github" + } + }, + "membench_3": { + "inputs": { + "cardano-mainnet-mirror": "cardano-mainnet-mirror_3", + "cardano-node-measured": [ + "cardano-node", + "membench", + "cardano-node-snapshot", + "membench", + "cardano-node-snapshot" + ], + "cardano-node-process": [ + "cardano-node", + "membench", + "cardano-node-snapshot", + "membench", + "cardano-node-snapshot" + ], + "cardano-node-snapshot": [ + "cardano-node", + "membench", + "cardano-node-snapshot", + "membench", + "cardano-node-snapshot" + ], + "nixpkgs": [ + "cardano-node", + "membench", + "cardano-node-snapshot", + "membench", + "cardano-node-snapshot", + "nixpkgs" + ], + "ouroboros-network": "ouroboros-network" + }, + "locked": { + "lastModified": 1644547122, + "narHash": "sha256-8nWK+ScMACvRQLbA27gwXNoZver+Wx/cF7V37044koY=", + "owner": "input-output-hk", + "repo": "cardano-memory-benchmark", + "rev": "9d8ff4b9394de0421ee95caa511d01163de88b77", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-memory-benchmark", + "type": "github" + } + }, "nix-tools": { "flake": false, "locked": { @@ -649,6 +1596,54 @@ } }, "nix-tools_2": { + "flake": false, + "locked": { + "lastModified": 1636018067, + "narHash": "sha256-ng306fkuwr6V/malWtt3979iAC4yMVDDH2ViwYB6sQE=", + "owner": "input-output-hk", + "repo": "nix-tools", + "rev": "ed5bd7215292deba55d6ab7a4e8c21f8b1564dda", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "nix-tools", + "type": "github" + } + }, + "nix-tools_3": { + "flake": false, + "locked": { + "lastModified": 1636018067, + "narHash": "sha256-ng306fkuwr6V/malWtt3979iAC4yMVDDH2ViwYB6sQE=", + "owner": "input-output-hk", + "repo": "nix-tools", + "rev": "ed5bd7215292deba55d6ab7a4e8c21f8b1564dda", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "nix-tools", + "type": "github" + } + }, + "nix-tools_4": { + "flake": false, + "locked": { + "lastModified": 1636018067, + "narHash": "sha256-ng306fkuwr6V/malWtt3979iAC4yMVDDH2ViwYB6sQE=", + "owner": "input-output-hk", + "repo": "nix-tools", + "rev": "ed5bd7215292deba55d6ab7a4e8c21f8b1564dda", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "nix-tools", + "type": "github" + } + }, + "nix-tools_5": { "flake": false, "locked": { "lastModified": 1644395812, @@ -659,108 +1654,314 @@ "type": "github" }, "original": { - "owner": "input-output-hk", - "repo": "nix-tools", + "owner": "input-output-hk", + "repo": "nix-tools", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1642336556, + "narHash": "sha256-QSPPbFEwy0T0DrIuSzAACkaANPQaR1lZR/nHZGz9z04=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f3d9d4bd898cca7d04af2ae4f6ef01f2219df3d6", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs-2003": { + "locked": { + "lastModified": 1620055814, + "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.03-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2003_2": { + "locked": { + "lastModified": 1620055814, + "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.03-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2003_3": { + "locked": { + "lastModified": 1620055814, + "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.03-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2003_4": { + "locked": { + "lastModified": 1620055814, + "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.03-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2003_5": { + "locked": { + "lastModified": 1620055814, + "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.03-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2105": { + "locked": { + "lastModified": 1640283157, + "narHash": "sha256-6Ddfop+rKE+Gl9Tjp9YIrkfoYPzb8F80ergdjcq3/MY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "dde1557825c5644c869c5efc7448dc03722a8f09", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2105_2": { + "locked": { + "lastModified": 1640283157, + "narHash": "sha256-6Ddfop+rKE+Gl9Tjp9YIrkfoYPzb8F80ergdjcq3/MY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "dde1557825c5644c869c5efc7448dc03722a8f09", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2105_3": { + "locked": { + "lastModified": 1640283157, + "narHash": "sha256-6Ddfop+rKE+Gl9Tjp9YIrkfoYPzb8F80ergdjcq3/MY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "dde1557825c5644c869c5efc7448dc03722a8f09", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2105_4": { + "locked": { + "lastModified": 1630481079, + "narHash": "sha256-leWXLchbAbqOlLT6tju631G40SzQWPqaAXQG3zH1Imw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "110a2c9ebbf5d4a94486854f18a37a938cfacbbb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2105_5": { + "locked": { + "lastModified": 1642244250, + "narHash": "sha256-vWpUEqQdVP4srj+/YLJRTN9vjpTs4je0cdWKXPbDItc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0fd9ee1aa36ce865ad273f4f07fdc093adeb5c00", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2111": { + "locked": { + "lastModified": 1640283207, + "narHash": "sha256-SCwl7ZnCfMDsuSYvwIroiAlk7n33bW8HFfY8NvKhcPA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "64c7e3388bbd9206e437713351e814366e0c3284", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2111_2": { + "locked": { + "lastModified": 1640283207, + "narHash": "sha256-SCwl7ZnCfMDsuSYvwIroiAlk7n33bW8HFfY8NvKhcPA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "64c7e3388bbd9206e437713351e814366e0c3284", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.11-darwin", + "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-2003": { + "nixpkgs-2111_3": { "locked": { - "lastModified": 1620055814, - "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "lastModified": 1640283207, + "narHash": "sha256-SCwl7ZnCfMDsuSYvwIroiAlk7n33bW8HFfY8NvKhcPA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "rev": "64c7e3388bbd9206e437713351e814366e0c3284", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-20.03-darwin", + "ref": "nixpkgs-21.11-darwin", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-2003_2": { + "nixpkgs-2111_4": { "locked": { - "lastModified": 1620055814, - "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "lastModified": 1638410074, + "narHash": "sha256-MQYI4k4XkoTzpeRjq5wl+1NShsl1CKq8MISFuZ81sWs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "rev": "5b80f23502f8e902612a8c631dfce383e1c56596", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-20.03-darwin", + "ref": "nixpkgs-21.11-darwin", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-2105": { + "nixpkgs-2111_5": { "locked": { - "lastModified": 1630481079, - "narHash": "sha256-leWXLchbAbqOlLT6tju631G40SzQWPqaAXQG3zH1Imw=", + "lastModified": 1644510859, + "narHash": "sha256-xjpVvL5ecbyi0vxtVl/Fh9bwGlMbw3S06zE5nUzFB8A=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "110a2c9ebbf5d4a94486854f18a37a938cfacbbb", + "rev": "0d1d5d7e3679fec9d07f2eb804d9f9fdb98378d3", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-21.05-darwin", + "ref": "nixpkgs-21.11-darwin", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-2105_2": { + "nixpkgs-unstable": { "locked": { - "lastModified": 1642244250, - "narHash": "sha256-vWpUEqQdVP4srj+/YLJRTN9vjpTs4je0cdWKXPbDItc=", + "lastModified": 1641285291, + "narHash": "sha256-KYaOBNGar3XWTxTsYPr9P6u74KAqNq0wobEC236U+0c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0fd9ee1aa36ce865ad273f4f07fdc093adeb5c00", + "rev": "0432195a4b8d68faaa7d3d4b355260a3120aeeae", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-21.05-darwin", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-2111": { + "nixpkgs-unstable_2": { "locked": { - "lastModified": 1638410074, - "narHash": "sha256-MQYI4k4XkoTzpeRjq5wl+1NShsl1CKq8MISFuZ81sWs=", + "lastModified": 1641285291, + "narHash": "sha256-KYaOBNGar3XWTxTsYPr9P6u74KAqNq0wobEC236U+0c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5b80f23502f8e902612a8c631dfce383e1c56596", + "rev": "0432195a4b8d68faaa7d3d4b355260a3120aeeae", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-21.11-darwin", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-2111_2": { + "nixpkgs-unstable_3": { "locked": { - "lastModified": 1644510859, - "narHash": "sha256-xjpVvL5ecbyi0vxtVl/Fh9bwGlMbw3S06zE5nUzFB8A=", + "lastModified": 1641285291, + "narHash": "sha256-KYaOBNGar3XWTxTsYPr9P6u74KAqNq0wobEC236U+0c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d1d5d7e3679fec9d07f2eb804d9f9fdb98378d3", + "rev": "0432195a4b8d68faaa7d3d4b355260a3120aeeae", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-21.11-darwin", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-unstable": { + "nixpkgs-unstable_4": { "locked": { "lastModified": 1635295995, "narHash": "sha256-sGYiXjFlxTTMNb4NSkgvX+knOOTipE6gqwPUQpxNF+c=", @@ -776,7 +1977,7 @@ "type": "github" } }, - "nixpkgs-unstable_2": { + "nixpkgs-unstable_5": { "locked": { "lastModified": 1644486793, "narHash": "sha256-EeijR4guVHgVv+JpOX3cQO+1XdrkJfGmiJ9XVsVU530=", @@ -792,6 +1993,34 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1642336556, + "narHash": "sha256-QSPPbFEwy0T0DrIuSzAACkaANPQaR1lZR/nHZGz9z04=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f3d9d4bd898cca7d04af2ae4f6ef01f2219df3d6", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1642336556, + "narHash": "sha256-QSPPbFEwy0T0DrIuSzAACkaANPQaR1lZR/nHZGz9z04=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f3d9d4bd898cca7d04af2ae4f6ef01f2219df3d6", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, "old-ghc-nix": { "flake": false, "locked": { @@ -826,6 +2055,57 @@ "type": "github" } }, + "old-ghc-nix_3": { + "flake": false, + "locked": { + "lastModified": 1631092763, + "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", + "owner": "angerman", + "repo": "old-ghc-nix", + "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", + "type": "github" + }, + "original": { + "owner": "angerman", + "ref": "master", + "repo": "old-ghc-nix", + "type": "github" + } + }, + "old-ghc-nix_4": { + "flake": false, + "locked": { + "lastModified": 1631092763, + "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", + "owner": "angerman", + "repo": "old-ghc-nix", + "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", + "type": "github" + }, + "original": { + "owner": "angerman", + "ref": "master", + "repo": "old-ghc-nix", + "type": "github" + } + }, + "old-ghc-nix_5": { + "flake": false, + "locked": { + "lastModified": 1631092763, + "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", + "owner": "angerman", + "repo": "old-ghc-nix", + "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", + "type": "github" + }, + "original": { + "owner": "angerman", + "ref": "master", + "repo": "old-ghc-nix", + "type": "github" + } + }, "optparse-applicative": { "flake": false, "locked": { @@ -846,51 +2126,129 @@ "ouroboros-network": { "flake": false, "locked": { - "lastModified": 1639752881, - "narHash": "sha256-fZ6FfG2z6HWDxjIHycLPSQHoYtfUmWZOX7lfAUE+s6M=", + "lastModified": 1643385024, + "narHash": "sha256-9R4Z1jBsTcEgBHxhzjCJnroEcdfMsTjf8kwg6uPue+Q=", + "owner": "input-output-hk", + "repo": "ouroboros-network", + "rev": "8e97076176d465f5f4f86d5b5596220272630649", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "ouroboros-network", + "type": "github" + } + }, + "ouroboros-network_2": { + "flake": false, + "locked": { + "lastModified": 1643385024, + "narHash": "sha256-9R4Z1jBsTcEgBHxhzjCJnroEcdfMsTjf8kwg6uPue+Q=", + "owner": "input-output-hk", + "repo": "ouroboros-network", + "rev": "8e97076176d465f5f4f86d5b5596220272630649", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "ouroboros-network", + "type": "github" + } + }, + "ouroboros-network_3": { + "flake": false, + "locked": { + "lastModified": 1643385024, + "narHash": "sha256-9R4Z1jBsTcEgBHxhzjCJnroEcdfMsTjf8kwg6uPue+Q=", + "owner": "input-output-hk", + "repo": "ouroboros-network", + "rev": "8e97076176d465f5f4f86d5b5596220272630649", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "ouroboros-network", + "type": "github" + } + }, + "ouroboros-network_4": { + "flake": false, + "locked": { + "lastModified": 1643202846, + "narHash": "sha256-Cy29MHrYTkN7s3Vvog5/pOzbo7jiqTeDz6OmrNvag6w=", "owner": "input-output-hk", "repo": "ouroboros-network", - "rev": "d2d219a86cda42787325bb8c20539a75c2667132", + "rev": "4fac197b6f0d2ff60dc3486c593b68dc00969fbf", "type": "github" }, "original": { "owner": "input-output-hk", "repo": "ouroboros-network", - "rev": "d2d219a86cda42787325bb8c20539a75c2667132", + "rev": "4fac197b6f0d2ff60dc3486c593b68dc00969fbf", "type": "github" } }, "plutus": { "flake": false, "locked": { - "lastModified": 1642505687, - "narHash": "sha256-Pl3M9rMEoiEKRsTdDr4JwNnRo5Xs4uN66uVpOfaMCfE=", + "lastModified": 1646650116, + "narHash": "sha256-S8uvyld7ZpPsmxZlWJeRNAPd+mw3PafrtaiiuU8H3KA=", "owner": "input-output-hk", "repo": "plutus", - "rev": "cc72a56eafb02333c96f662581b57504f8f8992f", + "rev": "4127e9cd6e889824d724c30eae55033cb50cbf3e", "type": "github" }, "original": { "owner": "input-output-hk", "repo": "plutus", - "rev": "cc72a56eafb02333c96f662581b57504f8f8992f", + "rev": "4127e9cd6e889824d724c30eae55033cb50cbf3e", "type": "github" } }, "plutus-apps": { "flake": false, "locked": { - "lastModified": 1644841368, - "narHash": "sha256-OX4+S7fFUqXRz935wQqdcEm1I6aqg0udSdP19XJtSAk=", + "lastModified": 1647956110, + "narHash": "sha256-JIrezDnCEeXPGykU+cCnGlf5ITadsqwKofc4CDSXBiQ=", "owner": "input-output-hk", "repo": "plutus-apps", - "rev": "7f543e21d4945a2024e46c572303b9c1684a5832", + "rev": "905ab07ca1515a2999529616ae7015616a7f6deb", "type": "github" }, "original": { "owner": "input-output-hk", "repo": "plutus-apps", - "rev": "7f543e21d4945a2024e46c572303b9c1684a5832", + "rev": "905ab07ca1515a2999529616ae7015616a7f6deb", + "type": "github" + } + }, + "plutus-example": { + "inputs": { + "customConfig": "customConfig_4", + "haskellNix": "haskellNix_4", + "iohkNix": "iohkNix_4", + "nixpkgs": [ + "cardano-node", + "membench", + "cardano-node-snapshot", + "plutus-example", + "haskellNix", + "nixpkgs-2105" + ], + "utils": "utils_2" + }, + "locked": { + "lastModified": 1640022647, + "narHash": "sha256-M+YnF7Zj/7QK2pu0T75xNVaX0eEeijtBH8yz+jEHIMM=", + "owner": "input-output-hk", + "repo": "cardano-node", + "rev": "814df2c146f5d56f8c35a681fe75e85b905aed5d", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-node", + "rev": "814df2c146f5d56f8c35a681fe75e85b905aed5d", "type": "github" } }, @@ -922,10 +2280,12 @@ "cardano-node": "cardano-node", "cardano-prelude": "cardano-prelude", "cardano-wallet": "cardano-wallet", + "ekg-forward": "ekg-forward", "flake-compat": "flake-compat", "flat": "flat", "goblins": "goblins", "haskell-nix": "haskell-nix", + "hedgehog-extras": "hedgehog-extras", "iohk-monitoring-framework": "iohk-monitoring-framework", "iohk-nix": "iohk-nix", "nixpkgs": [ @@ -933,7 +2293,7 @@ "nixpkgs-unstable" ], "optparse-applicative": "optparse-applicative", - "ouroboros-network": "ouroboros-network", + "ouroboros-network": "ouroboros-network_4", "plutus": "plutus", "plutus-apps": "plutus-apps", "purescript-bridge": "purescript-bridge", @@ -958,6 +2318,54 @@ } }, "stackage": { + "flake": false, + "locked": { + "lastModified": 1643073493, + "narHash": "sha256-5cPd1+i/skvJY9vJO1BhVRPcJObqkxDSywBEppDmb1U=", + "owner": "input-output-hk", + "repo": "stackage.nix", + "rev": "48e1188855ca38f3b7e2a8dba5352767a2f0a8f7", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "stackage.nix", + "type": "github" + } + }, + "stackage_2": { + "flake": false, + "locked": { + "lastModified": 1643073493, + "narHash": "sha256-5cPd1+i/skvJY9vJO1BhVRPcJObqkxDSywBEppDmb1U=", + "owner": "input-output-hk", + "repo": "stackage.nix", + "rev": "48e1188855ca38f3b7e2a8dba5352767a2f0a8f7", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "stackage.nix", + "type": "github" + } + }, + "stackage_3": { + "flake": false, + "locked": { + "lastModified": 1643073493, + "narHash": "sha256-5cPd1+i/skvJY9vJO1BhVRPcJObqkxDSywBEppDmb1U=", + "owner": "input-output-hk", + "repo": "stackage.nix", + "rev": "48e1188855ca38f3b7e2a8dba5352767a2f0a8f7", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "stackage.nix", + "type": "github" + } + }, + "stackage_4": { "flake": false, "locked": { "lastModified": 1639012797, @@ -973,14 +2381,14 @@ "type": "github" } }, - "stackage_2": { + "stackage_5": { "flake": false, "locked": { - "lastModified": 1644887829, - "narHash": "sha256-tjUXJpqB7MMnqM4FF5cdtZipfratUcTKRQVA6F77sEQ=", + "lastModified": 1646875071, + "narHash": "sha256-J1fs1wOY0PD3QYlUwxGbvmAWIH/5v3COXkYGWBjvUGc=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "db8bdef6588cf4f38e6069075ba76f0024381f68", + "rev": "a35d12a8c44bbae972acff9a6549472bc7711103", "type": "github" }, "original": { @@ -990,6 +2398,21 @@ } }, "utils": { + "locked": { + "lastModified": 1623875721, + "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "utils_2": { "locked": { "lastModified": 1638122382, "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", @@ -1003,6 +2426,36 @@ "repo": "flake-utils", "type": "github" } + }, + "utils_3": { + "locked": { + "lastModified": 1623875721, + "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "utils_4": { + "locked": { + "lastModified": 1623875721, + "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index aadab9ab..e3afbfd9 100644 --- a/flake.nix +++ b/flake.nix @@ -42,7 +42,7 @@ }; cardano-node = { url = - "github:input-output-hk/cardano-node/814df2c146f5d56f8c35a681fe75e85b905aed5d"; + "github:input-output-hk/cardano-node/73f9a746362695dc2cb63ba757fbcabb81733d23"; # flake = false; -- we need it to be available in shell }; cardano-prelude = { @@ -52,7 +52,7 @@ }; cardano-wallet = { url = - "github:input-output-hk/cardano-wallet/a5085acbd2670c24251cf8d76a4e83c77a2679ba"; + "github:input-output-hk/cardano-wallet/f6d4db733c4e47ee11683c343b440552f59beff7"; flake = false; }; # We don't actually need this. Removing this might make caching worse? @@ -78,17 +78,17 @@ }; ouroboros-network = { url = - "github:input-output-hk/ouroboros-network/d2d219a86cda42787325bb8c20539a75c2667132"; + "github:input-output-hk/ouroboros-network/4fac197b6f0d2ff60dc3486c593b68dc00969fbf"; flake = false; }; plutus = { url = - "github:input-output-hk/plutus/cc72a56eafb02333c96f662581b57504f8f8992f"; + "github:input-output-hk/plutus/4127e9cd6e889824d724c30eae55033cb50cbf3e"; flake = false; }; plutus-apps = { url = - "github:input-output-hk/plutus-apps/7f543e21d4945a2024e46c572303b9c1684a5832"; + "github:input-output-hk/plutus-apps/905ab07ca1515a2999529616ae7015616a7f6deb"; flake = false; }; purescript-bridge = { @@ -106,6 +106,16 @@ "github:input-output-hk/Win32-network/3825d3abf75f83f406c1f7161883c438dac7277d"; flake = false; }; + hedgehog-extras = { + url = + "github:input-output-hk/hedgehog-extras/edf6945007177a638fbeb8802397f3a6f4e47c14"; + flake = false; + }; + ekg-forward = { + url = + "github:input-output-hk/ekg-forward/297cd9db5074339a2fb2e5ae7d0780debb670c63"; + flake = false; + }; }; outputs = { self, nixpkgs, haskell-nix, iohk-nix, ... }@inputs: @@ -124,6 +134,7 @@ cabalProjectLocal = '' allow-newer: size-based:template-haskell + constraints: hedgehog >= 1.0.2 && < 1.1 ''; haskellModules = [( @@ -196,7 +207,16 @@ } { src = inputs.cardano-node; - subdirs = [ "cardano-api" "cardano-node" "cardano-cli" ]; + subdirs = [ + "cardano-api" + "cardano-cli" + "cardano-git-rev" + "cardano-node" + "cardano-testnet" + "trace-dispatcher" + "trace-forward" + "trace-resources" + ]; } { src = inputs.cardano-config; @@ -310,6 +330,14 @@ src = inputs.Win32-network; subdirs = [ "." ]; } + { + src = inputs.hedgehog-extras; + subdirs = [ "." ]; + } + { + src = inputs.ekg-forward; + subdirs = [ "." ]; + } ]; projectFor = system: @@ -328,7 +356,15 @@ withHoogle = true; tools.haskell-language-server = {}; exactDeps = true; - nativeBuildInputs = [ pkgs'.cabal-install pkgs'.hlint pkgs'.haskellPackages.fourmolu pkgs'.jq pkgs'.websocat ]; + nativeBuildInputs = [ + pkgs'.cabal-install + pkgs'.haskellPackages.cabal-fmt + pkgs'.haskellPackages.implicit-hie + pkgs'.hlint + pkgs'.haskellPackages.fourmolu + pkgs'.jq + pkgs'.websocat + ]; }; modules = haskellModules; }; diff --git a/hie.yaml b/hie.yaml index 95862748..f5eaab56 100644 --- a/hie.yaml +++ b/hie.yaml @@ -4,10 +4,22 @@ cradle: component: "lib:bot-plutus-interface" - path: "./test" - component: "test:bot-plutus-interface-test" + component: "bot-plutus-interface:test:bot-plutus-interface-test" + + - path: "./examples/plutus-game/src" + component: "lib:plutus-game" + + - path: "./examples/plutus-game/app/Main.hs" + component: "plutus-game:exe:plutus-game-pab" - path: "./examples/plutus-nft/src" component: "lib:plutus-nft" - - path: "./examples/plutus-nft/app" - component: "exe:plutus-nft" + - path: "./examples/plutus-nft/app/Main.hs" + component: "plutus-nft:exe:plutus-nft-pab" + + - path: "./examples/plutus-transfer/src" + component: "lib:plutus-transfer" + + - path: "./examples/plutus-transfer/app/Main.hs" + component: "plutus-transfer:exe:plutus-transfer-pab" diff --git a/plutus-config b/plutus-config new file mode 160000 index 00000000..a8b52093 --- /dev/null +++ b/plutus-config @@ -0,0 +1 @@ +Subproject commit a8b52093a66d6aaffe7f7af6f7437ba229b310d8 diff --git a/src/BotPlutusInterface/CardanoCLI.hs b/src/BotPlutusInterface/CardanoCLI.hs index 01183126..34ec1b40 100644 --- a/src/BotPlutusInterface/CardanoCLI.hs +++ b/src/BotPlutusInterface/CardanoCLI.hs @@ -43,7 +43,7 @@ import Data.Either (fromRight) import Data.Either.Combinators (mapLeft, maybeToRight) import Data.Hex (hex) import Data.Kind (Type) -import Data.List (nub, sort, sortOn) +import Data.List (sort, sortOn) import Data.Map (Map) import Data.Map qualified as Map import Data.Maybe (fromMaybe) @@ -80,10 +80,8 @@ import Ledger.Tx ( import Ledger.TxId (TxId (..)) import Ledger.Value (Value) import Ledger.Value qualified as Value -import Plutus.ChainIndex.Tx (txOutRefMap) import Plutus.Contract.CardanoAPI (toCardanoAddress) -import Plutus.Contract.Effects (ChainIndexQuery (TxsFromTxIds), ChainIndexResponse (TxIdsResponse)) -import Plutus.V1.Ledger.Ada (fromValue, getLovelace) +import Plutus.Contract.Effects (ChainIndexQuery (UnspentTxOutFromRef), ChainIndexResponse (UnspentTxOutResponse)) import Plutus.V1.Ledger.Api ( BuiltinData, CurrencySymbol (..), @@ -186,38 +184,21 @@ calculateMinFee pabConf tx = , cmdOutParser = mapLeft Text.pack . parseOnly UtxoParser.feeParser . Text.pack } -queryTxOuts :: - forall (w :: Type) (effs :: [Type -> Type]). - Member (PABEffect w) effs => - [TxId] -> - Eff effs (Either Text (Map TxOutRef TxOut)) -queryTxOuts txIds = do - res <- queryChainIndex @w $ TxsFromTxIds txIds - return $ case res of - TxIdsResponse chainTxs -> Right $ foldMap (fmap (sortTxOut . fst) . txOutRefMap) chainTxs - _ -> Left "Wrong PAB response" - where - -- Keep values in TxOuts sorted for deterministic ToData conversion - sortTxOut :: TxOut -> TxOut - sortTxOut txOut = txOut {txOutValue = sortValue $ txOutValue txOut} - --- There is no match txOutRefs request, and we don't want a separate PAB query per input. --- So, for efficiency, we're going to query the transactions for all inputs combined, --- then pick out the outputs we care about getTxInInfos :: forall (w :: Type) (effs :: [Type -> Type]). Member (PABEffect w) effs => [TxOutRef] -> Eff effs (Either Text [TxInInfo]) -getTxInInfos txOutRefs = do - let ids = nub $ txOutRefId <$> txOutRefs - eAllOutRefs <- queryTxOuts @w ids - return $ - eAllOutRefs >>= \allOutRefs -> - sequence $ (\ref -> toEither $ TxInInfo ref <$> Map.lookup ref allOutRefs) <$> txOutRefs +getTxInInfos txOutRefs = + sequence <$> traverse queryTxInInfo txOutRefs where - toEither :: Maybe TxInInfo -> Either Text TxInInfo - toEither = maybeToRight "Couldn't find TxOut" + queryTxInInfo :: TxOutRef -> Eff effs (Either Text TxInInfo) + queryTxInInfo txOutRef = do + res <- queryChainIndex @w $ UnspentTxOutFromRef txOutRef + pure $ case res of + UnspentTxOutResponse (Just chainIndexTxOut) -> + Right $ TxInInfo txOutRef (Ledger.toTxOut chainIndexTxOut) + _ -> Left "Wrong chain-index response" {- | Builds the TxInfo for direct Data conversion and usage "onchain" Must keep all inputs and values ordered for determinism @@ -292,7 +273,7 @@ buildTx pabConf privKeys tx = do , mints , validRangeOpts (txValidRange tx) , requiredSigners - , ["--fee", showText . getLovelace . fromValue $ txFee tx] + , ["--fee", showText . Ada.getLovelace . Ada.fromValue $ txFee tx] , mconcat [ ["--protocol-params-file", pabConf.pcProtocolParamsFile] , ["--out-file", txFilePath pabConf "raw" tx] diff --git a/src/BotPlutusInterface/ChainIndex.hs b/src/BotPlutusInterface/ChainIndex.hs index c57348e2..805149d7 100644 --- a/src/BotPlutusInterface/ChainIndex.hs +++ b/src/BotPlutusInterface/ChainIndex.hs @@ -38,10 +38,8 @@ handleChainIndexReq pabConf = \case pure $ RedeemerHashResponse Nothing -- RedeemerFromHash redeemerHash -> -- pure $ RedeemerHashResponse (Maybe Redeemer) - TxOutFromRef txOutRef -> - TxOutRefResponse <$> chainIndexQueryOne pabConf (ChainIndexClient.getTxOut txOutRef) - TxFromTxId txId -> - TxIdResponse <$> chainIndexQueryOne pabConf (ChainIndexClient.getTx txId) + UnspentTxOutFromRef txOutRef -> + UnspentTxOutResponse <$> chainIndexQueryOne pabConf (ChainIndexClient.getUnspentTxOut txOutRef) UtxoSetMembership txOutRef -> UtxoSetMembershipResponse <$> chainIndexQueryMany pabConf (ChainIndexClient.getIsUtxo txOutRef) UtxoSetAtAddress page credential -> @@ -56,7 +54,6 @@ handleChainIndexReq pabConf = \case (ChainIndexClient.getUtxoSetWithCurrency (UtxoWithCurrencyRequest (Just page) assetClass)) GetTip -> GetTipResponse <$> chainIndexQueryMany pabConf ChainIndexClient.getTip - TxsFromTxIds txIds -> TxIdsResponse <$> chainIndexQueryMany pabConf (ChainIndexClient.getTxs txIds) TxoSetAtAddress page credential -> TxoSetAtResponse <$> chainIndexQueryMany diff --git a/src/BotPlutusInterface/Config.hs b/src/BotPlutusInterface/Config.hs new file mode 100644 index 00000000..3e059f52 --- /dev/null +++ b/src/BotPlutusInterface/Config.hs @@ -0,0 +1,231 @@ +{-# LANGUAGE ApplicativeDo #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE RecordWildCards #-} + +{-# OPTIONS -fno-warn-orphans #-} + +module BotPlutusInterface.Config ( + docPABConfig, + loadPABConfig, + savePABConfig, +) where + +import BotPlutusInterface.Types (CLILocation (..), LogLevel (..), PABConfig (..)) +import Cardano.Api (ExecutionUnits (..)) +import Config (Section (Section), Value (Atom, Sections, Text)) +import Config.Schema ( + HasSpec (anySpec), + ValueSpec, + atomSpec, + generateDocs, + naturalSpec, + sectionsSpec, + trueOrFalseSpec, + (), + ) +import Data.Default (def) +import Data.Functor ((<&>)) +import Data.String.ToString (toString) +import PlutusConfig.Base ( + enumToAtom, + filepathSpec, + maybeSpec, + pathSpec, + portSpec, + ) +import PlutusConfig.Cardano.Api () +import PlutusConfig.Cardano.Api.Shelley ( + readProtocolParametersJSON, + writeProtocolParametersJSON, + ) +import PlutusConfig.Ledger () +import PlutusConfig.Types ( + ToValue (toValue), + deserialize, + sectionWithDefault, + sectionWithDefault', + serialize, + withNamePrefixSpec, + ) +import Prelude + +instance ToValue CLILocation where + toValue Local = Atom () "local" + toValue (Remote url) = Text () url + +cliLocationSpec :: ValueSpec CLILocation +cliLocationSpec = + Local <$ atomSpec "local" + Remote <$> withNamePrefixSpec "destination" anySpec + +instance ToValue LogLevel where + toValue = enumToAtom + +logLevelSpec :: ValueSpec LogLevel +logLevelSpec = + Error <$ atomSpec "error" + Warn <$ atomSpec "warn" + Notice <$ atomSpec "notice" + Info <$ atomSpec "info" + Debug <$ atomSpec "debug" + +instance ToValue (Integer, Integer) where + toValue = toValue . forceBudgetToExecutionUnits + +instance HasSpec (Maybe (Integer, Integer)) where + anySpec = maybeSpec (executionUnitsToForceBudget <$> anySpec) + +forceBudgetToExecutionUnits :: (Integer, Integer) -> ExecutionUnits +forceBudgetToExecutionUnits (steps, memory) = + ExecutionUnits (fromInteger steps) (fromInteger memory) + +executionUnitsToForceBudget :: ExecutionUnits -> (Integer, Integer) +executionUnitsToForceBudget (ExecutionUnits steps memory) = + (toInteger steps, toInteger memory) + +{- ORMOLU_DISABLE -} +instance ToValue PABConfig where + toValue + ( PABConfig + pcCliLocation + pcChainIndexUrl + pcNetwork + _pcProtocolParams + pcSlotConfig + pcScriptFileDir + pcSigningKeyFileDir + pcTxFileDir + pcProtocolParamsFile + pcDryRun + pcLogLevel + pcOwnPubKeyHash + pcTipPollingInterval + pcForceBudget + pcPort + pcEnableTxEndpoint + ) = + Sections + () + [ Section () "cliLocation" $ toValue pcCliLocation + , Section () "chainIndexUrl" $ toValue pcChainIndexUrl + , Section () "networkId" $ toValue pcNetwork + -- due to conflict, should be stored in pcProtocolParamsFile .json file + -- , Section () "protocolParams" $ toValue pcProtocolParams + , Section () "slotConfig" $ toValue pcSlotConfig + , Section () "scriptFileDir" $ toValue pcScriptFileDir + , Section () "signingKeyFileDir" $ toValue pcSigningKeyFileDir + , Section () "txFileDir" $ toValue pcTxFileDir + , Section () "protocolParamsFile" $ toValue pcProtocolParamsFile + , Section () "dryRun" $ toValue pcDryRun + , Section () "logLevel" $ toValue pcLogLevel + , Section () "ownPubKeyHash" $ toValue pcOwnPubKeyHash + , Section () "tipPollingInterval" $ toValue pcTipPollingInterval + , Section () "forceBudget" $ toValue pcForceBudget + , Section () "port" $ toValue pcPort + , Section () "enableTxEndpoint" $ toValue pcEnableTxEndpoint + ] +{- ORMOLU_ENABLE -} + +instance HasSpec PABConfig where + anySpec = pabConfigSpec + +pabConfigSpec :: ValueSpec PABConfig +pabConfigSpec = sectionsSpec "PABConfig" $ do + pcCliLocation <- + sectionWithDefault' + (pcCliLocation def) + "cliLocation" + cliLocationSpec + "calling the cli through ssh when set to destination" + + pcChainIndexUrl <- + sectionWithDefault (pcChainIndexUrl def) "chainIndexUrl" "" + + pcNetwork <- + sectionWithDefault (pcNetwork def) "networkId" "" + + -- due to conflict with pcProtocolParams, should got from + -- pcProtocolParamsFile .json file + -- pcProtocolParams <- + -- sectionWithDefault (pcProtocolParams def) "protocolParams" "" + let pcProtocolParams = def + + pcSlotConfig <- + sectionWithDefault (pcSlotConfig def) "slotConfig" "" + + pcScriptFileDir <- + sectionWithDefault' + (pcScriptFileDir def) + "scriptFileDir" + pathSpec + "Directory name of the script and data files" + + pcSigningKeyFileDir <- + sectionWithDefault' + (pcSigningKeyFileDir def) + "signingKeyFileDir" + pathSpec + "Directory name of the signing key files" + + pcTxFileDir <- + sectionWithDefault' + (pcTxFileDir def) + "txFileDir" + pathSpec + "Directory name of the transaction files" + + pcProtocolParamsFile <- + sectionWithDefault' + (pcProtocolParamsFile def) + "protocolParamsFile" + filepathSpec + "Protocol params file location relative to the cardano-cli working directory (needed for the cli) in JSON format. " + + pcDryRun <- + sectionWithDefault' + (pcDryRun def) + "dryRun" + trueOrFalseSpec + "Dry run mode will build the tx, but skip the submit step" + + pcLogLevel <- + sectionWithDefault' (pcLogLevel def) "logLevel" logLevelSpec "" + + pcOwnPubKeyHash <- + sectionWithDefault (pcOwnPubKeyHash def) "ownPubKeyHash" "" + + pcTipPollingInterval <- + sectionWithDefault' (pcTipPollingInterval def) "tipPollingInterval" naturalSpec "" + + pcForceBudget <- + sectionWithDefault + (pcForceBudget def) + "forceBudget" + "Forced budget for scripts, as optional (CPU Steps, Memory Units)" + + pcPort <- + sectionWithDefault' (pcPort def) "port" portSpec "" + + pcEnableTxEndpoint <- + sectionWithDefault' (pcEnableTxEndpoint def) "enableTxEndpoint" trueOrFalseSpec "" + + pure PABConfig {..} + +docPABConfig :: String +docPABConfig = show $ generateDocs pabConfigSpec + +loadPABConfig :: FilePath -> IO (Either String PABConfig) +loadPABConfig fn = do + confE <- deserialize <$> readFile fn + case confE of + Left err -> return $ Left $ "PABConfig: " <> fn <> ": " <> err + Right conf@PABConfig {pcProtocolParamsFile} -> do + readProtocolParametersJSON (toString pcProtocolParamsFile) + <&> \case + Left err -> Left $ "protocolParamsFile: " <> toString pcProtocolParamsFile <> ": " <> err + Right pcProtocolParams -> Right conf {pcProtocolParams} + +savePABConfig :: FilePath -> PABConfig -> IO () +savePABConfig fn conf@PABConfig {pcProtocolParams, pcProtocolParamsFile} = do + writeProtocolParametersJSON (toString pcProtocolParamsFile) pcProtocolParams + writeFile fn $ serialize conf <> "\n" diff --git a/src/BotPlutusInterface/Contract.hs b/src/BotPlutusInterface/Contract.hs index 4c2fdb24..4e0ab219 100644 --- a/src/BotPlutusInterface/Contract.hs +++ b/src/BotPlutusInterface/Contract.hs @@ -40,7 +40,7 @@ import Ledger.Address (PaymentPubKeyHash (PaymentPubKeyHash)) import Ledger.Constraints.OffChain (UnbalancedTx (..)) import Ledger.Slot (Slot (Slot)) import Ledger.TimeSlot (posixTimeRangeToContainedSlotRange, posixTimeToEnclosingSlot, slotToEndPOSIXTime) -import Ledger.Tx (CardanoTx) +import Ledger.Tx (CardanoTx (Both, CardanoApiTx, EmulatorTx)) import Ledger.Tx qualified as Tx import Plutus.ChainIndex.Types (RollbackState (Committed), TxValidity (..)) import Plutus.Contract.Checkpoint (Checkpoint (..)) @@ -179,7 +179,7 @@ balanceTx contractEnv unbalancedTx = do pabConf.pcOwnPubKeyHash unbalancedTx - pure $ either (BalanceTxFailed . InsufficientFunds) (BalanceTxSuccess . Right) eitherPreBalancedTx + pure $ either (BalanceTxFailed . InsufficientFunds) (BalanceTxSuccess . EmulatorTx) eitherPreBalancedTx -- | This step would build tx files, write them to disk and submit them to the chain writeBalancedTx :: @@ -188,13 +188,16 @@ writeBalancedTx :: ContractEnvironment w -> CardanoTx -> Eff effs WriteBalancedTxResponse -writeBalancedTx _ (Left _) = error "Cannot handle cardano api tx" -writeBalancedTx contractEnv (Right tx) = do +writeBalancedTx contractEnv cardanoTx = do + let tx = case cardanoTx of + EmulatorTx tx' -> tx' + Both tx' _ -> tx' + CardanoApiTx _ -> error "Cannot handle cardano api tx" let pabConf = contractEnv.cePABConfig uploadDir @w pabConf.pcSigningKeyFileDir createDirectoryIfMissing @w False (Text.unpack pabConf.pcScriptFileDir) - eitherT (pure . WriteBalancedTxFailed . OtherError) (pure . WriteBalancedTxSuccess . Right) $ do + eitherT (pure . WriteBalancedTxFailed . OtherError) (pure . WriteBalancedTxSuccess . EmulatorTx) $ do void $ firstEitherT (Text.pack . show) $ newEitherT $ Files.writeAll @w pabConf tx lift $ uploadDir @w pabConf.pcScriptFileDir diff --git a/test/Spec.hs b/test/Spec.hs index 28837cd5..8404e033 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -1,6 +1,7 @@ module Main (main) where import Spec.BotPlutusInterface.Balance qualified +import Spec.BotPlutusInterface.Config qualified import Spec.BotPlutusInterface.Contract qualified import Spec.BotPlutusInterface.Server qualified import Spec.BotPlutusInterface.UtxoParser qualified @@ -19,8 +20,9 @@ tests :: TestTree tests = testGroup "BotPlutusInterface" - [ Spec.BotPlutusInterface.Contract.tests - , Spec.BotPlutusInterface.UtxoParser.tests - , Spec.BotPlutusInterface.Balance.tests + [ Spec.BotPlutusInterface.Balance.tests + , Spec.BotPlutusInterface.Config.tests + , Spec.BotPlutusInterface.Contract.tests , Spec.BotPlutusInterface.Server.tests + , Spec.BotPlutusInterface.UtxoParser.tests ] diff --git a/test/Spec/BotPlutusInterface/Config.hs b/test/Spec/BotPlutusInterface/Config.hs new file mode 100644 index 00000000..55087147 --- /dev/null +++ b/test/Spec/BotPlutusInterface/Config.hs @@ -0,0 +1,116 @@ +{-# LANGUAGE NamedFieldPuns #-} + +module Spec.BotPlutusInterface.Config (tests) where + +import BotPlutusInterface.Config (loadPABConfig, savePABConfig) +import BotPlutusInterface.Types (CLILocation (..), LogLevel (..), PABConfig (..)) +import Cardano.Api ( + AnyPlutusScriptVersion (..), + CostModel (..), + EpochNo (EpochNo), + ExecutionUnitPrices (..), + ExecutionUnits (..), + Lovelace (..), + NetworkId (Mainnet), + PlutusScriptVersion (PlutusScriptV2), + makePraosNonce, + ) +import Cardano.Api.Shelley (ProtocolParameters (..)) +import Data.Default (def) +import Data.Map qualified as Map +import Data.Ratio ((%)) +import Data.Text qualified as Text +import Ledger.TimeSlot (SlotConfig (..)) +import Plutus.V1.Ledger.Api (POSIXTime (..)) +import PlutusConfig.Misc (serializeDeserialize) +import Servant.Client.Core (BaseUrl (..), Scheme (Https)) +import System.FilePath (()) +import System.IO.Temp (withSystemTempDirectory) +import Test.Tasty (TestTree, testGroup) +import Test.Tasty.HUnit (testCase, (@?=)) +import Prelude + +{- | Tests for PABConfig serialize/deserialize + + @since 0.1 +-} +tests :: TestTree +tests = + testGroup + "BotPlutusInterface.Config" + [ testCase + "PABConfig default serialize/deserialize" + (serializeDeserialize def @?= Right (def :: PABConfig)) + , testCase + "PABConfig example serialize/deserialize (without pcProtocolParams)" + ( serializeDeserialize pabConfigExample + @?= Right pabConfigExample {pcProtocolParams = def} + ) + , testCase + "PABConfig example serialize/deserialize (without pcProtocolParams)" + $ withSystemTempDirectory "PABConfig-test" $ \path -> do + let confFile = path "conf.value" + pcProtocolParamsFile = Text.pack $ path "protocol.json" + conf = pabConfigExample {pcProtocolParamsFile} + savePABConfig confFile conf + Right conf' <- loadPABConfig confFile + conf' @?= conf + ] + +pabConfigExample :: PABConfig +pabConfigExample = + PABConfig + { pcCliLocation = Remote "localhost" + , pcChainIndexUrl = BaseUrl Https "127.0.0.1" 8080 "" + , pcNetwork = Mainnet + , pcProtocolParams = + ProtocolParameters + { protocolParamProtocolVersion = (4, 1) + , protocolParamDecentralization = 2 % 4 + , protocolParamExtraPraosEntropy = Just $ makePraosNonce "HASH2" + , protocolParamMaxBlockHeaderSize = 1001 + , protocolParamMaxBlockBodySize = 1002 + , protocolParamMaxTxSize = 1003 + , protocolParamTxFeeFixed = 1004 + , protocolParamTxFeePerByte = 1005 + , protocolParamMinUTxOValue = Just 1006 + , protocolParamStakeAddressDeposit = Lovelace 1007 + , protocolParamStakePoolDeposit = Lovelace 1008 + , protocolParamMinPoolCost = Lovelace 1009 + , protocolParamPoolRetireMaxEpoch = EpochNo 19 + , protocolParamStakePoolTargetNum = 1010 + , protocolParamPoolPledgeInfluence = 2 % 8 + , protocolParamMonetaryExpansion = 4 % 1011 + , protocolParamTreasuryCut = 5 % 7 + , protocolParamUTxOCostPerWord = Nothing + , protocolParamCostModels = + Map.fromList + [ + ( AnyPlutusScriptVersion PlutusScriptV2 + , CostModel + ( Map.fromList + [ ("add_integer-cpu-arguments-intercept", 123456) + ] + ) + ) + ] + , protocolParamPrices = Just (ExecutionUnitPrices {priceExecutionSteps = 1 % 9, priceExecutionMemory = 1 % 10}) + , protocolParamMaxTxExUnits = Just (ExecutionUnits {executionSteps = 1012, executionMemory = 1013}) + , protocolParamMaxBlockExUnits = Just (ExecutionUnits {executionSteps = 1014, executionMemory = 1015}) + , protocolParamMaxValueSize = Just 1016 + , protocolParamCollateralPercent = Just 1017 + , protocolParamMaxCollateralInputs = Just 1018 + } + , pcSlotConfig = SlotConfig {scSlotLength = 1019, scSlotZeroTime = POSIXTime 1020} + , pcTipPollingInterval = 1021 + , pcScriptFileDir = "./result-scripts2" + , pcSigningKeyFileDir = "./signing-keys2" + , pcTxFileDir = "./txs2" + , pcDryRun = False + , pcProtocolParamsFile = "./protocol.json3" + , pcLogLevel = Debug + , pcOwnPubKeyHash = "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546" + , pcForceBudget = Just (1000, 1000) + , pcPort = 1021 + , pcEnableTxEndpoint = True + } diff --git a/test/Spec/BotPlutusInterface/Contract.hs b/test/Spec/BotPlutusInterface/Contract.hs index f1bce84d..c05bd647 100644 --- a/test/Spec/BotPlutusInterface/Contract.hs +++ b/test/Spec/BotPlutusInterface/Contract.hs @@ -830,12 +830,12 @@ useWriter = do let constraints = Constraints.mustPayToPubKey paymentPkh2 (Ada.lovelaceValueOf 1000) txId <- submitTx constraints - tell $ Last $ Just $ Text.pack $ show $ Tx.txId <$> txId + tell $ Last $ Just $ Text.pack $ show $ Tx.getCardanoTxId txId pure txId assertContractWithTxId contract initState $ \state outTxId -> do (state ^. observableState) - @?= Last (Just ("Right " <> outTxId)) + @?= Last (Just outTxId) waitNextBlock :: Assertion waitNextBlock = do diff --git a/test/Spec/MockContract.hs b/test/Spec/MockContract.hs index 7ab0e3e0..a920d02c 100644 --- a/test/Spec/MockContract.hs +++ b/test/Spec/MockContract.hs @@ -89,7 +89,7 @@ import Data.Default (Default (def)) import Data.Either.Combinators (mapLeft) import Data.Hex (hex) import Data.Kind (Type) -import Data.List (isPrefixOf, sortOn) +import Data.List (isPrefixOf) import Data.Map (Map) import Data.Map qualified as Map import Data.Maybe (fromMaybe) @@ -112,12 +112,10 @@ import Ledger.TxId (TxId (TxId)) import Ledger.Value qualified as Value import NeatInterpolation (text) import Plutus.ChainIndex.Api (UtxosResponse (..)) -import Plutus.ChainIndex.Tx (ChainIndexTx (..), ChainIndexTxOutputs (ValidTx)) import Plutus.ChainIndex.Types (BlockId (..), BlockNumber (unBlockNumber), Tip (..)) import Plutus.Contract (Contract (Contract)) import Plutus.Contract.Effects (ChainIndexQuery (..), ChainIndexResponse (..)) import Plutus.PAB.Core.ContractInstance.STM (Activity (Active)) -import Plutus.V1.Ledger.Credential (Credential (PubKeyCredential)) import PlutusTx.Builtins (fromBuiltin) import System.IO.Unsafe (unsafePerformIO) import Text.Read (readMaybe) @@ -511,12 +509,9 @@ mockQueryChainIndex = \case RedeemerFromHash _ -> -- pure $ RedeemerHashResponse Nothing throwError @Text "RedeemerFromHash is unimplemented" - TxOutFromRef txOutRef -> do + UnspentTxOutFromRef txOutRef -> do state <- get @(MockContractState w) - pure $ TxOutRefResponse $ Tx.fromTxOut =<< lookup txOutRef (state ^. utxos) - TxFromTxId _ -> - -- pure $ TxIdResponse Nothing - throwError @Text "TxFromTxId is unimplemented" + pure $ UnspentTxOutResponse $ Tx.fromTxOut =<< lookup txOutRef (state ^. utxos) UtxoSetMembership _ -> throwError @Text "UtxoSetMembership is unimplemented" UtxoSetAtAddress pageQuery _ -> do @@ -533,35 +528,7 @@ mockQueryChainIndex = \case UtxosResponse (state ^. tip) (pageOf pageQuery (Set.fromList (state ^. utxos ^.. traverse . _1))) - TxsFromTxIds ids -> do - -- TODO: Track some kind of state here, add tests to ensure this works correctly - -- For now, empty txs - state <- get @(MockContractState w) - let knownUtxos = state ^. utxos - pure . TxIdsResponse . (<$> ids) $ \txId -> - ChainIndexTx - { _citxTxId = txId - , _citxInputs = mempty - , _citxOutputs = buildOutputsFromKnownUTxOs knownUtxos txId - , _citxValidRange = Ledger.always - , _citxData = mempty - , _citxRedeemers = mempty - , _citxScripts = mempty - , _citxCardanoTx = Nothing - } TxoSetAtAddress _ _ -> throwError @Text "TxoSetAtAddress is unimplemented" GetTip -> throwError @Text "GetTip is unimplemented" - --- | Fills in gaps of inputs with garbage TxOuts, so that the indexes we know about are in the correct positions -buildOutputsFromKnownUTxOs :: [(TxOutRef, TxOut)] -> TxId -> ChainIndexTxOutputs -buildOutputsFromKnownUTxOs knownUtxos txId = ValidTx $ fillGaps sortedRelatedRefs 0 - where - sortedRelatedRefs = sortOn (Tx.txOutRefIdx . fst) $ filter ((== txId) . Tx.txOutRefId . fst) knownUtxos - fillGaps :: [(TxOutRef, TxOut)] -> Integer -> [TxOut] - fillGaps [] _ = [] - fillGaps (out@(TxOutRef _ n', txOut) : outs) n - | n' == n = txOut : fillGaps outs (n + 1) - | otherwise = defTxOut : fillGaps (out : outs) (n + 1) - defTxOut = TxOut (Ledger.Address (PubKeyCredential "") Nothing) mempty Nothing