mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-25 02:25:51 +00:00
Remove retain_mut crate (#11926)
* Remove retain_mut crate * Remove reain_mut crate from babe-consensus
This commit is contained in:
Generated
-8
@@ -7446,12 +7446,6 @@ dependencies = [
|
|||||||
"quick-error 1.2.3",
|
"quick-error 1.2.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "retain_mut"
|
|
||||||
version = "0.1.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "448296241d034b96c11173591deaa1302f2c17b56092106c1f92c1bc0183a8c9"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rfc6979"
|
name = "rfc6979"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -7965,7 +7959,6 @@ dependencies = [
|
|||||||
"parking_lot 0.12.0",
|
"parking_lot 0.12.0",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"rand_chacha 0.2.2",
|
"rand_chacha 0.2.2",
|
||||||
"retain_mut",
|
|
||||||
"sc-block-builder",
|
"sc-block-builder",
|
||||||
"sc-client-api",
|
"sc-client-api",
|
||||||
"sc-consensus",
|
"sc-consensus",
|
||||||
@@ -8877,7 +8870,6 @@ dependencies = [
|
|||||||
"parity-scale-codec",
|
"parity-scale-codec",
|
||||||
"parity-util-mem",
|
"parity-util-mem",
|
||||||
"parking_lot 0.12.0",
|
"parking_lot 0.12.0",
|
||||||
"retain_mut",
|
|
||||||
"sc-block-builder",
|
"sc-block-builder",
|
||||||
"sc-client-api",
|
"sc-client-api",
|
||||||
"sc-transaction-pool-api",
|
"sc-transaction-pool-api",
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ num-rational = "0.2.2"
|
|||||||
num-traits = "0.2.8"
|
num-traits = "0.2.8"
|
||||||
parking_lot = "0.12.0"
|
parking_lot = "0.12.0"
|
||||||
rand = "0.7.2"
|
rand = "0.7.2"
|
||||||
retain_mut = "0.1.4"
|
|
||||||
schnorrkel = { version = "0.9.1", features = ["preaudit_deprecated"] }
|
schnorrkel = { version = "0.9.1", features = ["preaudit_deprecated"] }
|
||||||
serde = { version = "1.0.136", features = ["derive"] }
|
serde = { version = "1.0.136", features = ["derive"] }
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ use futures::{
|
|||||||
use log::{debug, info, log, trace, warn};
|
use log::{debug, info, log, trace, warn};
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use prometheus_endpoint::Registry;
|
use prometheus_endpoint::Registry;
|
||||||
use retain_mut::RetainMut;
|
|
||||||
use schnorrkel::SignatureError;
|
use schnorrkel::SignatureError;
|
||||||
|
|
||||||
use sc_client_api::{
|
use sc_client_api::{
|
||||||
@@ -835,17 +834,16 @@ where
|
|||||||
slot: Slot,
|
slot: Slot,
|
||||||
epoch_descriptor: &ViableEpochDescriptor<B::Hash, NumberFor<B>, Epoch>,
|
epoch_descriptor: &ViableEpochDescriptor<B::Hash, NumberFor<B>, Epoch>,
|
||||||
) {
|
) {
|
||||||
RetainMut::retain_mut(&mut *self.slot_notification_sinks.lock(), |sink| {
|
let sinks = &mut self.slot_notification_sinks.lock();
|
||||||
match sink.try_send((slot, epoch_descriptor.clone())) {
|
sinks.retain_mut(|sink| match sink.try_send((slot, epoch_descriptor.clone())) {
|
||||||
Ok(()) => true,
|
Ok(()) => true,
|
||||||
Err(e) =>
|
Err(e) =>
|
||||||
if e.is_full() {
|
if e.is_full() {
|
||||||
warn!(target: "babe", "Trying to notify a slot but the channel is full");
|
warn!(target: "babe", "Trying to notify a slot but the channel is full");
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
},
|
},
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ linked-hash-map = "0.5.4"
|
|||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
parity-util-mem = { version = "0.11.0", default-features = false, features = ["primitive-types"] }
|
parity-util-mem = { version = "0.11.0", default-features = false, features = ["primitive-types"] }
|
||||||
parking_lot = "0.12.0"
|
parking_lot = "0.12.0"
|
||||||
retain_mut = "0.1.4"
|
|
||||||
serde = { version = "1.0.136", features = ["derive"] }
|
serde = { version = "1.0.136", features = ["derive"] }
|
||||||
thiserror = "1.0.30"
|
thiserror = "1.0.30"
|
||||||
prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", path = "../../utils/prometheus" }
|
prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", path = "../../utils/prometheus" }
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ use std::{
|
|||||||
|
|
||||||
use futures::channel::mpsc::{channel, Sender};
|
use futures::channel::mpsc::{channel, Sender};
|
||||||
use parking_lot::{Mutex, RwLock};
|
use parking_lot::{Mutex, RwLock};
|
||||||
use retain_mut::RetainMut;
|
|
||||||
use sc_transaction_pool_api::{error, PoolStatus, ReadyTransactions};
|
use sc_transaction_pool_api::{error, PoolStatus, ReadyTransactions};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
@@ -204,21 +203,20 @@ impl<B: ChainApi> ValidatedPool<B> {
|
|||||||
let imported = self.pool.write().import(tx)?;
|
let imported = self.pool.write().import(tx)?;
|
||||||
|
|
||||||
if let base::Imported::Ready { ref hash, .. } = imported {
|
if let base::Imported::Ready { ref hash, .. } = imported {
|
||||||
RetainMut::retain_mut(&mut *self.import_notification_sinks.lock(), |sink| {
|
let sinks = &mut self.import_notification_sinks.lock();
|
||||||
match sink.try_send(*hash) {
|
sinks.retain_mut(|sink| match sink.try_send(*hash) {
|
||||||
Ok(()) => true,
|
Ok(()) => true,
|
||||||
Err(e) =>
|
Err(e) =>
|
||||||
if e.is_full() {
|
if e.is_full() {
|
||||||
log::warn!(
|
log::warn!(
|
||||||
target: "txpool",
|
target: "txpool",
|
||||||
"[{:?}] Trying to notify an import but the channel is full",
|
"[{:?}] Trying to notify an import but the channel is full",
|
||||||
hash,
|
hash,
|
||||||
);
|
);
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
},
|
},
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user