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

fix: @helia/verified-fetch init args are optional #412

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

achingbrain
Copy link
Member

To allow no-option, all-defaults construction of verified fetch

import { createVerifiedFetch } from '@helia/verified-fetch'

const fetch = await createVerifiedFetch()

const resp = await fetch('ipfs://bafy...')
// ...

To allow no-option, all-defaults construction of verified fetch

```TypeScript
import { createVerifiedFetch } from '@helia/verified-fetch'

const fetch = await createVerifiedFetch()

const resp = await fetch('ipfs://bafy...')
// ...
```
@achingbrain achingbrain requested a review from a team as a code owner February 2, 2024 15:51
if (!isHelia(init)) {
init = await createHeliaHTTP({
blockBrokers: [
trustlessGateway({
gateways: init.gateways
gateways: init?.gateways
Copy link
Member

Choose a reason for hiding this comment

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

just confirming for myself. if gateways is null, should be set to defaults via

this.gateways = (init.gateways ?? DEFAULT_TRUSTLESS_GATEWAYS)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, the routers don't work in quite the same way though maybe they should.

@SgtPooki SgtPooki changed the title fix: make @helia/verified-fetch init args optional fix: @helia/verified-fetch init args are optional Feb 2, 2024
@SgtPooki SgtPooki merged commit 8a5bc6f into main Feb 2, 2024
19 checks passed
@SgtPooki SgtPooki deleted the fix/make-verified-fetch-init-optional branch February 2, 2024 18:06
@achingbrain achingbrain mentioned this pull request Feb 2, 2024
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