feat: allow sent messages seen as subscribed (#1520)

* feat: allow sent messages seen as subscribed

minor feature to allow mimicing the behaviour expected by ipfs api tests.

* refactor: rename per review comments

* refactor: rename Floodsub::options to config

* chore: update changelog

* Update CHANGELOG.md

Co-Authored-By: Max Inden <mail@max-inden.de>

Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
Joonas Koivunen
2020-04-09 16:15:17 +03:00
committed by GitHub
parent c1191d5f83
commit 80ea2f6fd7
4 changed files with 46 additions and 14 deletions

View File

@ -27,16 +27,16 @@ use futures::{Future, io::{AsyncRead, AsyncWrite}};
/// Implementation of `ConnectionUpgrade` for the floodsub protocol.
#[derive(Debug, Clone, Default)]
pub struct FloodsubConfig {}
pub struct FloodsubProtocol {}
impl FloodsubConfig {
/// Builds a new `FloodsubConfig`.
pub fn new() -> FloodsubConfig {
FloodsubConfig {}
impl FloodsubProtocol {
/// Builds a new `FloodsubProtocol`.
pub fn new() -> FloodsubProtocol {
FloodsubProtocol {}
}
}
impl UpgradeInfo for FloodsubConfig {
impl UpgradeInfo for FloodsubProtocol {
type Info = &'static [u8];
type InfoIter = iter::Once<Self::Info>;
@ -45,7 +45,7 @@ impl UpgradeInfo for FloodsubConfig {
}
}
impl<TSocket> InboundUpgrade<TSocket> for FloodsubConfig
impl<TSocket> InboundUpgrade<TSocket> for FloodsubProtocol
where
TSocket: AsyncRead + AsyncWrite + Send + Unpin + 'static,
{