Skip to content

Commit 5f0d2f7

Browse files
committed
Refactor injection token definitions to use dynamic property keys
1 parent 2d5ca04 commit 5f0d2f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/protocol/src/protocol/Protocol.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ import { ProtocolEnvironment } from "./ProtocolEnvironment";
2828
import { ProvableBlockHook } from "./ProvableBlockHook";
2929

3030
const PROTOCOL_INJECTION_TOKENS: Record<string, string> = {
31-
ProvableTransactionHook: "ProvableTransactionHook",
32-
ProvableBlockHook: "ProvableBlockHook",
33-
ProvableSettlementHook: "ProvableSettlementHook",
31+
[ProvableTransactionHook.name]: "ProvableTransactionHook",
32+
[ProvableBlockHook.name]: "ProvableBlockHook",
33+
[ProvableSettlementHook.name]: "ProvableSettlementHook",
3434
};
3535

3636
export type ProtocolModulesRecord = ModulesRecord<
@@ -161,7 +161,7 @@ export class Protocol<
161161

162162
implementingModules.forEach(([key]) => {
163163
this.container.register(
164-
abstractType.name,
164+
newInjectionToken,
165165
{ useToken: key },
166166
{ lifecycle: Lifecycle.ContainerScoped }
167167
);
@@ -174,7 +174,7 @@ export class Protocol<
174174

175175
// Register default (noop) version
176176
this.container.register(
177-
abstractType.name,
177+
newInjectionToken,
178178
{ useClass: defaultType },
179179
{ lifecycle: Lifecycle.ContainerScoped }
180180
);

0 commit comments

Comments
 (0)