Skip to content

Commit

Permalink
Merge pull request #299 from multiversx/abi-parser-arrays
Browse files Browse the repository at this point in the history
Add more array sizes for the abi parser
  • Loading branch information
popenta authored Jun 19, 2023
2 parents b37a5b5 + e078a84 commit 30f4fbf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@multiversx/sdk-core",
"version": "12.4.0",
"version": "12.4.1",
"description": "MultiversX SDK for JavaScript and TypeScript",
"main": "out/index.js",
"types": "out/index.d.js",
Expand Down
4 changes: 4 additions & 0 deletions src/smartcontracts/typesystem/typeMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,14 @@ export class TypeMapper {
["tuple8", (...typeParameters: Type[]) => new TupleType(...typeParameters)],
// Known-length arrays.
// TODO: Handle these in typeExpressionParser!
["array8", (...typeParameters: Type[]) => new ArrayVecType(8, typeParameters[0])],
["array16", (...typeParameters: Type[]) => new ArrayVecType(16, typeParameters[0])],
["array20", (...typeParameters: Type[]) => new ArrayVecType(20, typeParameters[0])],
["array32", (...typeParameters: Type[]) => new ArrayVecType(32, typeParameters[0])],
["array46", (...typeParameters: Type[]) => new ArrayVecType(46, typeParameters[0])],
["array64", (...typeParameters: Type[]) => new ArrayVecType(64, typeParameters[0])],
["array128", (...typeParameters: Type[]) => new ArrayVecType(128, typeParameters[0])],
["array256", (...typeParameters: Type[]) => new ArrayVecType(256, typeParameters[0])],
]);

// For closed types, we hold actual type instances instead of type constructors / factories (no type parameters needed).
Expand Down

0 comments on commit 30f4fbf

Please sign in to comment.