Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion extras/lbf-nix/lbf-haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ let
'';
};

cabalProject =
opts:
with (lbfHaskellOpts opts);
pkgs.writeTextFile {
name = "lambda-buffers-cabal-project";
text = ''
packages: ./${name}.cabal

source-repository-package
type: git
location: https://github.com/mlabs-haskell/hbls-need-push-access.git
tag: 6b92e81481f5409c624e1b9b22eefc7d3abd81fb
'';
};

build =
opts:
with (lbfHaskellOpts opts);
Expand Down Expand Up @@ -116,12 +131,14 @@ let
cat ${cabalTemplate opts} \
| sed -r "s/<EXPOSED_MODULES>/$EXPOSED_MODULES/" \
| sed -r "s/<DEPS>/$DEPS/" > ${name}.cabal;
cat ${cabalProject opts} > cabal.project;
'';

installPhase = ''
mkdir -p $out;
cp -rL autogen $out
cp -rL autogen $out;
cp ${name}.cabal $out/${name}.cabal;
cp cabal.project $out/cabal.project;
find $out;

cp build.json $buildjson;
Expand Down
10 changes: 10 additions & 0 deletions lambda-buffers-codegen/data/haskell-prelude-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@
"base",
"Prelude",
"Bool"
],
"Prelude.G1Element": [
"hbls-need-push-access",
"HBLS",
"G1Point"
],
"Prelude.G2Element": [
"hbls-need-push-access",
"HBLS",
"G2Point"
]
},
"classesConfig": {
Expand Down
10 changes: 10 additions & 0 deletions lambda-buffers-codegen/data/plutarch-prelude.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@
"lbr-plutarch",
"LambdaBuffers.Runtime.Plutarch",
"PSet"
],
"Prelude.G1Element": [
"plutarch",
"Plutarch.Builtin.BLS",
"PBuiltinBLS12_381_G1_Element"
],
"Prelude.G2Element": [
"plutarch",
"Plutarch.Builtin.BLS",
"PBuiltinBLS12_381_G2_Element"
]
},
"classesConfig": {
Expand Down
10 changes: 10 additions & 0 deletions lambda-buffers-codegen/data/plutustx-prelude.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@
"lbr-plutustx",
"LambdaBuffers.Runtime.PlutusTx.NotImplemented",
"Set"
],
"Prelude.G1Element": [
"plutus-tx",
"PlutusTx.Builtins",
"BuiltinBLS12_381_G1_Element"
],
"Prelude.G2Element": [
"plutus-tx",
"PlutusTx.Builtins",
"BuiltinBLS12_381_G2_Element"
]
},
"classesConfig": {
Expand Down
12 changes: 11 additions & 1 deletion libs/lbf-prelude/Prelude.lbf

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather put this in libs/lbf-plutus/Plutus/V4.lbf?

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ opaque Text
instance Eq Text
instance Json Text

opaque G1Element

instance Eq G1Element
instance Json G1Element

opaque G2Element

instance Eq G2Element
instance Json G2Element

opaque Maybe a

instance Eq (Maybe a) :- Eq a
Expand All @@ -51,4 +61,4 @@ instance Json (Map k v) :- Json k, Json v
opaque Set a

instance Eq (Set a) :- Eq a
instance Json (Set a) :- Json a
instance Json (Set a) :- Json a
6 changes: 3 additions & 3 deletions runtimes/haskell/lbr-plutarch/lbr-plutarch.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ library
import: common-language
build-depends:
, base
, plutarch
, plutarch-ledger-api
, plutarch >=1.14.0
, plutarch-ledger-api >=3.7.0

hs-source-dirs: src
exposed-modules:
Expand All @@ -107,7 +107,7 @@ test-suite tests
, base
, hedgehog
, lbr-plutarch
, plutarch
, plutarch >=1.14.0
, tasty
, tasty-hedgehog
, tasty-hunit
Expand Down
5 changes: 5 additions & 0 deletions testsuites/lbt-plutus/lbt-plutus-haskell/cabal.project
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
packages: ./.

source-repository-package
type: git
location: https://github.com/mlabs-haskell/hbls-need-push-access.git
tag: 6b92e81481f5409c624e1b9b22eefc7d3abd81fb

tests: true
-- Uniform plutus version across all LambdaBuffers projects (van Rossem/PV11 compatible,
-- newest supported by plutarch 1.14.0)
Expand Down
6 changes: 6 additions & 0 deletions testsuites/lbt-plutus/lbt-plutus-plutarch/cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ packages: ./.

tests: true

source-repository-package
type: git
location: https://github.com/mlabs-haskell/hbls-need-push-access.git
tag: 6b92e81481f5409c624e1b9b22eefc7d3abd81fb


allow-newer:
-- TODO(szg251): Allow once the below issue is resolved
-- https://github.com/phadej/vec/issues/121
Expand Down
5 changes: 5 additions & 0 deletions testsuites/lbt-plutus/lbt-plutus-plutustx/cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ packages: ./.

tests: true

source-repository-package
type: git
location: https://github.com/mlabs-haskell/hbls-need-push-access.git
tag: 6b92e81481f5409c624e1b9b22eefc7d3abd81fb

allow-newer:
-- TODO(szg251): Allow once the below issue is resolved
-- https://github.com/phadej/vec/issues/121
Expand Down
7 changes: 6 additions & 1 deletion testsuites/lbt-prelude/lbt-prelude-haskell/cabal.project
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
packages: ./.

tests: true
source-repository-package
type: git
location: https://github.com/mlabs-haskell/hbls-need-push-access.git
tag: 6b92e81481f5409c624e1b9b22eefc7d3abd81fb

tests: true