From c986e1800c8a31a303cbc7fdd03f6b8cd610acd6 Mon Sep 17 00:00:00 2001 From: samsamtrum Date: Sun, 24 May 2026 00:58:08 +0700 Subject: [PATCH] fix: remove unused deployedOnChains field --- src/account/api/getAccount.ts | 3 --- src/account/types.ts | 1 - src/account/utils.ts | 4 +--- test/unit/account/utils.test.ts | 13 ------------- test/utils/mocks/account.ts | 4 ---- 5 files changed, 1 insertion(+), 24 deletions(-) diff --git a/src/account/api/getAccount.ts b/src/account/api/getAccount.ts index c253a341..18e85534 100644 --- a/src/account/api/getAccount.ts +++ b/src/account/api/getAccount.ts @@ -5,17 +5,14 @@ export const getAccount = ({ address, initCode, type, - deployedOnChains = [], }: { address: Address initCode?: Hex type: AccountType - deployedOnChains?: Number[] }): Account => { return { address, initCode, type, - deployedOnChains, } } diff --git a/src/account/types.ts b/src/account/types.ts index 2104129e..82357e87 100644 --- a/src/account/types.ts +++ b/src/account/types.ts @@ -7,7 +7,6 @@ export type Account = { address: Address initCode?: Hex type: AccountType - deployedOnChains: Number[] } export type Execution = { diff --git a/src/account/utils.ts b/src/account/utils.ts index e5af8327..79bc2dc9 100644 --- a/src/account/utils.ts +++ b/src/account/utils.ts @@ -13,9 +13,7 @@ export function isAccount(obj: unknown): obj is Account { typeof account.initCode === 'string' && account.initCode.startsWith('0x'))) && typeof account.type === 'string' && - isAccountType(account.type) && - Array.isArray(account.deployedOnChains) && - account.deployedOnChains.every((chainId) => typeof chainId === 'number') + isAccountType(account.type) ) } diff --git a/test/unit/account/utils.test.ts b/test/unit/account/utils.test.ts index e7f972d2..857e489f 100644 --- a/test/unit/account/utils.test.ts +++ b/test/unit/account/utils.test.ts @@ -9,7 +9,6 @@ describe('isAccount', () => { const validAccount: Account = { address: testAddress, type: 'kernel', - deployedOnChains: [1, 2, 3], } expect(isAccount(validAccount)).toBe(true) }) @@ -18,7 +17,6 @@ describe('isAccount', () => { const invalidAccount = { address: '1234567890abcdef', type: 'kernel', - deployedOnChains: [1, 2, 3], } expect(isAccount(invalidAccount)).toBe(false) }) @@ -32,15 +30,6 @@ describe('isAccount', () => { expect(isAccount(invalidAccount)).toBe(false) }) - test('should return false for an object with an invalid deployedOnChains', () => { - const invalidAccount = { - address: testAddress, - type: 'kernel', - deployedOnChains: ['1', '2', '3'], - } - expect(isAccount(invalidAccount)).toBe(false) - }) - test('should return false for a non-object input', () => { expect(isAccount(null)).toBe(false) expect(isAccount(undefined)).toBe(false) @@ -52,7 +41,6 @@ describe('isAccount', () => { const validAccount: Account = { address: testAddress, type: 'kernel', - deployedOnChains: [1, 2, 3], initCode: '0xabcdef', } expect(isAccount(validAccount)).toBe(true) @@ -62,7 +50,6 @@ describe('isAccount', () => { const invalidAccount = { address: testAddress, type: 'kernel', - deployedOnChains: [1, 2, 3], initCode: 'abcdef', } expect(isAccount(invalidAccount)).toBe(false) diff --git a/test/utils/mocks/account.ts b/test/utils/mocks/account.ts index c7529964..39e965f8 100644 --- a/test/utils/mocks/account.ts +++ b/test/utils/mocks/account.ts @@ -3,24 +3,20 @@ import { Account } from 'src/account/types' export const MockAccountDeployed: Account = { // address: '0x7227dcfb0c5ec7a5f539f97b18be261c49687ed6', address: '0x0579bCB9b3B9678A991F553531c27f4ea4863bE4', - deployedOnChains: [11155111], type: 'erc7579-implementation', } export const MockKernelAccountDeployed: Account = { address: '0xee0cbe5e9c49a2cc31881ab9c26e662be68e85dd', - deployedOnChains: [11155111], type: 'kernel', } export const MockSafeAccountDeployed: Account = { address: '0x2b22106d8Aade2C3E546749bC027D5a21195FfED', - deployedOnChains: [11155111], type: 'safe', } export const MockNexusAccountDeployed: Account = { address: '0x0000000000781492f9942b873C29635420c31e7f', - deployedOnChains: [11155111], type: 'nexus', }