Closed andreibancioiu closed 5 months ago
Bad handling of repeated types within multi types:
it("should parse multi (2)", () => {
const type = parser.parse("multi<u8, utf-8 string, u8, utf-8 string, u8, utf-8 string>");
assert.deepEqual(type.toJSON(), {
"name": "multi",
"typeParameters": [
{
"name": "u8",
"typeParameters": []
},
{
"name": "utf-8 string",
"typeParameters": []
},
{
"name": "u8",
"typeParameters": []
},
{
"name": "utf-8 string",
"typeParameters": []
}
]
});
});
See:
private nodeToType(name: string, node: any): Type {
if (name.charAt(name.length - 1) === "1") { name = name.slice(0, -1); }
...
Will be fixed by: https://github.com/multiversx/mx-sdk-js-core/pull/398.
Fixed in v13.
Current implementation is hard to adjust and maintain.