-
Notifications
You must be signed in to change notification settings - Fork 53
chore: Migrate to using factory methods #523
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
Open
tysonclugg
wants to merge
5
commits into
ChainSafe:master
Choose a base branch
from
tysonclugg:chore/floodsub-factory
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 tasks
achingbrain
previously approved these changes
Jun 3, 2025
I think you need to update the lockfile. |
@tysonclugg can you regenerate the lockfile to fix the CI failures? |
Required since libp2p/js-libp2p#2717 landed which no longer exports `FloodSub` from `@libp2p/floodsub`.
Use the `gossipsub` factory to resolve this error: ``` npm run test > @chainsafe/[email protected] pretest > npm run build > @chainsafe/[email protected] build > aegir build [14:34:08] tsc [started] test/utils/create-pubsub.ts:53:22 - error TS2351: This expression is not constructable. Not all constituents of type '((init?: FloodSubInit | undefined) => (components: FloodSubComponents) => PubSub<PubSubEvents>) | typeof GossipSub' are constructable. Type '(init?: FloodSubInit | undefined) => (components: FloodSubComponents) => PubSub<PubSubEvents>' has no construct signatures. 53 const pubsub = new Ctor(components, opts.init) as GossipSub ~~~~ Found 1 error in test/utils/create-pubsub.ts:53 ```
Resolves errors like below from running `pnpm install`: ``` test/utils/create-pubsub.ts:7:10 - error TS2724: '"@libp2p/peer-store"' has no exported member named 'PersistentPeerStore'. Did you mean 'persistentPeerStore'? 7 import { PersistentPeerStore } from '@libp2p/peer-store' ~~~~~~~~~~~~~~~~~~~ node_modules/.pnpm/@libp2p[email protected]/node_modules/@libp2p/peer-store/dist/src/index.d.ts:46:25 46 export declare function persistentPeerStore(components: PersistentPeerStoreComponents, init?: PersistentPeerStoreInit): PeerStore; ~~~~~~~~~~~~~~~~~~~ 'persistentPeerStore' is declared here. ```
730133e
to
4f0257f
Compare
@achingbrain Tests passing locally, ready for review. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Required since things like libp2p/js-libp2p#2717 landed which no longer exports
FloodSub
from@libp2p/floodsub
.