Skip to content

Commit

Permalink
feat: remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
denniswon committed Nov 9, 2023
1 parent 5bbc4ce commit 883c489
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import type {
SignTypedDataParams,
SmartAccountSigner,
} from "@alchemy/aa-core";
import { AA_SDK_TESTS_SIGNER_TYPE } from "@alchemy/aa-core";

export class MockSigner implements SmartAccountSigner {
inner: any;

signerType = AA_SDK_TESTS_SIGNER_TYPE;
signerType = "aa-sdk-tests";

getAddress(): Promise<Address> {
return Promise.resolve("0x48D4d3536cDe7A257087206870c6B6E76e3D4ff4");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
AA_SDK_TESTS_SIGNER_TYPE,
getDefaultEntryPointAddress,
type BatchUserOperationCallData,
type SmartAccountSigner,
Expand Down Expand Up @@ -39,7 +38,7 @@ describe("Kernel Account Tests", () => {
const ownerAccount = mnemonicToAccount(OWNER_MNEMONIC);
const owner: SmartAccountSigner<HDAccount> = {
inner: ownerAccount,
signerType: AA_SDK_TESTS_SIGNER_TYPE,
signerType: "aa-sdk-tests",
signMessage: async (msg) =>
ownerAccount.signMessage({
message: { raw: toHex(msg) },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
AA_SDK_TESTS_SIGNER_TYPE,
type Address,
type Hex,
type SignTypedDataParams,
Expand All @@ -11,7 +10,7 @@ import { OWNER_MNEMONIC } from "../constants.js";
export class MockSigner implements SmartAccountSigner<HDAccount> {
inner = mnemonicToAccount(OWNER_MNEMONIC);

signerType = AA_SDK_TESTS_SIGNER_TYPE;
signerType = "aa-sdk-tests";

getAddress(): Promise<Address> {
return Promise.resolve("0x48D4d3536cDe7A257087206870c6B6E76e3D4ff4");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
AA_SDK_TESTS_SIGNER_TYPE,
type Address,
type Hex,
type SignTypedDataParams,
Expand All @@ -9,7 +8,7 @@ import {
export class MockSignerValidator implements SmartAccountSigner {
inner: any;

signerType = AA_SDK_TESTS_SIGNER_TYPE;
signerType = "aa-sdk-tests";

signTypedData(_params: SignTypedDataParams): Promise<`0x${string}`> {
return Promise.resolve("0xMOCK_SIGN_TYPED_DATA");
Expand Down
3 changes: 1 addition & 2 deletions packages/alchemy/e2e-tests/simple-account.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
SimpleSmartContractAccount,
getDefaultSimpleAccountFactoryAddress,
type SmartAccountSigner,
AA_SDK_TESTS_SIGNER_TYPE,
} from "@alchemy/aa-core";
import { Alchemy, Network } from "alchemy-sdk";
import { toHex, type Address, type Chain, type Hash } from "viem";
Expand All @@ -23,7 +22,7 @@ describe("Simple Account Tests", () => {
}),
signTypedData: async () => "0xHash",
getAddress: async () => ownerAccount.address,
signerType: AA_SDK_TESTS_SIGNER_TYPE,
signerType: "aa-sdk-tests",
};

it("should successfully get counterfactual address", async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/alchemy/src/__tests__/provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("Alchemy Provider Tests", () => {
}),
signTypedData: async () => "0xHash",
getAddress: async () => ownerAccount.address,
signerType: AACoreModule.AA_SDK_TESTS_SIGNER_TYPE,
signerType: "aa-sdk-tests",
};
const chain = polygonMumbai;

Expand Down
1 change: 0 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export type {
SmartAccountSigner,
SmartAccountAuthenticator,
} from "./signer/types.js";
export { AA_SDK_TESTS_SIGNER_TYPE } from "./signer/types.js";
export {
verifyEIP6492Signature,
wrapSignatureWith6492,
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/signer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,3 @@ export interface SmartAccountSigner<Inner = any> {

signTypedData: (params: SignTypedDataParams) => Promise<Hex>;
}

export const AA_SDK_TESTS_SIGNER_TYPE = "aa-sdk-tests";

0 comments on commit 883c489

Please sign in to comment.