0

I'm trying to run unsafeFromBuiltinData against the following type used as redeemer:

data TypeA= A PaymentPubKeyHash
                  | B PaymentPubKeyHash
                  deriving (Show, P.Eq)
PlutusTx.makeLift ''TypeA
PlutusTx.unstableMakeIsData ''TypeA

But I get the infamous error:

GHC Core to PLC plugin: E043:Error: Reference to a name which is not a local, a builtin, or an external INLINABLE function: Variable Colony.OnChain.Validator.$fUnsafeFromDataColony_go1
            OtherCon []
Context: Compiling expr: Colony.OnChain.Validator.$fUnsafeFromDataColony_go1
Context: Compiling expr: Colony.OnChain.Validator.$fUnsafeFromDataColony_go1
                           (PlutusTx.Builtins.Internal.unsafeDataAsList
                              (PlutusTx.Builtins.Internal.head
                                 @ PlutusTx.Builtins.Internal.BuiltinData t3))

But weirdly enough, when ColonyAction it is reduced to:


data TypeA= A PaymentPubKeyHash
                  deriving (Show, P.Eq)
PlutusTx.makeLift ''TypeA
PlutusTx.unstableMakeIsData ''TypeA

it compiles successfully.

Any ideas?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.