Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
6c49ad44
Commit
6c49ad44
authored
5 years ago
by
Pierre Krieger
Committed by
Tomasz Drwięga
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove the RPC helpers module (#3967)
parent
b8602aa5
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
substrate/core/rpc/src/helpers.rs
+0
-25
0 additions, 25 deletions
substrate/core/rpc/src/helpers.rs
substrate/core/rpc/src/lib.rs
+0
-1
0 additions, 1 deletion
substrate/core/rpc/src/lib.rs
substrate/core/rpc/src/state/state_full.rs
+1
-1
1 addition, 1 deletion
substrate/core/rpc/src/state/state_full.rs
with
1 addition
and
27 deletions
substrate/core/rpc/src/helpers.rs
deleted
100644 → 0
+
0
−
25
View file @
b8602aa5
// 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
),
}
}
This diff is collapsed.
Click to expand it.
substrate/core/rpc/src/lib.rs
+
0
−
1
View file @
6c49ad44
...
...
@@ -20,7 +20,6 @@
#![warn(missing_docs)]
mod
helpers
;
mod
metadata
;
pub
use
api
::
Subscriptions
;
...
...
This diff is collapsed.
Click to expand it.
substrate/core/rpc/src/state/state_full.rs
+
1
−
1
View file @
6c49ad44
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment