Skip to content

Commit

Permalink
Merge pull request #206 from ElrondNetwork/type-mapper
Browse files Browse the repository at this point in the history
Add extra type for known-length arrays.
  • Loading branch information
andreibancioiu authored May 2, 2022
2 parents a610483 + 194f2e0 commit b9b6205
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 90 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ All notable changes will be documented in this file.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## Unreleased
- TBD

## 10.2.0
- [Define Transaction Factory and Gas Estimator](https://github.com/ElrondNetwork/elrond-sdk-erdjs/pull/203)
- [Fix type mapper / ABI registry (scenario: nested structs with ArrayN)](https://github.com/ElrondNetwork/elrond-sdk-erdjs/pull/198)
- [Add extra type for known-length arrays](https://github.com/ElrondNetwork/elrond-sdk-erdjs/pull/206)

## 10.1.2
- [Fix ABI endpoint definition: attribute "mutability"](https://github.com/ElrondNetwork/elrond-sdk-erdjs/pull/200)
Expand Down
176 changes: 88 additions & 88 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": "@elrondnetwork/erdjs",
"version": "10.1.2",
"version": "10.2.0",
"description": "Smart Contracts interaction framework",
"main": "out/index.js",
"types": "out/index.d.js",
Expand Down
3 changes: 2 additions & 1 deletion src/smartcontracts/typesystem/typeMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ export class TypeMapper {
["tuple7", (...typeParameters: Type[]) => new TupleType(...typeParameters)],
["tuple8", (...typeParameters: Type[]) => new TupleType(...typeParameters)],
// Known-length arrays.
// TODO: Handle these in typeExpressionParser, perhaps?
// TODO: Handle these in typeExpressionParser!
["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])],
]);

Expand Down

0 comments on commit b9b6205

Please sign in to comment.