Skip to content

Commit a2c372d

Browse files
committed
feat(kleros-sdk): allow-single-value-return-call-action
1 parent e40034f commit a2c372d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kleros-sdk/src/dataMappings/actions/callAction.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@ export const callAction = async (mapping: AbiCallMapping) => {
2121
args,
2222
});
2323

24-
return createResultObject(data, seek, populate);
24+
// in case of single value returns, populate the data as {value : data}
25+
const sourceData = typeof data !== "object" ? { value: data } : data;
26+
27+
return createResultObject(sourceData, seek, populate);
2528
};

0 commit comments

Comments
 (0)