Skip to content

Commit

Permalink
fix: save strategy address on Pool Created (#41)
Browse files Browse the repository at this point in the history
## Description

Fixes Orchestrator code, where we have to save the strategy contract
address, not the srcAddress of the event (which is Allo contract)

## Checklist before requesting a review

-   [x] I have conducted a self-review of my code.
-   [x] I have conducted a QA.
-   [x] If it is a core feature, I have included comprehensive tests.
  • Loading branch information
0xnigir1 authored Dec 16, 2024
1 parent 79f4681 commit eb7e1c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/data-flow/src/orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class Orchestrator {
const handleable = existsHandler(event.strategyId);
await this.strategyRegistry.saveStrategyId(
this.chainId,
event.srcAddress,
event.params.strategy,
event.strategyId,
handleable,
);
Expand Down
6 changes: 3 additions & 3 deletions packages/data-flow/test/unit/orchestrator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ describe("Orchestrator", { sequential: true }, () => {
});

it("save strategyId to registry on PoolCreated event", async () => {
const strategyAddress = "0x123" as Address;
const strategyAddress = "0xff212432" as Address;
const strategyId = "0xunknown" as Hex;
const existingStrategyId =
"0x6f9291df02b2664139cec5703c124e4ebce32879c74b6297faa1468aa5ff9ebf" as Hex;
Expand Down Expand Up @@ -314,14 +314,14 @@ describe("Orchestrator", { sequential: true }, () => {
expect(mockStrategyRegistry.saveStrategyId).toHaveBeenNthCalledWith(
1,
chainId,
strategyAddress,
mockEvent.params.strategy,
strategyId,
false,
);
expect(mockStrategyRegistry.saveStrategyId).toHaveBeenNthCalledWith(
2,
chainId,
strategyAddress,
mockEvent.params.strategy,
existingStrategyId,
true,
);
Expand Down

0 comments on commit eb7e1c3

Please sign in to comment.