Skip to content
Discussions/App Development/makePartiesFrom variable not in scope errorForum ↗

makePartiesFrom variable not in scope error

App Development7 posts415 views8 likesLast activity Apr 2021
KR
krmmalikOP
Apr 2021

Is the makePartiesFrom a new addition to the SDK to allocate parties? I’ve not seen this before and can’t find any reference to this in the documentation except for setting up a multiple party agreement.

I used the reference documentation to create the following code

parties@[alice, hakan, martin, rita, john, michael, sam, james] <- makePartiesFrom ["Alice", "Hakan", "Martin", "Rita", "John", "Michael", "Sam", "James"]

But I got a variable not in scope error? I started my project on v1.09 of the SDK I believe it was so could that be the reason this line of code is not working?

CO
cocreature
Apr 2021

It’s part of the example code but hidden from the docs. It is not a standard library function. You can see the definition here if you want to copy it into your own project although it’s probably easier to just inline mapA getParty or even better mapA allocateParty for Daml Script instead of scenarios.

AN
anthony
Apr 2021

I was typing it but @cocreature beat me to the punch, alas here is the equivalent code to that example (which should probably be updated).

makePartiesFrom names = mapA allocateParty names

test = script do
  [a, b] <- makePartiesFrom ["a", "b"]
KR
krmmalik
Apr 2021

Ok, thanks guys @anthony and @cocreature . I’ll try this when I get back to my desk. Little omissions and differences like this can really throw off a beginner coder like me.

There seem to be a number of different ways to do the same thing as well. It would be good to see some standardisation.

KR
krmmalik
Apr 2021

Would love to see the complete code in it’s entirety in the documentation example

AN
anthony
Apr 2021
krmmalik:

There seem to be a number of different ways to do the same thing as well. It would be good to see some standardisation.

100% agree, docs, howtos, and tutorials are something we’re going to focus on a lot in Q2.

KR
krmmalik
Apr 2021

I couldn’t get it to work, so I just went back to allocating parties the normal way

alice <- allocateParty "Alice"

← Back to Discussions