Hi
We recently came across a strange bug in our react.js software that caused all of our ledger.create and ledger.exercise api calls to fail. (We are on DAML SDK 1.7)
The error we are receiving is listed below
TypeError: choice.argumentEncode is not a function
at Ledger.<anonymous> (index.js:419)
at step (index.js:44)
at Object.next (index.js:25)
at index.js:19
at new Promise (<anonymous>)
at push.../../../../Documents/Github/Loci/ui-js/node_modules/@daml/ledger/index.js.__awaiter (index.js:15)
at Ledger.exercise (index.js:410)
at VendorInvite.js:101
at VendorInvite.js:140
at commitHookEffectListMount (react-dom.development.js:19731)
at commitPassiveHookEffects (react-dom.development.js:19769)
at HTMLUnknownElement.callCallback (react-dom.development.js:188)
And is triggered in the the following code of /nodes_modules/@daml/ledger/index,js
Ledger.prototype.exercise = function (choice, contractId, argument) {
return __awaiter(this, void 0, void 0, function () {
var payload, json, responseDecoder, _a, exerciseResult, events;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
payload = {
templateId: choice.template().templateId,
contractId: types_1.ContractId(choice.template()).encode(contractId),
choice: choice.choiceName,
--> This Line argument: choice.argumentEncode(argument),
};
return [4 /*yield*/, this.submit('v1/exercise', payload)];
case 1:
json = _b.sent();
responseDecoder = jtv.object({
exerciseResult: choice.resultDecoder,
events: jtv.array(decodeEventUnknown),
});
_a = jtv.Result.withException(responseDecoder.run(json)), exerciseResult = _a.exerciseResult, events = _a.events;
return [2 /*return*/, [exerciseResult, events]];
}
Also, the ledger create and exercise API calls in Postman are working
Any suggestions on where we should look to solve this problem ?