Skip to content
Snippets Groups Projects
Commit b0550271 authored by Svyatoslav Nikolsky's avatar Svyatoslav Nikolsky Committed by Bastian Köcher
Browse files

Add missing RPC required for relay (#57)

* add missing RPC required for relay

* cargo fmt --all
parent 1da78b8a
Branches
No related merge requests found
......@@ -12,6 +12,7 @@ name = "bridge-node"
[dependencies]
futures = "0.3.1"
jsonrpc-core = "14.0.3"
log = "0.4.8"
structopt = "0.3.12"
bridge-node-runtime = { version = "0.1.0", path = "../runtime" }
......@@ -22,6 +23,11 @@ version = "0.8.0-alpha.2"
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
git = "https://github.com/paritytech/substrate.git"
[dependencies.sc-rpc]
version = "2.0.0-alpha.2"
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
git = "https://github.com/paritytech/substrate.git"
[dependencies.sp-core]
version = "2.0.0-alpha.2"
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
......@@ -99,6 +105,11 @@ version = "0.8.0-alpha.2"
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
git = "https://github.com/paritytech/substrate.git"
[dependencies.substrate-frame-rpc-system]
version = "2.0.0-alpha.2"
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
git = "https://github.com/paritytech/substrate.git"
[build-dependencies]
vergen = "3.1.0"
......
......@@ -80,6 +80,16 @@ macro_rules! new_full_start {
import_setup = Some((grandpa_block_import, grandpa_link));
Ok(import_queue)
})?
.with_rpc_extensions(|builder| -> Result<jsonrpc_core::IoHandler<sc_rpc::Metadata>, _> {
use substrate_frame_rpc_system::{FullSystem, SystemApi};
let mut io = jsonrpc_core::IoHandler::default();
io.extend_with(SystemApi::to_delegate(FullSystem::new(
builder.client().clone(),
builder.pool(),
)));
Ok(io)
})?;
(builder, import_setup, inherent_data_providers)
......
......@@ -65,6 +65,12 @@ default-features = false
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
git = "https://github.com/paritytech/substrate/"
[dependencies.frame-system-rpc-runtime-api]
version = "2.0.0-alpha.2"
default-features = false
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
git = "https://github.com/paritytech/substrate/"
[dependencies.pallet-timestamp]
version = "2.0.0-alpha.2"
default-features = false
......@@ -177,6 +183,7 @@ std = [
"frame-executive/std",
"frame-support/std",
"frame-system/std",
"frame-system-rpc-runtime-api/std",
"pallet-grandpa/std",
"pallet-randomness-collective-flip/std",
"serde",
......
......@@ -330,6 +330,12 @@ impl_runtime_apis! {
}
}
impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {
fn account_nonce(account: AccountId) -> Index {
System::account_nonce(account)
}
}
impl sp_bridge_eth_poa::EthereumHeadersApi<Block> for Runtime {
fn best_block() -> (u64, sp_bridge_eth_poa::H256) {
BridgeEthPoA::best_block()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment