Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
Revert "chore: move fix EthErc4337Method -> EthMethod to a differ…
Browse files Browse the repository at this point in the history
…ent PR"

This reverts commit e5453e7.
  • Loading branch information
danroc committed May 22, 2024
1 parent 5f2bc8c commit c5d1b19
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 25 deletions.
32 changes: 16 additions & 16 deletions src/eth/types.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { EthAccountType } from '../api';
import type { Extends } from '../utils';
import { expectTrue } from '../utils';
import type { EthEoaAccount, EthErc4337Account } from './types';
import { EthMethod, EthErc4337Method } from './types';
import { EthMethod } from './types';

const id = '606a7759-b0fb-48e4-9874-bab62ff8e7eb';
const address = '0x000';
Expand Down Expand Up @@ -42,9 +42,9 @@ expectNotAssignable<EthEoaAccount>({
address,
options: {},
methods: [
`${EthErc4337Method.PrepareUserOperation}`,
`${EthErc4337Method.PatchUserOperation}`,
`${EthErc4337Method.SignUserOperation}`,
`${EthMethod.PrepareUserOperation}`,
`${EthMethod.PatchUserOperation}`,
`${EthMethod.SignUserOperation}`,
],
});

Expand All @@ -55,9 +55,9 @@ expectNotAssignable<EthEoaAccount>({
address,
options: {},
methods: [
`${EthErc4337Method.PrepareUserOperation}`,
`${EthErc4337Method.PatchUserOperation}`,
`${EthErc4337Method.SignUserOperation}`,
`${EthMethod.PrepareUserOperation}`,
`${EthMethod.PatchUserOperation}`,
`${EthMethod.SignUserOperation}`,
],
});

Expand All @@ -82,9 +82,9 @@ expectAssignable<EthErc4337Account>({
`${EthMethod.SignTypedDataV1}`,
`${EthMethod.SignTypedDataV3}`,
`${EthMethod.SignTypedDataV4}`,
`${EthErc4337Method.PrepareUserOperation}`,
`${EthErc4337Method.PatchUserOperation}`,
`${EthErc4337Method.SignUserOperation}`,
`${EthMethod.PrepareUserOperation}`,
`${EthMethod.PatchUserOperation}`,
`${EthMethod.SignUserOperation}`,
],
});

Expand All @@ -95,9 +95,9 @@ expectNotAssignable<EthErc4337Account>({
address,
options: {},
methods: [
`${EthErc4337Method.PrepareUserOperation}`,
`${EthErc4337Method.PatchUserOperation}`,
`${EthErc4337Method.SignUserOperation}`,
`${EthMethod.PrepareUserOperation}`,
`${EthMethod.PatchUserOperation}`,
`${EthMethod.SignUserOperation}`,
],
});

Expand All @@ -108,9 +108,9 @@ expectNotAssignable<EthErc4337Account>({
address,
options: {},
methods: [
`${EthErc4337Method.PrepareUserOperation}`,
`${EthErc4337Method.PatchUserOperation}`,
`${EthErc4337Method.SignUserOperation}`,
`${EthMethod.PrepareUserOperation}`,
`${EthMethod.PatchUserOperation}`,
`${EthMethod.SignUserOperation}`,
],
});

Expand Down
12 changes: 3 additions & 9 deletions src/eth/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ export enum EthMethod {
SignTypedDataV1 = 'eth_signTypedData_v1',
SignTypedDataV3 = 'eth_signTypedData_v3',
SignTypedDataV4 = 'eth_signTypedData_v4',
}

/**
* Supported Ethereum methods for ERC-4337 (Account Abstraction) accounts.
*/
export enum EthErc4337Method {
// ERC-4337 methods
PrepareUserOperation = 'eth_prepareUserOperation',
PatchUserOperation = 'eth_patchUserOperation',
Expand Down Expand Up @@ -93,9 +87,9 @@ export const EthErc4337AccountStruct = assign(
`${EthMethod.SignTypedDataV1}`,
`${EthMethod.SignTypedDataV3}`,
`${EthMethod.SignTypedDataV4}`,
`${EthErc4337Method.PrepareUserOperation}`,
`${EthErc4337Method.PatchUserOperation}`,
`${EthErc4337Method.SignUserOperation}`,
`${EthMethod.PrepareUserOperation}`,
`${EthMethod.PatchUserOperation}`,
`${EthMethod.SignUserOperation}`,
]),
),
}),
Expand Down

0 comments on commit c5d1b19

Please sign in to comment.