Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/account/api/getAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
1 change: 0 additions & 1 deletion src/account/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export type Account = {
address: Address
initCode?: Hex
type: AccountType
deployedOnChains: Number[]
}

export type Execution = {
Expand Down
4 changes: 1 addition & 3 deletions src/account/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
}

Expand Down
13 changes: 0 additions & 13 deletions test/unit/account/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ describe('isAccount', () => {
const validAccount: Account = {
address: testAddress,
type: 'kernel',
deployedOnChains: [1, 2, 3],
}
expect(isAccount(validAccount)).toBe(true)
})
Expand All @@ -18,7 +17,6 @@ describe('isAccount', () => {
const invalidAccount = {
address: '1234567890abcdef',
type: 'kernel',
deployedOnChains: [1, 2, 3],
}
expect(isAccount(invalidAccount)).toBe(false)
})
Expand All @@ -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)
Expand All @@ -52,7 +41,6 @@ describe('isAccount', () => {
const validAccount: Account = {
address: testAddress,
type: 'kernel',
deployedOnChains: [1, 2, 3],
initCode: '0xabcdef',
}
expect(isAccount(validAccount)).toBe(true)
Expand All @@ -62,7 +50,6 @@ describe('isAccount', () => {
const invalidAccount = {
address: testAddress,
type: 'kernel',
deployedOnChains: [1, 2, 3],
initCode: 'abcdef',
}
expect(isAccount(invalidAccount)).toBe(false)
Expand Down
4 changes: 0 additions & 4 deletions test/utils/mocks/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}