Skip to content

Commit

Permalink
improve(adapters): swap zksync adapter with generic adapter (#1735)
Browse files Browse the repository at this point in the history
* improve(adapters): swap zksync adapter to generic adapter

Signed-off-by: bennett <[email protected]>

---------

Signed-off-by: bennett <[email protected]>
  • Loading branch information
bmzig authored Aug 21, 2024
1 parent 4259756 commit c67af30
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 927 deletions.
6 changes: 5 additions & 1 deletion src/adapter/bridges/ZKSyncBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@ export class ZKSyncBridge extends BaseBridgeAdapter {
this.getL1Bridge().filters.DepositInitiated(undefined, fromAddress, toAddress),
eventConfig
);

const filteredEvents = events.filter(({ args }) => args.l1Token === l1Token);
return {
[this.resolveL2TokenAddress(l1Token)]: events.map((event) => processEvent(event, "_amount", "_to", "from")),
[this.resolveL2TokenAddress(l1Token)]: filteredEvents.map((event) =>
processEvent(event, "_amount", "_to", "from")
),
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/adapter/bridges/ZKSyncWethBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class ZKSyncWethBridge extends BaseBridgeAdapter {
);
}
return {
[this.resolveL2TokenAddress(l1Token)]: events.map((event) => processEvent(event, "amount", "_to", "_from")),
[this.resolveL2TokenAddress(l1Token)]: events.map((event) => processEvent(event, "_amount", "_to", "from")),
};
}

Expand Down
Loading

0 comments on commit c67af30

Please sign in to comment.