diff --git a/cdp-langchain/src/tests/cdp_tool_test.ts b/cdp-langchain/src/tests/cdp_tool_test.ts index ad5ae4a..a755072 100644 --- a/cdp-langchain/src/tests/cdp_tool_test.ts +++ b/cdp-langchain/src/tests/cdp_tool_test.ts @@ -12,6 +12,7 @@ describe("CdpTool", () => { beforeAll(async () => { mockWallet = {} as unknown as jest.Mocked; + jest.spyOn(Wallet, "create").mockResolvedValue(mockWallet); }); describe("initialization", () => { diff --git a/cdp-langchain/src/tests/cdp_toolkit_test.ts b/cdp-langchain/src/tests/cdp_toolkit_test.ts index 8e3a167..072e9eb 100644 --- a/cdp-langchain/src/tests/cdp_toolkit_test.ts +++ b/cdp-langchain/src/tests/cdp_toolkit_test.ts @@ -18,14 +18,12 @@ describe("CdpToolkit", () => { process.env.CDP_API_KEY_PRIVATE_KEY = "test-private-key"; mockWallet = {} as unknown as jest.Mocked; + jest.spyOn(Wallet, "create").mockResolvedValue(mockWallet); }); describe("initialization", () => { it("should successfully init with env", async () => { - const options = { - wallet: mockWallet, - }; - + const options = {}; await expect(CdpAgentkit.configureWithWallet(options)).resolves.toBeDefined(); }); @@ -33,7 +31,6 @@ describe("CdpToolkit", () => { const options = { cdpApiKeyName: "test-key", cdpApiKeyPrivateKey: "test-private-key", - wallet: mockWallet, }; process.env.CDP_API_KEY_NAME = ""; @@ -42,14 +39,6 @@ describe("CdpToolkit", () => { await expect(CdpAgentkit.configureWithWallet(options)).resolves.toBeDefined(); }); - it("should successfully init with wallet", async () => { - const options = { - wallet: mockWallet, - }; - - await expect(CdpAgentkit.configureWithWallet(options)).resolves.toBeDefined(); - }); - it("should successfully init with wallet data", async () => { const options = { cdpWalletData: "{}", @@ -61,9 +50,7 @@ describe("CdpToolkit", () => { }); it("should fail init without env", async () => { - const options = { - wallet: mockWallet, - }; + const options = {}; process.env.CDP_API_KEY_NAME = ""; process.env.CDP_API_KEY_PRIVATE_KEY = ""; @@ -76,7 +63,6 @@ describe("CdpToolkit", () => { const options = { cdpApiKeyName: "test-key", cdpApiKeyPrivateKey: "test-private-key", - wallet: mockWallet, }; const agentkit = await CdpAgentkit.configureWithWallet(options); diff --git a/package-lock.json b/package-lock.json index ceb9663..41f1046 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,6 +68,7 @@ "version": "0.0.7", "dependencies": { "@coinbase/cdp-agentkit-core": "file:../cdp-agentkit-core", + "@coinbase/coinbase-sdk": "^0.11.0", "@langchain/core": "^0.3.19", "zod": "^3.22.4" },