This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Support account_nextIndex RPC.
#460
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4dc26d2
Use node-rpc extensions to support account_nextIndex.
tomusdrw b5e7698
Remove todo.
tomusdrw 4414b8f
Update lock.
tomusdrw cab077e
Merge branch 'master' into td-accounts-rpc
tomusdrw 2a2ee40
Use new srml_system_rpc crate.
tomusdrw 7070a21
Update to substrate=master
tomusdrw 1b1b424
Update lockfile.
tomusdrw 15a0149
Update to polkadot-master.
tomusdrw 7aad5bf
Merge branch 'master' into td-accounts-rpc
tomusdrw d6c190f
Apply suggestions from code review
tomusdrw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| [package] | ||
| name = "polkadot-rpc" | ||
| version = "0.6.0" | ||
| authors = ["Parity Technologies <admin@parity.io>"] | ||
| edition = "2018" | ||
|
|
||
| [dependencies] | ||
| client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } | ||
| jsonrpc-core = "13.2.0" | ||
| polkadot-primitives = { path = "../primitives" } | ||
| sr-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } | ||
| substrate-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } | ||
| transaction_pool = { package = "substrate-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } | ||
| srml-system-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| // Copyright 2019 Parity Technologies (UK) Ltd. | ||
| // This file is part of Polkadot. | ||
|
|
||
| // Polkadot 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. | ||
|
|
||
| // Polkadot 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 Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| //! Polkadot-specific RPCs implementation. | ||
|
|
||
| #![warn(missing_docs)] | ||
|
|
||
| use std::sync::Arc; | ||
|
|
||
| use polkadot_primitives::{Block, AccountId, Nonce}; | ||
| use sr_primitives::traits::ProvideRuntimeApi; | ||
| use transaction_pool::txpool::{ChainApi, Pool}; | ||
|
|
||
| /// A type representing all RPC extensions. | ||
| pub type RpcExtension = jsonrpc_core::IoHandler<substrate_rpc::Metadata>; | ||
|
|
||
| /// Instantiate all RPC extensions. | ||
| pub fn create<C, P>(client: Arc<C>, pool: Arc<Pool<P>>) -> RpcExtension where | ||
| C: ProvideRuntimeApi, | ||
| C: client::blockchain::HeaderBackend<Block>, | ||
| C: Send + Sync + 'static, | ||
| C::Api: srml_system_rpc::AccountNonceApi<Block, AccountId, Nonce>, | ||
| P: ChainApi + Sync + Send + 'static, | ||
| { | ||
| use srml_system_rpc::{System, SystemApi}; | ||
|
|
||
| let mut io = jsonrpc_core::IoHandler::default(); | ||
| io.extend_with( | ||
| SystemApi::to_delegate(System::new(client.clone(), pool)) | ||
| ); | ||
| io | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.