aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/utils/src/abi_encoder/abstract_data_types/types/set.ts18
-rw-r--r--packages/utils/src/abi_encoder/calldata/blocks/pointer.ts5
-rw-r--r--packages/utils/src/abi_encoder/utils/constants.ts3
3 files changed, 13 insertions, 13 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[] = [];
diff --git a/packages/utils/src/abi_encoder/calldata/blocks/pointer.ts b/packages/utils/src/abi_encoder/calldata/blocks/pointer.ts
index c706fe908..72d6a3173 100644
--- a/packages/utils/src/abi_encoder/calldata/blocks/pointer.ts
+++ b/packages/utils/src/abi_encoder/calldata/blocks/pointer.ts
@@ -24,8 +24,9 @@ export class PointerCalldataBlock extends CalldataBlock {
}
public toBuffer(): Buffer {
- const destinationOffset =
- !_.isUndefined(this._aliasFor) ? this._aliasFor.getOffsetInBytes() : this._dependency.getOffsetInBytes();
+ const destinationOffset = !_.isUndefined(this._aliasFor)
+ ? this._aliasFor.getOffsetInBytes()
+ : this._dependency.getOffsetInBytes();
const parentOffset = this._parent.getOffsetInBytes();
const parentHeaderSize = this._parent.getHeaderSizeInBytes();
const pointer: number = destinationOffset - (parentOffset + parentHeaderSize);
diff --git a/packages/utils/src/abi_encoder/utils/constants.ts b/packages/utils/src/abi_encoder/utils/constants.ts
index acc06329c..2f43ba04d 100644
--- a/packages/utils/src/abi_encoder/utils/constants.ts
+++ b/packages/utils/src/abi_encoder/utils/constants.ts
@@ -9,6 +9,9 @@ export const constants = {
HEX_SELECTOR_LENGTH_IN_CHARS: 10,
HEX_SELECTOR_LENGTH_IN_BYTES: 4,
HEX_SELECTOR_BYTE_OFFSET_IN_CALLDATA: 0,
+ // Disable no-object-literal-type-assertion so we can enforce cast
+ /* tslint:disable no-object-literal-type-assertion */
DEFAULT_DECODING_RULES: { structsAsObjects: false } as DecodingRules,
DEFAULT_ENCODING_RULES: { optimize: true, annotate: false } as EncodingRules,
+ /* tslint:enable no-object-literal-type-assertion */
};