Skip to content

Commit

Permalink
lint:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Aug 22, 2023
1 parent 74c84dd commit c4fad7f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions src/sign-typed-data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { arrToBufArr, ecsign, publicToAddress } from '@ethereumjs/util';
import { keccak256 } from 'ethereum-cryptography/keccak';
import { encode, encodePacked } from '@metamask/abi-utils';
import {
getArrayType,
getByteLength,
getLength,
isArrayType,
} from '@metamask/abi-utils/dist/parsers';
import { padStart } from '@metamask/abi-utils/dist/utils';
import {
add0x,
assert,
Expand All @@ -13,13 +19,8 @@ import {
signedBigIntToBytes,
stringToBytes,
} from '@metamask/utils';
import {
getArrayType,
getByteLength,
getLength,
isArrayType,
} from '@metamask/abi-utils/dist/parsers';
import { padStart } from '@metamask/abi-utils/dist/utils';
import { keccak256 } from 'ethereum-cryptography/keccak';

import {
concatSig,
isNullish,
Expand Down Expand Up @@ -360,7 +361,9 @@ function encodeData(
validateVersion(version, [SignTypedDataVersion.V3, SignTypedDataVersion.V4]);

const encodedTypes = ['bytes32'];
const encodedValues: (string | bigint | boolean | Uint8Array | Buffer)[] = [hashType(primaryType, types)];
const encodedValues: (string | bigint | boolean | Uint8Array | Buffer)[] = [
hashType(primaryType, types),
];

for (const field of types[primaryType]) {
if (version === SignTypedDataVersion.V3 && data[field.name] === undefined) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
ToBufferInputTypes,
toUnsigned,
} from '@ethereumjs/util';
import { intToHex, isHexString, stripHexPrefix } from 'ethjs-util';
import { add0x, bytesToHex, numberToBytes } from '@metamask/utils';
import { intToHex, isHexString, stripHexPrefix } from 'ethjs-util';

/**
* Pads the front of the given hex string with zeroes until it reaches the
Expand Down

0 comments on commit c4fad7f

Please sign in to comment.