-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from mlabs-haskell/szg251/tx-info
Add ScriptContext opaques for Rust and Haskell
- Loading branch information
Showing
273 changed files
with
21,871 additions
and
6,121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
imports = [ | ||
./plutus-haskell/build.nix | ||
./prelude-haskell/build.nix | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake .#dev-plutus-haskell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ inputs, ... }: | ||
{ | ||
perSystem = { config, system, ... }: | ||
let | ||
hsFlake = inputs.flake-lang.lib.${system}.haskellPlutusFlake { | ||
src = ./.; | ||
|
||
name = "dev-plutus-haskell"; | ||
|
||
inherit (config.settings.haskell) index-state compiler-nix-name; | ||
|
||
dependencies = [ | ||
# Haskell native backend | ||
"${config.packages.lbr-prelude-haskell-src}" | ||
"${config.packages.lbf-prelude-haskell}" | ||
"${config.packages.lbr-plutus-haskell-src}" | ||
"${config.packages.lbf-plutus-haskell}" | ||
|
||
# PlutusTx backend | ||
"${config.packages.lbr-plutustx-src}" | ||
"${config.packages.lbf-plutus-plutustx}" | ||
"${config.packages.lbf-prelude-plutustx}" | ||
|
||
# Plutarch backend | ||
"${config.packages.lbr-plutarch-src}" | ||
"${config.packages.lbf-prelude-plutarch}" | ||
"${config.packages.lbf-plutus-plutarch}" | ||
|
||
# Plutarch itself | ||
"${inputs.plutarch}" | ||
"${inputs.plutarch}/plutarch-extra" | ||
]; | ||
|
||
devShellTools = config.settings.shell.tools ++ [ | ||
config.packages.lbf-prelude-to-haskell | ||
config.packages.lbf-plutus-to-haskell | ||
config.packages.lbf-plutus-to-plutarch | ||
config.packages.lbf-plutus-to-plutustx | ||
]; | ||
|
||
devShellHook = config.settings.shell.hook; | ||
}; | ||
in | ||
{ | ||
# Develop Plutus applications with Haskell, Plutarch and PlutusTx | ||
devShells.dev-plutus-haskell = hsFlake.devShell; | ||
packages.play-plutus-haskell-lib = hsFlake.packages."plutus-haskell:lib:plutus-haskell"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
packages: ./. | ||
|
||
tests: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
cabal-version: 3.0 | ||
name: plutus-haskell | ||
version: 0.1.0.0 | ||
synopsis: Dev shell for LambdaBuffers Plutus Haskell | ||
author: Drazen Popovic | ||
maintainer: [email protected] | ||
|
||
flag dev | ||
description: Enable non-strict compilation for development | ||
manual: True | ||
|
||
common common-language | ||
ghc-options: | ||
-Wall -Wcompat -fprint-explicit-foralls -fprint-explicit-kinds | ||
-fwarn-missing-import-lists -Weverything -Wno-unsafe | ||
-Wno-missing-safe-haskell-mode -Wno-implicit-prelude | ||
-Wno-missing-kind-signatures -Wno-all-missed-specializations | ||
|
||
if !flag(dev) | ||
ghc-options: -Werror | ||
|
||
default-extensions: | ||
BangPatterns | ||
BinaryLiterals | ||
ConstrainedClassMethods | ||
ConstraintKinds | ||
DataKinds | ||
DeriveAnyClass | ||
DeriveDataTypeable | ||
DeriveFoldable | ||
DeriveFunctor | ||
DeriveGeneric | ||
DeriveLift | ||
DeriveTraversable | ||
DerivingStrategies | ||
DerivingVia | ||
DoAndIfThenElse | ||
DuplicateRecordFields | ||
EmptyCase | ||
EmptyDataDecls | ||
EmptyDataDeriving | ||
ExistentialQuantification | ||
ExplicitForAll | ||
ExplicitNamespaces | ||
FlexibleContexts | ||
FlexibleInstances | ||
ForeignFunctionInterface | ||
GADTSyntax | ||
GeneralizedNewtypeDeriving | ||
HexFloatLiterals | ||
ImportQualifiedPost | ||
InstanceSigs | ||
KindSignatures | ||
LambdaCase | ||
MonomorphismRestriction | ||
MultiParamTypeClasses | ||
NamedFieldPuns | ||
NamedWildCards | ||
NoStarIsType | ||
NumericUnderscores | ||
OverloadedLabels | ||
OverloadedStrings | ||
PackageImports | ||
PartialTypeSignatures | ||
PatternGuards | ||
PolyKinds | ||
PostfixOperators | ||
RankNTypes | ||
RecordWildCards | ||
RelaxedPolyRec | ||
ScopedTypeVariables | ||
StandaloneDeriving | ||
StandaloneKindSignatures | ||
TemplateHaskell | ||
TraditionalRecordSyntax | ||
TupleSections | ||
TypeApplications | ||
TypeFamilies | ||
TypeOperators | ||
TypeSynonymInstances | ||
ViewPatterns | ||
|
||
default-language: Haskell2010 | ||
|
||
library | ||
import: common-language | ||
build-depends: | ||
, aeson >=2.2 | ||
, base >=4.16 | ||
, bytestring >=0.11 | ||
, containers >=0.6 | ||
, lbf-plutus >=0.1 | ||
, lbf-plutus-plutarch >=0.1 | ||
, lbf-plutus-plutustx >=0.1 | ||
, lbf-prelude >=0.1 | ||
, lbf-prelude-plutarch >=0.1 | ||
, lbf-prelude-plutustx >=0.1 | ||
, lbr-plutarch >=0.1 | ||
, lbr-plutus >=0.1 | ||
, lbr-plutustx >=0.1 | ||
, lbr-prelude >=0.1 | ||
, plutarch >=1.5 | ||
, plutarch-extra >=1.2 | ||
, plutus-ledger-api >=1.20 | ||
, plutus-tx >=1.1 | ||
, text >=2.0 | ||
|
||
hs-source-dirs: src | ||
exposed-modules: LambdaBuffers.Plutus.Play |
26 changes: 26 additions & 0 deletions
26
extras/dev-shells/plutus-haskell/src/LambdaBuffers/Plutus/Play.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module LambdaBuffers.Plutus.Play () where | ||
|
||
import "aeson" Data.Aeson () | ||
import "bytestring" Data.ByteString () | ||
import "containers" Data.Map () | ||
import "containers" Data.Set () | ||
import "lbf-prelude" LambdaBuffers.Prelude () | ||
import "lbr-prelude" LambdaBuffers.Runtime.Prelude () | ||
import "text" Data.Text () | ||
|
||
import "lbf-plutus" LambdaBuffers.Plutus.V1 () | ||
import "lbr-plutus" LambdaBuffers.Runtime.Plutus () | ||
|
||
import "lbf-plutus-plutustx" LambdaBuffers.Plutus.V1.PlutusTx () | ||
import "lbf-plutus-plutustx" LambdaBuffers.Plutus.V2.PlutusTx () | ||
import "lbf-prelude-plutustx" LambdaBuffers.Prelude.PlutusTx () | ||
import "lbr-plutustx" LambdaBuffers.Runtime.PlutusTx.List () | ||
import "plutus-ledger-api" PlutusLedgerApi.Common () | ||
import "plutus-tx" PlutusTx () | ||
|
||
import "lbf-plutus-plutarch" LambdaBuffers.Plutus.V1.Plutarch () | ||
import "lbf-plutus-plutarch" LambdaBuffers.Plutus.V2.Plutarch () | ||
import "lbf-prelude-plutarch" LambdaBuffers.Prelude.Plutarch () | ||
import "lbr-plutarch" LambdaBuffers.Runtime.Plutarch () | ||
import "plutarch" Plutarch () | ||
import "plutarch-extra" Plutarch.Extra () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake .#dev-prelude-haskell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ inputs, ... }: | ||
{ | ||
perSystem = { config, system, ... }: | ||
let | ||
hsFlake = inputs.flake-lang.lib.${system}.haskellFlake { | ||
src = ./.; | ||
|
||
name = "dev-prelude-haskell"; | ||
|
||
inherit (config.settings.haskell) index-state compiler-nix-name; | ||
|
||
dependencies = [ | ||
"${config.packages.lbr-prelude-haskell-src}" | ||
"${config.packages.lbf-prelude-haskell}" | ||
]; | ||
|
||
devShellTools = config.settings.shell.tools ++ [ config.packages.lbf-prelude-to-haskell ]; | ||
devShellHook = config.settings.shell.hook; | ||
}; | ||
in | ||
{ | ||
# Develop Prelude applications with Haskell | ||
devShells.dev-prelude-haskell = hsFlake.devShell; | ||
packages.play-prelude-haskell-lib = hsFlake.packages."prelude-haskell:lib:prelude-haskell"; | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
packages: ./. | ||
|
||
tests: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
cabal-version: 3.0 | ||
name: prelude-haskell | ||
version: 0.1.0.0 | ||
synopsis: Dev shell for LambdaBuffers Prelude Haskell | ||
author: Drazen Popovic | ||
maintainer: [email protected] | ||
|
||
flag dev | ||
description: Enable non-strict compilation for development | ||
manual: True | ||
|
||
common common-language | ||
ghc-options: | ||
-Wall -Wcompat -fprint-explicit-foralls -fprint-explicit-kinds | ||
-fwarn-missing-import-lists -Weverything -Wno-unsafe | ||
-Wno-missing-safe-haskell-mode -Wno-implicit-prelude | ||
-Wno-missing-kind-signatures -Wno-all-missed-specializations | ||
|
||
if !flag(dev) | ||
ghc-options: -Werror | ||
|
||
default-extensions: | ||
BangPatterns | ||
BinaryLiterals | ||
ConstrainedClassMethods | ||
ConstraintKinds | ||
DataKinds | ||
DeriveAnyClass | ||
DeriveDataTypeable | ||
DeriveFoldable | ||
DeriveFunctor | ||
DeriveGeneric | ||
DeriveLift | ||
DeriveTraversable | ||
DerivingStrategies | ||
DerivingVia | ||
DoAndIfThenElse | ||
DuplicateRecordFields | ||
EmptyCase | ||
EmptyDataDecls | ||
EmptyDataDeriving | ||
ExistentialQuantification | ||
ExplicitForAll | ||
ExplicitNamespaces | ||
FlexibleContexts | ||
FlexibleInstances | ||
ForeignFunctionInterface | ||
GADTSyntax | ||
GeneralizedNewtypeDeriving | ||
HexFloatLiterals | ||
ImportQualifiedPost | ||
InstanceSigs | ||
KindSignatures | ||
LambdaCase | ||
MonomorphismRestriction | ||
MultiParamTypeClasses | ||
NamedFieldPuns | ||
NamedWildCards | ||
NoStarIsType | ||
NumericUnderscores | ||
OverloadedLabels | ||
OverloadedStrings | ||
PackageImports | ||
PartialTypeSignatures | ||
PatternGuards | ||
PolyKinds | ||
PostfixOperators | ||
RankNTypes | ||
RecordWildCards | ||
RelaxedPolyRec | ||
ScopedTypeVariables | ||
StandaloneDeriving | ||
StandaloneKindSignatures | ||
TemplateHaskell | ||
TraditionalRecordSyntax | ||
TupleSections | ||
TypeApplications | ||
TypeFamilies | ||
TypeOperators | ||
TypeSynonymInstances | ||
ViewPatterns | ||
|
||
default-language: Haskell2010 | ||
|
||
library | ||
import: common-language | ||
build-depends: | ||
, aeson >=2.2 | ||
, base >=4.16 | ||
, bytestring >=0.11 | ||
, containers >=0.6 | ||
, lbf-prelude >=0.1 | ||
, lbr-prelude >=0.1 | ||
, text >=2.0 | ||
|
||
hs-source-dirs: src | ||
exposed-modules: LambdaBuffers.Prelude.Play |
9 changes: 9 additions & 0 deletions
9
extras/dev-shells/prelude-haskell/src/LambdaBuffers/Prelude/Play.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module LambdaBuffers.Prelude.Play () where | ||
|
||
import "aeson" Data.Aeson () | ||
import "bytestring" Data.ByteString () | ||
import "containers" Data.Map () | ||
import "containers" Data.Set () | ||
import "lbf-prelude" LambdaBuffers.Prelude () | ||
import "lbr-prelude" LambdaBuffers.Runtime.Prelude () | ||
import "text" Data.Text () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Build .lbf schemas and generate Haskell's Plutarch library. | ||
pkgs: lbf: lbg-plutarch: lbfPlutarchOpts: | ||
import ./lbf-haskell.nix pkgs lbf lbg-plutarch lbfPlutarchOpts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,28 @@ | ||
# Build .lbf schemas and generate Haskell's Plutarch library. | ||
# Build .lbf schemas that use LB Plutus (and by extension LB Prelude) package and targets Haskell's Plutarch library. | ||
pkgs: lbf: lbg-plutarch: lbfPlutarchOpts: | ||
import ./lbf-haskell.nix pkgs lbf lbg-plutarch lbfPlutarchOpts | ||
let | ||
utils = import ./utils.nix pkgs; | ||
|
||
lbfPlutarch = import ./lbf-plutarch-base.nix pkgs lbf lbg-plutarch; | ||
lbfPlutarchOptsForPlutus = utils.overrideAttrs | ||
{ | ||
imports = { | ||
default = [ ]; | ||
override = libs: libs ++ [ ../../libs/lbf-prelude ../../libs/lbf-plutus ]; | ||
}; | ||
dependencies = { | ||
default = [ ]; | ||
override = deps: deps ++ [ "lbf-prelude-plutarch" "lbf-plutus-plutarch" ]; | ||
}; | ||
classes = { | ||
default = [ ]; | ||
override = cls: cls ++ [ "Prelude.Eq" "Plutus.V1.PlutusData" ]; | ||
}; | ||
configs = { | ||
default = [ ]; | ||
override = _: [ ../../lambda-buffers-codegen/data/plutarch-prelude.json ../../lambda-buffers-codegen/data/plutarch-plutus.json ]; | ||
}; | ||
} | ||
lbfPlutarchOpts; | ||
in | ||
lbfPlutarch lbfPlutarchOptsForPlutus |
File renamed without changes.
Oops, something went wrong.