mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
core/network: Remove self mutability on put and get value (#3118)
Make `NetworkService.{get,put}_value` only take a self reference instead
of a mutable self reference. When retrieving `NetworkService` via
`NetworkWorker`, one only gets an immutable reference.
This commit is contained in:
@@ -442,7 +442,7 @@ impl<B: BlockT + 'static, S: NetworkSpecialization<B>, H: ExHashT> NetworkServic
|
||||
///
|
||||
/// This will generate either a `ValueFound` or a `ValueNotFound` event and pass it to
|
||||
/// `on_event` on the network specialization.
|
||||
pub fn get_value(&mut self, key: &Multihash) {
|
||||
pub fn get_value(&self, key: &Multihash) {
|
||||
let _ = self
|
||||
.to_worker
|
||||
.unbounded_send(ServerToWorkerMsg::GetValue(key.clone()));
|
||||
@@ -452,7 +452,7 @@ impl<B: BlockT + 'static, S: NetworkSpecialization<B>, H: ExHashT> NetworkServic
|
||||
///
|
||||
/// This will generate either a `ValuePut` or a `ValuePutFailed` event and pass it to
|
||||
/// `on_event` on the network specialization.
|
||||
pub fn put_value(&mut self, key: Multihash, value: Vec<u8>) {
|
||||
pub fn put_value(&self, key: Multihash, value: Vec<u8>) {
|
||||
let _ = self
|
||||
.to_worker
|
||||
.unbounded_send(ServerToWorkerMsg::PutValue(key, value));
|
||||
@@ -643,7 +643,7 @@ struct NetworkLink<'a, B: BlockT, S: NetworkSpecialization<B>, H: ExHashT> {
|
||||
|
||||
impl<'a, B: BlockT, S: NetworkSpecialization<B>, H: ExHashT> Link<B> for NetworkLink<'a, B, S, H> {
|
||||
fn blocks_processed(
|
||||
&mut self,
|
||||
&mut self,
|
||||
imported: usize,
|
||||
count: usize,
|
||||
results: Vec<(Result<BlockImportResult<NumberFor<B>>, BlockImportError>, B::Hash)>
|
||||
|
||||
Reference in New Issue
Block a user