Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

fromJust in ContractModel #337

Closed
locallycompact opened this issue Mar 1, 2022 · 4 comments · Fixed by #341
Closed

fromJust in ContractModel #337

locallycompact opened this issue Mar 1, 2022 · 4 comments · Fixed by #341
Labels
bug Something isn't working

Comments

@locallycompact
Copy link
Contributor

locallycompact commented Mar 1, 2022

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

@locallycompact locallycompact added the bug Something isn't working label Mar 1, 2022
@koslambrou
Copy link
Contributor

@MaximilianAlgehed

@MaximilianAlgehed
Copy link
Contributor

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.

@MaximilianAlgehed
Copy link
Contributor

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.

@locallycompact
Copy link
Contributor Author

Thanks, I was able to see what I had done wrong. Thanks for the error message.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
3 participants