Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more array sizes for the abi parser #299

Merged
merged 3 commits into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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