I upgraded the Plutus version used by my project to: 2f11c28bd8f6d630daab582255e16d8408075bd7
PS: It is the same version Lars used in his latest lecture (Iteration #2 - Lecture #8)
Here is the code I'm using to define the endpoints:
data StarterContracts =
MarketContract
deriving (Eq, Ord, Show, Generic, FromJSON, ToJSON)
instance Pretty StarterContracts where
pretty = viaShow
handleStarterContract ::
( Member (Error PABError) effs
, Member (LogMsg (PABMultiAgentMsg (Builtin StarterContracts))) effs
)
=> ContractEffect (Builtin StarterContracts)
~> Eff effs
handleStarterContract = handleBuiltin getSchema getContract where
getSchema = \case
MarketContract -> endpointsToSchemas @Market.MarketSchema
getContract = \case
MarketContract -> SomeBuiltin Market.endpoints
handlers :: SimulatorEffectHandlers (Builtin StarterContracts)
handlers =
Simulator.mkSimulatorHandlers @(Builtin StarterContracts) [MarketContract]
$ interpret handleStarterContract
And this is the error I'm getting when trying to compile it:
app/Main.hs:62:25: error:
• Couldn't match expected type ‘(StarterContracts
-> [playground-common-0.1.0.0:Playground.Types.FunctionSchema
playground-common-0.1.0.0:Schema.FormSchema])
-> (StarterContracts -> SomeBuiltin)
-> ContractEffect (Builtin StarterContracts) x
-> Eff effs x’
with actual type ‘Plutus.PAB.Effects.Contract.Builtin.BuiltinHandler
a0’
• The function ‘handleBuiltin’ is applied to two arguments,
but its type ‘Plutus.PAB.Effects.Contract.Builtin.BuiltinHandler
a0’
has none
In the expression: handleBuiltin getSchema getContract
In an equation for ‘handleStarterContract’:
handleStarterContract
= handleBuiltin getSchema getContract
where
getSchema
= \case MarketContract -> endpointsToSchemas @MarketSchema
getContract = \case MarketContract -> SomeBuiltin endpoints
• Relevant bindings include
handleStarterContract :: ContractEffect (Builtin StarterContracts)
~> Eff effs
(bound at app/Main.hs:62:1)
|
62 | handleStarterContract = handleBuiltin getSchema getContract where
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/Main.hs:70:5: error:
• Couldn't match type ‘Simulator.SimulatorContractHandler
(Builtin StarterContracts)
-> SimulatorEffectHandlers (Builtin StarterContracts)’
with ‘Plutus.PAB.Core.EffectHandlers
(Builtin StarterContracts)
(Simulator.SimulatorState (Builtin StarterContracts))’
Expected type: SimulatorEffectHandlers (Builtin StarterContracts)
Actual type: Simulator.SimulatorContractHandler
(Builtin StarterContracts)
-> SimulatorEffectHandlers (Builtin StarterContracts)
• In the expression:
Simulator.mkSimulatorHandlers
@(Builtin StarterContracts) [MarketContract]
$ interpret handleStarterContract
In an equation for ‘handlers’:
handlers
= Simulator.mkSimulatorHandlers
@(Builtin StarterContracts) [MarketContract]
$ interpret handleStarterContract
|
70 | Simulator.mkSimulatorHandlers @(Builtin StarterContracts) [MarketContract]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
app/Main.hs:70:63: error:
• Couldn't match expected type ‘Ledger.Fee.FeeConfig’
with actual type ‘[StarterContracts]’
• In the second argument of ‘Simulator.mkSimulatorHandlers’, namely
‘[MarketContract]’
In the expression:
Simulator.mkSimulatorHandlers
@(Builtin StarterContracts) [MarketContract]
In the expression:
Simulator.mkSimulatorHandlers
@(Builtin StarterContracts) [MarketContract]
$ interpret handleStarterContract
|
70 | Simulator.mkSimulatorHandlers @(Builtin StarterContracts) [MarketContract]
| ^^^^^^^^^^^^^^^^
app/Main.hs:71:7: error:
• Couldn't match expected type ‘Ledger.TimeSlot.SlotConfig’
with actual type ‘Eff
(ContractEffect (Builtin StarterContracts) : effs0) x0
-> Eff effs0 x0’
• Probable cause: ‘interpret’ is applied to too few arguments
In the second argument of ‘($)’, namely
‘interpret handleStarterContract’
In the expression:
Simulator.mkSimulatorHandlers
@(Builtin StarterContracts) [MarketContract]
$ interpret handleStarterContract
In an equation for ‘handlers’:
handlers
= Simulator.mkSimulatorHandlers
@(Builtin StarterContracts) [MarketContract]
$ interpret handleStarterContract
|
71 | $ interpret handleStarterContract
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^