Commit 52385492 authored by joe petrowski's avatar joe petrowski Committed by Gavin Wood
Browse files

Update for Substrate master (#600)

* update substrate for change to palette

* change paint to palette

* update lock

* Fix missing import

* change to polkadot-master

* Use same commit hash of parity-common

* Resolve linking errors

* Rename to frame

* bump spec

* Subsume #602 and #596

* Fix DispatchInfo

* Merge `futures03` and `joe-update-to-palette` (#606)

* Change repo and branch

* Made changes

* Bumped async-std version

* Fix line width

* Bump spec_version

* Fix `run_to_block` for Crowdfund module (#603)

Probably a copy paste error.

* Bump dependencies

* Update trie-db to be inline with substrate

* Fix documentation warning

* Fix test compilation
parent 53c80e88
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -11,7 +11,7 @@ edition = "2018"
[dependencies]
cli = { package = "polkadot-cli", path = "cli" }
futures = "0.1.29"
futures = "0.3.1"
ctrlc = { version = "3.1.3", features = ["termination"] }
service = { package = "polkadot-service", path = "service" }
......@@ -47,3 +47,6 @@ maintenance = { status = "actively-developed" }
[profile.release]
# Polkadot runtime requires unwinding.
panic = "unwind"
[patch.crates-io]
zstd-sys = { git = "https://github.com/bkchr/zstd-rs.git", branch = "bkchr-export-include-paths2" }
......@@ -11,6 +11,6 @@ parking_lot = "0.9.0"
log = "0.4.8"
codec = { package = "parity-scale-codec", version = "1.1.0", default-features = false, features = ["derive"] }
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
kvdb = { git = "https://github.com/paritytech/parity-common", rev="616b40150ded71f57f650067fcbc5c99d7c343e6" }
kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common", rev="616b40150ded71f57f650067fcbc5c99d7c343e6" }
kvdb-memorydb = { git = "https://github.com/paritytech/parity-common", rev="616b40150ded71f57f650067fcbc5c99d7c343e6" }
kvdb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" }
kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" }
kvdb-memorydb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" }
......@@ -8,8 +8,8 @@ edition = "2018"
[dependencies]
log = "0.4.8"
tokio = "0.1.22"
futures = "0.1.29"
exit-future = "0.1.4"
futures = { version = "0.3.1", features = ["compat"] }
futures01 = { package = "futures", version = "0.1.29" }
structopt = "0.3.4"
cli = { package = "substrate-cli", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
service = { package = "polkadot-service", path = "../service" }
......
......@@ -22,7 +22,7 @@
mod chain_spec;
use chain_spec::ChainSpec;
use futures::Future;
use futures::{Future, FutureExt, TryFutureExt, future::select, channel::oneshot, compat::Future01CompatExt};
use tokio::runtime::Runtime;
use std::sync::Arc;
use log::{info, error};
......@@ -36,8 +36,9 @@ pub use service::{
pub use cli::{VersionInfo, IntoExit, NoCustom};
pub use cli::{display_role, error};
type BoxedFuture = Box<dyn futures01::Future<Item = (), Error = ()> + Send>;
/// Abstraction over an executor that lets you spawn tasks in the background.
pub type TaskExecutor = Arc<dyn futures::future::Executor<Box<dyn Future<Item = (), Error = ()> + Send>> + Send + Sync>;
pub type TaskExecutor = Arc<dyn futures01::future::Executor<BoxedFuture> + Send + Sync>;
fn load_spec(id: &str) -> Result<Option<service::ChainSpec>, String> {
Ok(match ChainSpec::from(id) {
......@@ -53,7 +54,7 @@ fn load_spec(id: &str) -> Result<Option<service::ChainSpec>, String> {
pub trait Worker: IntoExit {
/// A future that resolves when the work is done or the node should exit.
/// This will be run on a tokio runtime.
type Work: Future<Item=(),Error=()> + Send + 'static;
type Work: Future<Output=()> + Unpin + Send + 'static;
/// Return configuration for the polkadot node.
// TODO: make this the full configuration, so embedded nodes don't need
......@@ -143,20 +144,31 @@ fn run_until_exit<T, SC, B, CE, W>(
CE: service::CallExecutor<service::Block, service::Blake2Hasher> + Clone + Send + Sync + 'static,
W: Worker,
{
let (exit_send, exit) = exit_future::signal();
let (exit_send, exit) = oneshot::channel();
let executor = runtime.executor();
let informant = cli::informant::build(&service);
executor.spawn(exit.until(informant).map(|_| ()));
let future = select(exit, informant)
.map(|_| Ok(()))
.compat();
executor.spawn(future);
// we eagerly drop the service so that the internal exit future is fired,
// but we need to keep holding a reference to the global telemetry guard
let _telemetry = service.telemetry();
let work = worker.work(&service, Arc::new(executor));
let service = service.map_err(|err| error!("Error while running Service: {}", err));
let _ = runtime.block_on(service.select(work));
exit_send.fire();
let service = service
.map_err(|err| error!("Error while running Service: {}", err))
.compat();
let future = select(service, work)
.map(|_| Ok::<_, ()>(()))
.compat();
let _ = runtime.block_on(future);
let _ = exit_send.send(());
use futures01::Future;
// TODO [andre]: timeout this future substrate/#1318
let _ = runtime.shutdown_on_idle().wait();
......
......@@ -6,8 +6,8 @@ description = "Collator node implementation"
edition = "2018"
[dependencies]
futures = "0.1.29"
futures03 = { package = "futures-preview", version = "0.3.0-alpha.19", features = ["compat"] }
futures01 = { package = "futures", version = "0.1.17" }
futures = { version = "0.3.1", features = ["compat"] }
client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
client-api = { package = "substrate-client-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
......@@ -21,6 +21,7 @@ polkadot-validation = { path = "../validation" }
polkadot-service = { path = "../service" }
log = "0.4.8"
tokio = "0.1.22"
futures-timer = "1.0"
[dev-dependencies]
keyring = { package = "substrate-keyring", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
......@@ -49,8 +49,10 @@ use std::fmt;
use std::sync::Arc;
use std::time::Duration;
use futures::{future, Stream, Future, IntoFuture};
use futures03::{TryStreamExt as _, StreamExt as _};
use futures::{
future, Future, Stream, FutureExt, TryFutureExt, StreamExt,
compat::{Compat01As03, Future01CompatExt, Stream01CompatExt}
};
use log::{warn, error};
use client::BlockchainEvents;
use primitives::{Pair, Blake2Hasher};
......@@ -67,7 +69,6 @@ use polkadot_cli::{
use polkadot_network::validation::{LeafWorkParams, ValidationNetwork};
use polkadot_network::{PolkadotNetworkService, PolkadotProtocol};
use polkadot_runtime::RuntimeApi;
use tokio::timer::Timeout;
pub use polkadot_cli::{VersionInfo, TaskExecutor};
pub use polkadot_network::validation::Incoming;
......@@ -81,14 +82,14 @@ const COLLATION_TIMEOUT: Duration = Duration::from_secs(30);
pub trait Network: Send + Sync {
/// Convert the given `CollatorId` to a `PeerId`.
fn collator_id_to_peer_id(&self, collator_id: CollatorId) ->
Box<dyn Future<Item=Option<PeerId>, Error=()> + Send>;
Box<dyn Future<Output=Option<PeerId>> + Unpin + Send>;
/// Create a `Stream` of checked statements for the given `relay_parent`.
///
/// The returned stream will not terminate, so it is required to make sure that the stream is
/// dropped when it is not required anymore. Otherwise, it will stick around in memory
/// infinitely.
fn checked_statements(&self, relay_parent: Hash) -> Box<dyn Stream<Item=SignedStatement, Error=()>>;
fn checked_statements(&self, relay_parent: Hash) -> Box<dyn Stream<Item=SignedStatement>>;
}
impl<P, E> Network for ValidationNetwork<P, E, PolkadotNetworkService, TaskExecutor> where
......@@ -96,13 +97,21 @@ impl<P, E> Network for ValidationNetwork<P, E, PolkadotNetworkService, TaskExecu
E: 'static + Send + Sync,
{
fn collator_id_to_peer_id(&self, collator_id: CollatorId) ->
Box<dyn Future<Item=Option<PeerId>, Error=()> + Send>
Box<dyn Future<Output=Option<PeerId>> + Unpin + Send>
{
Box::new(Self::collator_id_to_peer_id(self, collator_id))
Box::new(
Self::collator_id_to_peer_id(self, collator_id)
.compat()
.map(|res| res.ok().and_then(|id| id))
)
}
fn checked_statements(&self, relay_parent: Hash) -> Box<dyn Stream<Item=SignedStatement, Error=()>> {
Box::new(Self::checked_statements(self, relay_parent))
fn checked_statements(&self, relay_parent: Hash) -> Box<dyn Stream<Item=SignedStatement>> {
Box::new(
Self::checked_statements(self, relay_parent)
.compat()
.filter_map(|item| future::ready(item.ok()))
)
}
}
......@@ -153,7 +162,7 @@ pub trait BuildParachainContext {
/// This can be implemented through an externally attached service or a stub.
/// This is expected to be a lightweight, shared type like an Arc.
pub trait ParachainContext: Clone {
type ProduceCandidate: IntoFuture<Item=(BlockData, HeadData, OutgoingMessages), Error=InvalidHead>;
type ProduceCandidate: Future<Output = Result<(BlockData, HeadData, OutgoingMessages), InvalidHead>>;
/// Produce a candidate, given the relay parent hash, the latest ingress queue information
/// and the last parachain head.
......@@ -173,14 +182,14 @@ pub trait RelayChainContext {
/// Future that resolves to the un-routed egress queues of a parachain.
/// The first item is the oldest.
type FutureEgress: IntoFuture<Item=ConsolidatedIngress, Error=Self::Error>;
type FutureEgress: Future<Output = Result<ConsolidatedIngress, Self::Error>>;
/// Get un-routed egress queues from a parachain to the local parachain.
fn unrouted_egress(&self, _id: ParaId) -> Self::FutureEgress;
}
/// Produce a candidate for the parachain, with given contexts, parent head, and signing key.
pub fn collate<'a, R, P>(
pub async fn collate<R, P>(
relay_parent: Hash,
local_id: ParaId,
parachain_status: ParachainStatus,
......@@ -188,53 +197,45 @@ pub fn collate<'a, R, P>(
mut para_context: P,
key: Arc<CollatorPair>,
)
-> impl Future<Item=(parachain::Collation, OutgoingMessages), Error=Error<R::Error>> + 'a
-> Result<(parachain::Collation, OutgoingMessages), Error<R::Error>>
where
R: RelayChainContext,
R::Error: 'a,
R::FutureEgress: 'a,
P: ParachainContext + 'a,
<P::ProduceCandidate as IntoFuture>::Future: Send,
P: ParachainContext,
P::ProduceCandidate: Send,
{
let ingress = relay_context.unrouted_egress(local_id).into_future().map_err(Error::Polkadot);
ingress
.and_then(move |ingress| {
para_context.produce_candidate(
relay_parent,
parachain_status,
ingress.0.iter().flat_map(|&(id, ref msgs)| msgs.iter().cloned().map(move |msg| (id, msg)))
)
.into_future()
.map(move |x| (ingress, x))
.map_err(Error::Collator)
})
.and_then(move |(ingress, (block_data, head_data, mut outgoing))| {
let block_data_hash = block_data.hash();
let signature = key.sign(block_data_hash.as_ref()).into();
let egress_queue_roots =
polkadot_validation::egress_roots(&mut outgoing.outgoing_messages);
let receipt = parachain::CandidateReceipt {
parachain_index: local_id,
collator: key.public(),
signature,
head_data,
egress_queue_roots,
fees: 0,
block_data_hash,
upward_messages: Vec::new(),
};
let collation = parachain::Collation {
receipt,
pov: PoVBlock {
block_data,
ingress,
},
};
Ok((collation, outgoing))
})
let ingress = relay_context.unrouted_egress(local_id).await.map_err(Error::Polkadot)?;
let (block_data, head_data, mut outgoing) = para_context.produce_candidate(
relay_parent,
parachain_status,
ingress.0.iter().flat_map(|&(id, ref msgs)| msgs.iter().cloned().map(move |msg| (id, msg)))
).map_err(Error::Collator).await?;
let block_data_hash = block_data.hash();
let signature = key.sign(block_data_hash.as_ref());
let egress_queue_roots =
polkadot_validation::egress_roots(&mut outgoing.outgoing_messages);
let receipt = parachain::CandidateReceipt {
parachain_index: local_id,
collator: key.public(),
signature,
head_data,
egress_queue_roots,
fees: 0,
block_data_hash,
upward_messages: Vec::new(),
};
let collation = parachain::Collation {
receipt,
pov: PoVBlock {
block_data,
ingress,
},
};
Ok((collation, outgoing))
}
/// Polkadot-api context.
......@@ -247,10 +248,10 @@ struct ApiContext<P, E> {
impl<P: 'static, E: 'static> RelayChainContext for ApiContext<P, E> where
P: ProvideRuntimeApi + Send + Sync,
P::Api: ParachainHost<Block>,
E: Future<Item=(),Error=()> + Clone + Send + Sync + 'static,
E: futures01::Future<Item=(),Error=()> + Clone + Send + Sync + 'static,
{
type Error = String;
type FutureEgress = Box<dyn Future<Item=ConsolidatedIngress, Error=String> + Send>;
type FutureEgress = Box<dyn Future<Output=Result<ConsolidatedIngress, String>> + Unpin + Send>;
fn unrouted_egress(&self, _id: ParaId) -> Self::FutureEgress {
// TODO: https://github.com/paritytech/polkadot/issues/253
......@@ -260,7 +261,9 @@ impl<P: 'static, E: 'static> RelayChainContext for ApiContext<P, E> where
local_session_key: None,
parent_hash: self.parent_hash,
authorities: self.validators.clone(),
}).map_err(|e| format!("unable to instantiate validation session: {:?}", e));
})
.compat()
.map_err(|e| format!("unable to instantiate validation session: {:?}", e));
Box::new(future::ok(ConsolidatedIngress(Vec::new())))
}
......@@ -274,27 +277,27 @@ struct CollationNode<P, E> {
}
impl<P, E> IntoExit for CollationNode<P, E> where
E: Future<Item=(),Error=()> + Send + 'static
E: futures01::Future<Item=(),Error=()> + Unpin + Send + 'static
{
type Exit = E;
type Exit = future::Map<Compat01As03<E>, fn (Result<(), ()>) -> ()>;
fn into_exit(self) -> Self::Exit {
self.exit
self.exit.compat().map(drop)
}
}
impl<P, E> Worker for CollationNode<P, E> where
P: BuildParachainContext + Send + 'static,
P::ParachainContext: Send + 'static,
<<P::ParachainContext as ParachainContext>::ProduceCandidate as IntoFuture>::Future: Send + 'static,
E: Future<Item=(), Error=()> + Clone + Send + Sync + 'static,
<P::ParachainContext as ParachainContext>::ProduceCandidate: Send + 'static,
E: futures01::Future<Item=(),Error=()> + Clone + Unpin + Send + Sync + 'static,
{
type Work = Box<dyn Future<Item=(), Error=()> + Send>;
type Work = Box<dyn Future<Output=()> + Unpin + Send>;
fn configuration(&self) -> CustomConfiguration {
let mut config = CustomConfiguration::default();
config.collating_for = Some((
self.key.public(),
self.para_id.clone(),
self.para_id,
));
config
}
......@@ -321,7 +324,7 @@ impl<P, E> Worker for CollationNode<P, E> where
select_chain
} else {
error!("The node cannot work because it can't select chain.");
return Box::new(future::err(()));
return Box::new(future::ready(()));
};
let is_known = move |block_hash: &Hash| {
......@@ -364,20 +367,18 @@ impl<P, E> Worker for CollationNode<P, E> where
Ok(ctx) => ctx,
Err(()) => {
error!("Could not build the parachain context!");
return Box::new(future::err(()))
return Box::new(future::ready(()))
}
};
let inner_exit = exit.clone();
let work = client.import_notification_stream()
.map(|v| Ok::<_, ()>(v))
.compat()
.for_each(move |notification| {
macro_rules! try_fr {
($e:expr) => {
match $e {
Ok(x) => x,
Err(e) => return future::Either::A(future::err(Error::Polkadot(
Err(e) => return future::Either::Left(future::err(Error::Polkadot(
format!("{:?}", e)
))),
}
......@@ -393,11 +394,11 @@ impl<P, E> Worker for CollationNode<P, E> where
let parachain_context = parachain_context.clone();
let validation_network = validation_network.clone();
let work = future::lazy(move || {
let work = future::lazy(move |_| {
let api = client.runtime_api();
let status = match try_fr!(api.parachain_status(&id, para_id)) {
Some(status) => status,
None => return future::Either::A(future::ok(())),
None => return future::Either::Left(future::ok(())),
};
let validators = try_fr!(api.validators(&id));
......@@ -421,7 +422,7 @@ impl<P, E> Worker for CollationNode<P, E> where
context,
parachain_context,
key,
).map(move |(collation, outgoing)| {
).map_ok(move |(collation, outgoing)| {
network.with_spec(move |spec, ctx| {
let res = spec.add_local_collation(
ctx,
......@@ -437,23 +438,36 @@ impl<P, E> Worker for CollationNode<P, E> where
})
});
future::Either::B(collation_work)
});
let deadlined = Timeout::new(work, COLLATION_TIMEOUT);
let silenced = deadlined.then(|res| match res {
Ok(()) => Ok(()),
Err(_) => {
warn!("Collation failure: timeout");
Ok(())
}
});
future::Either::Right(collation_work)
}).map(|_| Ok::<_, ()>(()));
tokio::spawn(silenced.select(inner_exit.clone()).then(|_| Ok(())));
Ok(())
let deadlined = future::select(
work,
futures_timer::Delay::new(COLLATION_TIMEOUT)
);
let silenced = deadlined
.map(|either| {
if let future::Either::Right(_) = either {
warn!("Collation failure: timeout");
}
});
let future = future::select(
silenced,
inner_exit.clone().map(|_| Ok::<_, ()>(())).compat()
).map(|_| Ok::<_, ()>(())).compat();
tokio::spawn(future);
future::ready(())
});
let work_and_exit = work.select(exit).then(|_| Ok(()));
Box::new(work_and_exit) as Box<_>
let work_and_exit = future::select(
work,
exit.map(|_| Ok::<_, ()>(())).compat()
).map(|_| ());
Box::new(work_and_exit)
}
}
......@@ -481,11 +495,10 @@ pub fn run_collator<P, E>(
) -> polkadot_cli::error::Result<()> where
P: BuildParachainContext + Send + 'static,
P::ParachainContext: Send + 'static,
<<P::ParachainContext as ParachainContext>::ProduceCandidate as IntoFuture>::Future: Send + 'static,
E: IntoFuture<Item=(), Error=()>,
E::Future: Send + Clone + Sync + 'static,
<P::ParachainContext as ParachainContext>::ProduceCandidate: Send + 'static,
E: futures01::Future<Item = (),Error=()> + Unpin + Send + Clone + Sync + 'static,
{
let node_logic = CollationNode { build_parachain_context, exit: exit.into_future(), para_id, key };
let node_logic = CollationNode { build_parachain_context, exit, para_id, key };
polkadot_cli::run(node_logic, version)
}
......@@ -503,12 +516,12 @@ mod tests {
impl RelayChainContext for DummyRelayChainContext {
type Error = ();
type FutureEgress = Box<dyn Future<Item=ConsolidatedIngress,Error=()>>;
type FutureEgress = Box<dyn Future<Output=Result<ConsolidatedIngress,()>> + Unpin>;
fn unrouted_egress(&self, para_id: ParaId) -> Self::FutureEgress {
match self.ingress.get(&para_id) {
Some(ingress) => Box::new(future::ok(ingress.clone())),
None => Box::new(future::empty()),
None => Box::new(future::pending()),
}
}
}
......@@ -517,16 +530,16 @@ mod tests {
struct DummyParachainContext;
impl ParachainContext for DummyParachainContext {
type ProduceCandidate = Result<(BlockData, HeadData, OutgoingMessages), InvalidHead>;
type ProduceCandidate = future::Ready<Result<(BlockData, HeadData, OutgoingMessages), InvalidHead>>;
fn produce_candidate<I: IntoIterator<Item=(ParaId, Message)>>(
&mut self,
_relay_parent: Hash,
_status: ParachainStatus,
ingress: I,
) -> Result<(BlockData, HeadData, OutgoingMessages), InvalidHead> {
) -> Self::ProduceCandidate {
// send messages right back.
Ok((
future::ok((
BlockData(vec![1, 2, 3, 4, 5,]),
HeadData(vec![9, 9, 9]),
OutgoingMessages {
......@@ -570,7 +583,7 @@ mod tests {
(a, messages_from_a),
]));
let collation = collate(
let future = collate(
Default::default(),
id,
ParachainStatus {
......@@ -584,7 +597,9 @@ mod tests {
context.clone(),
DummyParachainContext,
Arc::new(Sr25519Keyring::Alice.pair().into()),
).wait().unwrap().0;
);
let collation = futures::executor::block_on(future).unwrap().0;
// ascending order by root.
assert_eq!(collation.receipt.egress_queue_roots, vec![(a, root_a), (b, root_b)]);
......
......@@ -15,8 +15,8 @@ codec = { package = "parity-scale-codec", version = "1.1.0", default-features =
substrate-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sr-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
futures = "0.1.29"
futures03 = { package = "futures-preview", version = "0.3.0-alpha.19", features = ["compat"] }
futures = "0.1"
futures03 = { package = "futures", version = "0.3.1", features = ["compat"] }
log = "0.4.8"
exit-future = "0.1.4"
substrate-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
......
......@@ -15,7 +15,7 @@ rstd = { package = "sr-std", git = "https://github.com/paritytech/substrate", de
runtime_primitives = { package = "sr-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
polkadot-parachain = { path = "../parachain", default-features = false }
bitvec = { version = "0.15.2", default-features = false, features = ["alloc"] }
babe = { package = "paint-babe", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
babe = { package = "pallet-babe", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
[dev-dependencies]
substrate-serializer = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
......
......@@ -11,7 +11,7 @@ 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" }
paint-system-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
paint-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
frame-system-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
polkadot-runtime = { path = "../runtime" }
......@@ -33,12 +33,12 @@ 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: paint_system_rpc::AccountNonceApi<Block, AccountId, Nonce>,
C::Api: paint_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance, UncheckedExtrinsic>,
C::Api: frame_system_rpc::AccountNonceApi<Block, AccountId, Nonce>,
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance, UncheckedExtrinsic>,
P: ChainApi + Sync + Send + 'static,
{
use paint_system_rpc::{System, SystemApi};
use paint_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};
use frame_system_rpc::{System, SystemApi};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};
let mut io = jsonrpc_core::IoHandler::default();
io.extend_with(
......
......@@ -30,33 +30,33 @@ version = { package = "sr-version", git = "https://github.com/paritytech/substra
tx-pool-api = { package = "substrate-transaction-pool-runtime-api", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
block-builder-api = { package = "substrate-block-builder-runtime-api", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
authority-discovery = { package = "paint-authority-discovery", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
authorship = { package = "paint-authorship", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
babe = { package = "paint-babe", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
balances = { package = "paint-balances", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
transaction-payment = { package = "paint-transaction-payment", git = "https://github.com/paritytech/substrate", default-features