Skip to content

Commit

Permalink
Add MethodInterceptor, simplify hooks, add exports
Browse files Browse the repository at this point in the history
  • Loading branch information
ryangoree committed Dec 3, 2024
1 parent 71054fc commit 63ee6d2
Show file tree
Hide file tree
Showing 6 changed files with 235 additions and 244 deletions.
5 changes: 5 additions & 0 deletions .changeset/tender-bobcats-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@delvtech/drift": patch
---

Added hooks to `BaseClient` (and `Drift`) to add custom bahevior before or after adapter method calls.
3 changes: 2 additions & 1 deletion packages/drift/src/client/BaseClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { describe, expect, it, vi } from "vitest";

describe("BaseClient", () => {
describe("hooks", () => {
const adapter = new MockAdapter();
const abi = [] as Abi;
const adapter = new MockAdapter();
adapter.onGetChainId().resolves(0);

it("Calls getChainId hooks", async () => {
const client = new BaseClient({ adapter });
Expand Down
Loading

0 comments on commit 63ee6d2

Please sign in to comment.