fromJust in ContractModel
locallycompact opened this issue · comments
Summary
Hi, there's a call to fromJust in the contract model that is causing an error I can't diagnose
Standard Model Check: FAIL (0.12s)
*** Failed! (after 3 tests):
Exception:
Maybe.fromJust: Nothing
CallStack (from HasCallStack):
error, called at libraries/base/Data/Maybe.hs:148:21 in base:Data.Maybe
fromJust, called at src/Plutus/Contract/Test/ContractModel/Internal.hs:1500:50 in plutus-contract-0.1.0.0-JzCKyMWsUmI2lrOzmBFwW:Plutus.Contract.Test.ContractModel.Internal
Actions
[tok1 := SetupTokens]
Use --quickcheck-replay=472094 to reproduce.
fromJust call is here https://github.com/input-output-hk/plutus-apps/blob/main/plutus-contract/src/Plutus/Contract/Test/ContractModel/Internal.hs#L1562
Steps to reproduce the behavior
Can't share code on this one.
Actual Result
fromJust
Expected Result
should not fromJust
Describe the approach you would take to fix this
No response
System info
NixOS
Hi,
without more detail about what code you're running I can't really help you. One possible reason for this is that shrinking maintains symbolic tokens that refer to actions that don't exist. However, without more details there isn't super much I can do. I will try to issue a patch that gives a more helpful error message however.
Another possible reason is that you're trying to use a SymToken
that you got from somewhere other than the model run - this would explain why the idx
doesn't exist.
Thanks, I was able to see what I had done wrong. Thanks for the error message.