diff options
author | Fabio Berger <me@fabioberger.com> | 2018-10-02 00:53:19 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-10-02 00:53:19 +0800 |
commit | dbbf04bc7d6072055911572b41afd2bf95e65c70 (patch) | |
tree | 7acf866f2c8aa8d30bb46b99b6d659d96aa2020f | |
parent | bad6761e13d5348eccdf8ae37e83b152740dbe45 (diff) | |
download | dexon-sol-tools-dbbf04bc7d6072055911572b41afd2bf95e65c70.tar dexon-sol-tools-dbbf04bc7d6072055911572b41afd2bf95e65c70.tar.gz dexon-sol-tools-dbbf04bc7d6072055911572b41afd2bf95e65c70.tar.bz2 dexon-sol-tools-dbbf04bc7d6072055911572b41afd2bf95e65c70.tar.lz dexon-sol-tools-dbbf04bc7d6072055911572b41afd2bf95e65c70.tar.xz dexon-sol-tools-dbbf04bc7d6072055911572b41afd2bf95e65c70.tar.zst dexon-sol-tools-dbbf04bc7d6072055911572b41afd2bf95e65c70.zip |
Fix bug in sol-doc
-rw-r--r-- | packages/sol-doc/src/cli.ts | 2 | ||||
-rw-r--r-- | packages/sol-doc/src/sol_doc.ts | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/packages/sol-doc/src/cli.ts b/packages/sol-doc/src/cli.ts index 11e638785..a1847e868 100644 --- a/packages/sol-doc/src/cli.ts +++ b/packages/sol-doc/src/cli.ts @@ -30,7 +30,7 @@ const JSON_TAB_WIDTH = 4; '46f7e8c4d144d11a72ce5338458ea37b933500d7a65e740cbca6d16e350eaa48': 'FillResults', c22239cf0d29df1e6cf1be54f21692a8c0b3a48b9367540d4ffff4608b331ce9: 'OrderInfo', c21e9ff31a30941c22e1cb43752114bb467c34dea58947f98966c9030fc8e4a9: 'TraderInfo', - '07c2bddc165e0b5005e6244dd4a9771fa61c78c4f42abd687d57567b0768136c': 'MatchedFillResults', + '6de3264a1040e027d4bdd29c71e963028238ac4ef060541078a7aced44a4d46f': 'MatchedFillResults', }; const solDoc = new SolDoc(); const doc = await solDoc.generateSolDocAsync(argv.contractsDir, argv.contracts, customTypeHashToName); diff --git a/packages/sol-doc/src/sol_doc.ts b/packages/sol-doc/src/sol_doc.ts index 4b7cbe77c..eda767054 100644 --- a/packages/sol-doc/src/sol_doc.ts +++ b/packages/sol-doc/src/sol_doc.ts @@ -270,15 +270,15 @@ export class SolDoc { } return type; } - private _overwriteStructNames(customTypes: CustomType[], customTypeHashToName?: ObjectMap<string>): CustomType[] { - if (_.isUndefined(customTypeHashToName)) { + private _overwriteStructNames(customTypes: CustomType[]): CustomType[] { + if (_.isUndefined(this._customTypeHashToName)) { return customTypes; } const localCustomTypes = _.cloneDeep(customTypes); - _.each(localCustomTypes, customType => { + _.each(localCustomTypes, (customType, i) => { const hash = SolDoc._generateCustomTypeHash(customType); if (!_.isUndefined(this._customTypeHashToName) && !_.isUndefined(this._customTypeHashToName[hash])) { - customType.name = this._customTypeHashToName[hash]; + localCustomTypes[i].name = this._customTypeHashToName[hash]; } }); return localCustomTypes; |