Closed jhodgdev closed 2 years ago
Thanks for the issue!
I can't reproduce the error so could you please share some details. Do you use regular plutus's nix-shell
environment? What is import PlutusTx.Natural (Natural)
? Do you use https://github.com/ndmitchell/record-dot-preprocessor? What version?
Thank you for responding!
I use an impure nix-shell with lorri
. PlutusTx.Natural is a package used in-house at MLabs. We do use record-dot-preprocessor but I am unsure which version.
My project manager informed me that the pre-processor version is most likely 0.2.13.
Unfortunately the provided info is not enough to tell what's going wrong. Is there any chance of providing a small reproducible example?
I have been working on a small example but so far have been unable to replicate it myself. I will continue to work on it and update you on my progress.
Thank you!
Managed to recreate the issue! Here is the repo: https://github.com/jhodgdev/plc-errors
@jhodgdev
The source of the problem is the bang pattern for the Epoch
here https://github.com/jhodgdev/plc-errors/blob/53fcf08fb41be5a620a0cce6a95e7f036ddf9529/src/PlcErrors.hs#L68.
While we are investigating the behaviour and looking for a proper fix please use {-# OPTIONS_GHC -fno-unbox-small-strict-fields #-}
for now. Or you can delete the bang pattern and make the field lazy. It should help with the compilation error and unblock you.
Thank you very much @ak3n :)
Summary
In trying to add a data type
Epoch
to a UTxO datumTreasuryState
, I encountered a couple of PLC errors during compilation. With:I experienced error trace (A), listed in "Screenshots and attachments" below. Please note that
LiqwidX.Treasury.Init
is the module, which callsmkTypedValidatorParam
onTreasuryState
's script. Making the components ofTreasuryState
strict:results in error trace (B). It is only when I alter
Epoch
to be anewtype
wrapper:or add an additional record constructor:
that the project compiles without issue.
Steps to reproduce
Steps to reproduce the behavior:
For each example listed in the summary:
TypedValidator
usingTreasuryState
.cabal v2-build
on your project.Expected behavior
That the code compiles without issue.
System info (please complete the following information):
Screenshots and attachments
Error Trace (A)
Error Trace (B)