I am almost finished a rewrite of the Daml Scripts Doc for basic scripts, but into a more structured presentation, based on a military instructional format, and I was having issues running the code.
I kept on getting this error message in my fancy Vim + LSP:
I reviewed the Docs, searched the forum and even googled externally until it hit me. In the Import cmd at the code of the contract code import Daml.Script ()
, I thought that perhaps I should do something similar to Python’s import of multiple modules.
import Daml.Script ()
import allocateParty
import createCmd
import blahBlah
In turn, this produced more errors, so just on spec I thought that maybe the multiple imports should be inside the (), and the answer is clearly, yes.
import Daml.Script (allocateParty createCmd archiveCmd script) <- works, errors
import Daml.Script (allocateParty, createCmd, archiveCmd, script) < works, OK
Update: The interpreter on running a test stated that the inclusion of ‘archiveCMD’ & ‘script’ in Daml.Script is now redundant.
Note: Adding these multiple imports is not enough, they must be separated by ’ , ’ as while the contract worked and tested OK, it was continuing to give me visual warnings about everything following ‘allocateParty’.
However I was unable to find this solution in the documents, after five minutes so am asking is there a specific reference to this, or have I just discovered an unintended, but oddly correct action?
@anthony I tried to make the tag ‘daml.script’ as that reflects the exact Daml code reference which I thought might be handy for future searches, however I am unable to create it. Comments?