Hey DAMLer’s!
I am working on converting my scenario to a script. Our model is based on ex-cdm-swaps
.
I am trying to execute this line in my script.
eiCid <- fromRightS "Unknown error" =<< (submit p2.p do exerciseCmd epCid EP.Accept with exerciser = p2.p)
Here is the error I am getting.
C:\Users\James Jaworski\OneDrive\BloqbookV2\sandbox-srm\src\daml\DA\srm\Test\Event.daml:102:12: error:
• Couldn't match type ‘Scenario’ with ‘Script’
Expected type: Script (ContractId EventInstance)
Actual type: Scenario (ContractId EventInstance)
• In a stmt of a 'do' block:
eiCid <- fromRightS "Unknown error"
=<<
(submit
(DA.Internal.Record.getField @"p" p2)
do exerciseCmd
epCid
EP.Accept {exerciser = (DA.Internal.Record.getField @"p" p2)})
In the expression:
do debug "Starting market setup..."
let p1 = ...
let p2 = ...
let p3 = ...
....
In an equation for ‘setupMarketWithParties’:
setupMarketWithParties parties@CdmParties {..}
= do debug "Starting market setup..."
let p1 = ...
let p2 = ...
....typecheck
C:\Users\James Jaworski\OneDrive\BloqbookV2\sandbox-srm\src\daml\DA\srm\Test\Event.daml:102:54: error:
• Couldn't match type ‘Script’ with ‘Scenario’
arising from a functional dependency between:
constraint ‘HasSubmit Scenario Commands’
arising from a use of ‘submit’
instance ‘HasSubmit Script Commands’ at <no location info>
• In the second argument of ‘(=<<)’, namely
‘(submit
(DA.Internal.Record.getField @"p" p2)
do exerciseCmd
epCid
EP.Accept {exerciser = (DA.Internal.Record.getField @"p" p2)})’
In a stmt of a 'do' block:
eiCid <- fromRightS "Unknown error"
=<<
(submit
(DA.Internal.Record.getField @"p" p2)
do exerciseCmd
epCid
EP.Accept {exerciser = (DA.Internal.Record.getField @"p" p2)})
In the expression:
do debug "Starting market setup..."
let p1 = ...
let p2 = ...
let p3 = ...
....typecheck
Peek Problem (Alt+F8)
No quick fixes available
When I start to check this out, I think that it has something to do with the Accept
choice of the EventProposal
contract returning Either (ContractId EventProposal) (ContractId EventInstance)
.
In this case, I am looking to return the right side, EventInstance
.
From the docs, it looks like step 5 is what I am trying to figure out. If so, what is the best way to specify which return the compiler in the script should expect?