Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiered DI #52

Merged
merged 12 commits into from
Oct 23, 2023
Merged

Tiered DI #52

merged 12 commits into from
Oct 23, 2023

Conversation

rpanic
Copy link
Member

@rpanic rpanic commented Oct 3, 2023

No description provided.

@rpanic rpanic changed the title Tiered DI draft: Tiered DI Oct 3, 2023
@rpanic rpanic changed the title draft: Tiered DI Tiered DI Oct 12, 2023
# Conflicts:
#	packages/module/test/state/MockAsyncMerkleStore.ts
#	packages/sdk/test/appChain/AppChain.test.ts
framework.iml Show resolved Hide resolved
packages/common/src/config/ChildContainerStartable.ts Outdated Show resolved Hide resolved

// eslint-disable-next-line @typescript-eslint/no-unused-vars
public create(childContainerProvider: ChildContainerProvider): void {
noop();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling @typescript-eslint/no-empty-function for this line would be nicer than noop()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok but then why do we have this rule when we don't want the thing that the rule forces us to do?

@@ -40,7 +48,9 @@ const errors = {
export const ModuleContainerErrors = errors;

// determines that a module should be configurable by default
export type BaseModuleType = TypedClass<Configurable<unknown>>;
export type BaseModuleType = TypedClass<
ChildContainerStartable & Configurable<unknown>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if we did a merged interface for this joint type and used it in ConfigurableModule implements ... as well

@@ -148,6 +161,16 @@ export class ModuleContainer<
}
}

public assertContainerInitialized(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably start avoiding in-class assertion methods since we've learned recently they dont work outside of classes/instances themselves. But out of scope here.

this.protocol.registerValue({
Runtime: this.runtime,
});
// These three statements are crucial for dependencies inside any of these
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be a multiline comment instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no there's a eslint rule against that

packages/sdk/src/appChain/AreProofsEnabledFactory.ts Outdated Show resolved Hide resolved
packages/sdk/src/appChain/TestingAppChain.ts Show resolved Hide resolved
@@ -31,7 +35,9 @@ export class LocalTaskQueue implements TaskQueue {
[key: string]: QueueListener[];
} = {};

public constructor(private readonly simulatedDuration?: number) {}
public constructor() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably can be removed all together

@@ -253,7 +261,7 @@ describe("block production", () => {

const numberTxs = 3;

it("should produce block with multiple transaction", async () => {
it.only("should produce block with multiple transaction", async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explained that in a previous PR, we can't execute multiple tests at once rn.
Maybe that has changed now though?

@maht0rz maht0rz merged commit f40c97f into develop Oct 23, 2023
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants