mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 10:01:17 +00:00
Remove the RPC helpers module (#3967)
This commit is contained in:
committed by
Tomasz Drwięga
parent
b8602aa58b
commit
6c49ad4438
@@ -1,25 +0,0 @@
|
||||
// Copyright 2018-2019 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Substrate.
|
||||
|
||||
// Substrate is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Substrate is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/// Unwraps the trailing parameter or falls back with the closure result.
|
||||
pub fn unwrap_or_else<F, H, E>(or_else: F, optional: Option<H>) -> Result<H, E> where
|
||||
F: FnOnce() -> Result<H, E>,
|
||||
{
|
||||
match optional.into() {
|
||||
None => or_else(),
|
||||
Some(x) => Ok(x),
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#![warn(missing_docs)]
|
||||
|
||||
mod helpers;
|
||||
mod metadata;
|
||||
|
||||
pub use api::Subscriptions;
|
||||
|
||||
@@ -77,7 +77,7 @@ impl<B, E, Block: BlockT, RA> FullState<B, E, Block, RA>
|
||||
|
||||
/// Returns given block hash or best block hash if None is passed.
|
||||
fn block_or_best(&self, hash: Option<Block::Hash>) -> ClientResult<Block::Hash> {
|
||||
crate::helpers::unwrap_or_else(|| Ok(self.client.info().chain.best_hash), hash)
|
||||
Ok(hash.unwrap_or_else(|| self.client.info().chain.best_hash))
|
||||
}
|
||||
|
||||
/// Splits the `query_storage` block range into 'filtered' and 'unfiltered' subranges.
|
||||
|
||||
Reference in New Issue
Block a user