Hi there!
I’m submitting a command to exercise a choice via the Ledger API, and one of the choice arguments is a custom data class, as below:
ProcessEvent: ContractId Product
with productInfo: ProductInformation; eventAmount: Int
eventId: Text; eventTimestamp: Int
In my java backend, I’m building the Value
for the ProductInformation
class like this:
List<Record.Field> fields = new ArrayList<>();
fields.add(myMapper.createField("textLabel", myMapper.textToValue(myText)));
fields.add(myMapper.createField("intLabel", myMapper.longToValue(myLong)));
...
Identifier identifier = new Identifier(packageId, "MyProject.Data", "ProductInformation");
return new Record(identifier, fields);
and then building the choice arguments in a similar way:
List<Record.Field> fields = new ArrayList<>();
fields.add(myMapper.createField("productInfo", generateProductInfo()));
fields.add(myMapper.createField("eventId", myMapper.textToValue(eventId)));
...
return new Record(fields);
But when I submit the final Record
as the choice argument, I get this error:
INVALID_ARGUMENT: Command interpretation error in LF-DAMLe: Missing record label identity for record 68b265047338e0b799be857cc59d6e61de0c3e02ad9e229637023c923a927b4d:MyProject.Data:ProductInformation.
Can someone see what I’m doing wrong here? Thanks in advance!