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

bitswap: add missing client options to exchange #597

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The following emojis are used to highlight certain changes:
### Fixed

- 🛠️`routing/http/server`: delegated peer routing endpoint now supports both [PeerID string notaitons from libp2p specs](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md#string-representation).
- `bitswap`: add missing client `WithBlockReceivedNotifier` and `WithoutDuplicatedBlockStats` options to the exchange.

### Security

Expand Down
8 changes: 8 additions & 0 deletions bitswap/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@
return Option{client.SetSimulateDontHavesOnTimeout(send)}
}

func WithBlockReceivedNotifier(brn client.BlockReceivedNotifier) Option {
return Option{client.WithBlockReceivedNotifier(brn)}

Check warning on line 83 in bitswap/options.go

View check run for this annotation

Codecov / codecov/patch

bitswap/options.go#L82-L83

Added lines #L82 - L83 were not covered by tests
}

func WithoutDuplicatedBlockStats() Option {
return Option{client.WithoutDuplicatedBlockStats()}

Check warning on line 87 in bitswap/options.go

View check run for this annotation

Codecov / codecov/patch

bitswap/options.go#L86-L87

Added lines #L86 - L87 were not covered by tests
}

func WithTracer(tap tracer.Tracer) Option {
// Only trace the server, both receive the same messages anyway
return Option{
Expand Down
Loading