Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffsmale90 committed Dec 19, 2024
1 parent 6c1de88 commit 5c46e25
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@ethereumjs/util": "^8.1.0",
"@ethereumjs/rlp": "^8.1.0",
"@ethereumjs/util": "^4.0.1",
"@metamask/abi-utils": "^3.0.0",
"@metamask/utils": "^11.0.1",
"@scure/base": "~1.1.3",
Expand Down
19 changes: 8 additions & 11 deletions src/sign-authorization.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { bufferToHex, privateToAddress } from '@ethereumjs/util';

import {
signAuthorization,
recoverAuthorization,
Expand Down Expand Up @@ -118,7 +119,7 @@ describe('signAuthorization', () => {
it('should produce the correct hash', () => {
const hash = hashAuthorization(testAuthorization);

expect(hash).toEqual(expectedAuthorizationHash);
expect(hash).toStrictEqual(expectedAuthorizationHash);
});

it('should throw if authorization is null', () => {
Expand Down Expand Up @@ -213,16 +214,12 @@ describe('signAuthorization', () => {

describe('sign-and-recover', () => {
const testCases = {
'zero chainId': [0, '0x1234567890123456789012345678901234567890', 1],
'high chainId': [98765, '0x1234567890123456789012345678901234567890', 1],
'zero nonce': [8545, '0x1234567890123456789012345678901234567890', 0],
'high nonce': [8545, '0x1234567890123456789012345678901234567890', 98765],
'zero contractAddress': [
1,
'0x0000000000000000000000000000000000000000',
1,
],
'all zero values': [0, '0x0000000000000000000000000000000000000000', 0],
zeroChainId: [0, '0x1234567890123456789012345678901234567890', 1],
highChainId: [98765, '0x1234567890123456789012345678901234567890', 1],
zeroNonce: [8545, '0x1234567890123456789012345678901234567890', 0],
highNonce: [8545, '0x1234567890123456789012345678901234567890', 98765],
zeroContractAddress: [1, '0x0000000000000000000000000000000000000000', 1],
allZeroValues: [0, '0x0000000000000000000000000000000000000000', 0],
} as { [key: string]: Authorization };

for (const [label, authorization] of Object.entries(testCases)) {
Expand Down
3 changes: 2 additions & 1 deletion src/sign-authorization.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { encode } from '@ethereumjs/rlp';
import { ecsign, publicToAddress, toBuffer } from '@ethereumjs/util';
import { bytesToHex } from '@metamask/utils';
import { keccak256 } from 'ethereum-cryptography/keccak';

import { concatSig, isNullish, recoverPublicKey } from './utils';
import { encode } from '@ethereumjs/rlp';

/**
* The authorization struct as defined in EIP-7702.
Expand Down

0 comments on commit 5c46e25

Please sign in to comment.