diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-11-29 05:52:32 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-11-29 08:38:11 +0800 |
commit | 04503200e5eafda6617039b113ef26cf48184f62 (patch) | |
tree | 6e853cdd3c563908cf31a88214c499a1a0673842 /packages/utils/src/abi_encoder/abstract_data_types | |
parent | 2da7cadefa877ff824da8fbaecd59dbff5028728 (diff) | |
download | dexon-0x-contracts-04503200e5eafda6617039b113ef26cf48184f62.tar dexon-0x-contracts-04503200e5eafda6617039b113ef26cf48184f62.tar.gz dexon-0x-contracts-04503200e5eafda6617039b113ef26cf48184f62.tar.bz2 dexon-0x-contracts-04503200e5eafda6617039b113ef26cf48184f62.tar.lz dexon-0x-contracts-04503200e5eafda6617039b113ef26cf48184f62.tar.xz dexon-0x-contracts-04503200e5eafda6617039b113ef26cf48184f62.tar.zst dexon-0x-contracts-04503200e5eafda6617039b113ef26cf48184f62.zip |
Linter / Prettier
Diffstat (limited to 'packages/utils/src/abi_encoder/abstract_data_types')
-rw-r--r-- | packages/utils/src/abi_encoder/abstract_data_types/types/set.ts | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts b/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts index bbe29eff0..089d04659 100644 --- a/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts +++ b/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts @@ -107,11 +107,7 @@ export abstract class AbstractSetDataType extends DataType { } // Create a new calldata block for this set. const parentName = _.isUndefined(parentBlock) ? '' : parentBlock.getName(); - const block = new SetCalldataBlock( - this.getDataItem().name, - this.getSignature(), - parentName, - ); + const block = new SetCalldataBlock(this.getDataItem().name, this.getSignature(), parentName); // If this set has an undefined length then set its header to be the number of elements. let members = this._members; if (this._isArray && _.isUndefined(this._arrayLength)) { @@ -135,11 +131,7 @@ export abstract class AbstractSetDataType extends DataType { protected _generateCalldataBlockFromObject(obj: object, parentBlock?: CalldataBlock): SetCalldataBlock { // Create a new calldata block for this set. const parentName = _.isUndefined(parentBlock) ? '' : parentBlock.getName(); - const block = new SetCalldataBlock( - this.getDataItem().name, - this.getSignature(), - parentName, - ); + const block = new SetCalldataBlock(this.getDataItem().name, this.getSignature(), parentName); // Create blocks for members of set. const memberCalldataBlocks: CalldataBlock[] = []; const childMap = _.cloneDeep(this._memberIndexByName); @@ -178,7 +170,11 @@ export abstract class AbstractSetDataType extends DataType { private _createMembersWithKeys(dataItem: DataItem): [DataType[], MemberIndexByName] { // Sanity check if (_.isUndefined(dataItem.components)) { - throw new Error(`Tried to create a set using key/value pairs, but no components were defined by the input DataItem '${dataItem.name}'.`); + throw new Error( + `Tried to create a set using key/value pairs, but no components were defined by the input DataItem '${ + dataItem.name + }'.`, + ); } // Create one member for each component of `dataItem` const members: DataType[] = []; |