mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-28 01:01:34 +00:00
feat(gossipsub): allow compiling for WASM
This modification removes deprecated dependency `wasm_timer` and enables wasm compatibility on the gossibsup protocol by simply substituting the `wasm_timer::Instant` with `instant::Instant`(which supports `fn checked_add`) and `wasm_timer::Interval` with `futures_ticker::Ticker`. Pull-Request: #3973.
This commit is contained in:
@ -20,13 +20,13 @@
|
||||
|
||||
//! Data structure for efficiently storing known back-off's when pruning peers.
|
||||
use crate::topic::TopicHash;
|
||||
use instant::Instant;
|
||||
use libp2p_identity::PeerId;
|
||||
use std::collections::{
|
||||
hash_map::{Entry, HashMap},
|
||||
HashSet,
|
||||
};
|
||||
use std::time::Duration;
|
||||
use wasm_timer::Instant;
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
struct HeartbeatIndex(usize);
|
||||
|
Reference in New Issue
Block a user