Skip to content

Commit

Permalink
chore: fix deps
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Apr 3, 2024
1 parent 044e38a commit 88c900d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/car/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@
"@helia/interface": "^4.0.0",
"@ipld/car": "^5.2.6",
"@libp2p/interfaces": "^3.3.2",
"interface-blockstore": "^5.2.9",
"it-drain": "^3.0.5",
"it-map": "^3.0.5",
"multiformats": "^13.0.1",
Expand All @@ -155,6 +154,7 @@
"@ipld/dag-pb": "^4.0.8",
"aegir": "^42.2.2",
"blockstore-core": "^4.4.0",
"interface-blockstore": "^5.2.9",
"ipfs-unixfs-importer": "^15.2.4",
"it-to-buffer": "^4.0.5"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export class Helia implements HeliaInterface {
return fn(components)
})

const networkedStorage = new NetworkedStorage(components, this.getHasher)
const networkedStorage = new NetworkedStorage(components)

this.pins = new PinsImpl(init.datastore, networkedStorage, this.getCodec)

Expand Down
5 changes: 3 additions & 2 deletions packages/utils/src/utils/networked-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface NetworkedStorageComponents {
logger: ComponentLogger
blockBrokers?: BlockBroker[]
hashers?: Record<number, MultihashHasher>
getHasher: HasherLoader
}

/**
Expand All @@ -49,15 +50,15 @@ export class NetworkedStorage implements Blocks, Startable {
/**
* Create a new BlockStorage
*/
constructor (components: NetworkedStorageComponents, getHasher: HasherLoader) {
constructor (components: NetworkedStorageComponents) {
this.log = components.logger.forComponent('helia:networked-storage')
this.child = new TieredBlockstore([
new IdentityBlockstore(),
components.blockstore
])
this.blockRetrievers = (components.blockBrokers ?? []).filter(isBlockRetriever)
this.blockAnnouncers = (components.blockBrokers ?? []).filter(isBlockAnnouncer)
this.getHasher = getHasher
this.getHasher = components.getHasher
this.started = false
}

Expand Down
10 changes: 6 additions & 4 deletions packages/utils/test/block-broker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ describe('block-broker', () => {
blockBrokers: [
bitswapBlockBroker,
gatewayBlockBroker
]
}, getHasher())
],
getHasher: getHasher()
})
})

afterEach(async () => {
Expand Down Expand Up @@ -126,8 +127,9 @@ describe('block-broker', () => {
logger: defaultLogger(),
blockBrokers: [
gatewayBlockBroker
]
}, getHasher())
],
getHasher: getHasher()
})

gatewayBlockBroker.retrieve.withArgs(cid, Sinon.match.any).resolves(block)

Expand Down
5 changes: 3 additions & 2 deletions packages/utils/test/utils/networked-storage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ describe('networked-storage', () => {
logger: defaultLogger(),
blockBrokers: [
bitswap
]
}, getHasher())
],
getHasher: getHasher()
})
})

it('gets a block from the blockstore', async () => {
Expand Down

0 comments on commit 88c900d

Please sign in to comment.