Commit bde1b099 authored by Gav Wood's avatar Gav Wood Committed by Arkadiy Paronyan
Browse files

Bring runtime API up to date with Substrate master (#17)

* Fixups for 646

* Fixes for API

* For for #678

* Fix runtime

* Update and build

* Tests build

* Fix tests
parent c2938ed9
This diff is collapsed.
......@@ -39,7 +39,6 @@ members = [
exclude = [
"runtime/wasm",
"test-parachains/adder/wasm",
"demo/runtime/wasm",
]
[badges]
......
......@@ -9,10 +9,10 @@ log = "0.3"
polkadot-executor = { path = "../executor" }
polkadot-runtime = { path = "../runtime" }
polkadot-primitives = { path = "../primitives" }
substrate-codec = { git = "https://github.com/paritytech/substrate" }
substrate-runtime-io = { git = "https://github.com/paritytech/substrate" }
substrate-runtime-executive = { git = "https://github.com/paritytech/substrate" }
substrate-runtime-primitives = { git = "https://github.com/paritytech/substrate" }
parity-codec = { git = "https://github.com/paritytech/substrate" }
sr-io = { git = "https://github.com/paritytech/substrate" }
srml-executive = { git = "https://github.com/paritytech/substrate" }
sr-primitives = { git = "https://github.com/paritytech/substrate" }
substrate-client = { git = "https://github.com/paritytech/substrate" }
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
substrate-executor = { git = "https://github.com/paritytech/substrate" }
......
......@@ -18,70 +18,22 @@
use client::backend::LocalBackend;
use client::block_builder::BlockBuilder as ClientBlockBuilder;
use client::{self, Client, LocalCallExecutor, CallExecutor};
use codec::{Encode, Decode};
use client::{Client, LocalCallExecutor};
use polkadot_executor::Executor as LocalDispatch;
use substrate_executor::NativeExecutor;
use state_machine::ExecutionManager;
//use runtime::{Block, Header, Address, BlockId};
use runtime::Address;
use primitives::{
AccountId, Block, Header, BlockId, Hash, Index, InherentData,
Block, BlockId,
AccountId, Hash, Index, InherentData,
SessionKey, Timestamp, UncheckedExtrinsic,
};
use primitives::parachain::{DutyRoster, Id as ParaId};
use substrate_primitives::{KeccakHasher, RlpCodec};
use {BlockBuilder, PolkadotApi, LocalPolkadotApi, Error, ErrorKind, Result};
fn call<B, R>(
client: &Client<B, LocalCallExecutor<B, NativeExecutor<LocalDispatch>>, Block>,
at: &BlockId,
function: &'static str,
input: &[u8])
-> Result<R>
where
R: Decode,
B: LocalBackend<Block, KeccakHasher, RlpCodec>,
{
let parent = at;
let header = Header {
parent_hash: client.block_hash_from_id(&parent)?
.ok_or_else(|| ErrorKind::UnknownBlock(format!("{:?}", parent)))?,
number: client.block_number_from_id(&parent)?
.ok_or_else(|| ErrorKind::UnknownBlock(format!("{:?}", parent)))? + 1,
state_root: Default::default(),
extrinsics_root: Default::default(),
digest: Default::default(),
};
client.state_at(&parent).map_err(Error::from).and_then(|state| {
let mut overlay = Default::default();
let execution_manager = || ExecutionManager::Both(|wasm_result, native_result| {
warn!("Consensus error between wasm and native runtime execution at block {:?}", at);
warn!(" Function {:?}", function);
warn!(" Native result {:?}", native_result);
warn!(" Wasm result {:?}", wasm_result);
wasm_result
});
client.executor().call_at_state(
&state,
&mut overlay,
"initialise_block",
&header.encode(),
execution_manager()
)?;
let (r, _) = client.executor().call_at_state(
&state,
&mut overlay,
function,
input,
execution_manager()
)?;
Ok(R::decode(&mut &r[..])
.ok_or_else(|| client::error::Error::from(client::error::ErrorKind::CallResultDecode(function)))?)
})
}
use substrate_primitives::{Blake2Hasher, RlpCodec};
use {BlockBuilder, PolkadotApi, LocalPolkadotApi, ErrorKind, Result};
impl<B: LocalBackend<Block, KeccakHasher, RlpCodec>> BlockBuilder for ClientBlockBuilder<B, LocalCallExecutor<B, NativeExecutor<LocalDispatch>>, Block, KeccakHasher, RlpCodec> {
impl<B: LocalBackend<Block, Blake2Hasher, RlpCodec>> BlockBuilder for ClientBlockBuilder<B, LocalCallExecutor<B, NativeExecutor<LocalDispatch>>, Block, Blake2Hasher, RlpCodec> {
fn push_extrinsic(&mut self, extrinsic: UncheckedExtrinsic) -> Result<()> {
self.push(extrinsic).map_err(Into::into)
}
......@@ -92,32 +44,31 @@ impl<B: LocalBackend<Block, KeccakHasher, RlpCodec>> BlockBuilder for ClientBloc
}
}
impl<B: LocalBackend<Block, KeccakHasher, RlpCodec>> PolkadotApi for Client<B, LocalCallExecutor<B, NativeExecutor<LocalDispatch>>, Block> {
type BlockBuilder = ClientBlockBuilder<B, LocalCallExecutor<B, NativeExecutor<LocalDispatch>>, Block, KeccakHasher, RlpCodec>;
impl<B: LocalBackend<Block, Blake2Hasher, RlpCodec>> PolkadotApi for Client<B, LocalCallExecutor<B, NativeExecutor<LocalDispatch>>, Block> {
type BlockBuilder = ClientBlockBuilder<B, LocalCallExecutor<B, NativeExecutor<LocalDispatch>>, Block, Blake2Hasher, RlpCodec>;
fn session_keys(&self, at: &BlockId) -> Result<Vec<SessionKey>> {
Ok(self.authorities_at(at)?)
}
fn validators(&self, at: &BlockId) -> Result<Vec<AccountId>> {
call(self, at, "validators", &[])
Ok(self.call_api_at(at, "validators", &())?)
}
fn random_seed(&self, at: &BlockId) -> Result<Hash> {
call(self, at, "random_seed", &[])
Ok(self.call_api_at(at, "random_seed", &())?)
}
fn duty_roster(&self, at: &BlockId) -> Result<DutyRoster> {
call(self, at, "duty_roster", &[])
Ok(self.call_api_at(at, "duty_roster", &())?)
}
fn timestamp(&self, at: &BlockId) -> Result<Timestamp> {
call(self, at, "timestamp", &[])
Ok(self.call_api_at(at, "timestamp", &())?)
}
fn evaluate_block(&self, at: &BlockId, block: Block) -> Result<bool> {
let encoded = block.encode();
let res: Result<()> = call(self, at, "execute_block", &encoded);
let res: Result<()> = self.call_api_at(at, "execute_block", &block).map_err(From::from);
match res {
Ok(_) => Ok(true),
Err(err) => match err.kind() {
......@@ -128,31 +79,23 @@ impl<B: LocalBackend<Block, KeccakHasher, RlpCodec>> PolkadotApi for Client<B, L
}
fn index(&self, at: &BlockId, account: AccountId) -> Result<Index> {
account.using_encoded(|encoded| {
call(self, at, "account_nonce", encoded)
})
Ok(self.call_api_at(at, "account_nonce", &account)?)
}
fn lookup(&self, at: &BlockId, address: Address) -> Result<Option<AccountId>> {
address.using_encoded(|encoded| {
call(self, at, "lookup_address", encoded)
})
Ok(self.call_api_at(at, "lookup_address", &address)?)
}
fn active_parachains(&self, at: &BlockId) -> Result<Vec<ParaId>> {
call(self, at, "active_parachains", &[])
Ok(self.call_api_at(at, "active_parachains", &())?)
}
fn parachain_code(&self, at: &BlockId, parachain: ParaId) -> Result<Option<Vec<u8>>> {
parachain.using_encoded(|encoded| {
call(self, at, "parachain_code", encoded)
})
Ok(self.call_api_at(at, "parachain_code", &parachain)?)
}
fn parachain_head(&self, at: &BlockId, parachain: ParaId) -> Result<Option<Vec<u8>>> {
parachain.using_encoded(|encoded| {
call(self, at, "parachain_head", encoded)
})
Ok(self.call_api_at(at, "parachain_head", &parachain)?)
}
fn build_block(&self, at: &BlockId, inherent_data: InherentData) -> Result<Self::BlockBuilder> {
......@@ -166,13 +109,11 @@ impl<B: LocalBackend<Block, KeccakHasher, RlpCodec>> PolkadotApi for Client<B, L
fn inherent_extrinsics(&self, at: &BlockId, inherent_data: InherentData) -> Result<Vec<UncheckedExtrinsic>> {
let runtime_version = self.runtime_version_at(at)?;
(inherent_data, runtime_version.spec_version).using_encoded(|encoded| {
call(self, at, "inherent_extrinsics", encoded)
})
Ok(self.call_api_at(at, "inherent_extrinsics", &(inherent_data, runtime_version.spec_version))?)
}
}
impl<B: LocalBackend<Block, KeccakHasher, RlpCodec>> LocalPolkadotApi for Client<B, LocalCallExecutor<B, NativeExecutor<LocalDispatch>>, Block>
impl<B: LocalBackend<Block, Blake2Hasher, RlpCodec>> LocalPolkadotApi for Client<B, LocalCallExecutor<B, NativeExecutor<LocalDispatch>>, Block>
{}
#[cfg(test)]
......@@ -198,7 +139,7 @@ mod tests {
]
}
fn client() -> Client<InMemory<Block, KeccakHasher, RlpCodec>, LocalCallExecutor<InMemory<Block, KeccakHasher, RlpCodec>, NativeExecutor<LocalDispatch>>, Block> {
fn client() -> Client<InMemory<Block, Blake2Hasher, RlpCodec>, LocalCallExecutor<InMemory<Block, Blake2Hasher, RlpCodec>, NativeExecutor<LocalDispatch>>, Block> {
let genesis_config = GenesisConfig {
consensus: Some(ConsensusConfig {
code: LocalDispatch::native_equivalent().to_vec(),
......@@ -215,9 +156,10 @@ mod tests {
parachains: Some(Default::default()),
staking: Some(Default::default()),
timestamp: Some(Default::default()),
treasury: Some(Default::default()),
};
::client::new_in_mem(LocalDispatch::with_heap_pages(8), genesis_config).unwrap()
::client::new_in_mem(LocalDispatch::new(), genesis_config).unwrap()
}
#[test]
......@@ -273,6 +215,6 @@ mod tests {
let client = client();
let id = BlockId::number(0);
assert!(client.random_seed(&id).is_ok());
client.random_seed(&id).unwrap();
}
}
......@@ -20,19 +20,18 @@
extern crate polkadot_executor;
extern crate polkadot_primitives as primitives;
extern crate polkadot_runtime as runtime;
extern crate substrate_codec as codec;
extern crate substrate_runtime_io as runtime_io;
extern crate parity_codec as codec;
extern crate sr_io as runtime_io;
extern crate substrate_client as client;
extern crate substrate_executor as substrate_executor;
extern crate substrate_runtime_executive;
extern crate srml_executive;
extern crate substrate_primitives;
extern crate substrate_runtime_primitives as runtime_primitives;
extern crate sr_primitives as runtime_primitives;
extern crate substrate_state_machine as state_machine;
#[macro_use]
extern crate error_chain;
#[macro_use]
extern crate log;
#[cfg(test)]
......
......@@ -27,7 +27,7 @@ use primitives::{
use runtime::Address;
use primitives::parachain::{DutyRoster, Id as ParaId};
use {PolkadotApi, BlockBuilder, RemotePolkadotApi, Result, ErrorKind};
use substrate_primitives::{KeccakHasher, RlpCodec};
use substrate_primitives::{Blake2Hasher, RlpCodec};
/// Light block builder. TODO: make this work (efficiently)
#[derive(Clone, Copy)]
......@@ -44,9 +44,9 @@ impl BlockBuilder for LightBlockBuilder {
}
/// Remote polkadot API implementation.
pub struct RemotePolkadotApiWrapper<B: Backend<Block, KeccakHasher, RlpCodec>, E: CallExecutor<Block, KeccakHasher, RlpCodec>>(pub Arc<Client<B, E, Block>>);
pub struct RemotePolkadotApiWrapper<B: Backend<Block, Blake2Hasher, RlpCodec>, E: CallExecutor<Block, Blake2Hasher, RlpCodec>>(pub Arc<Client<B, E, Block>>);
impl<B: Backend<Block, KeccakHasher, RlpCodec>, E: CallExecutor<Block, KeccakHasher, RlpCodec>> PolkadotApi for RemotePolkadotApiWrapper<B, E> {
impl<B: Backend<Block, Blake2Hasher, RlpCodec>, E: CallExecutor<Block, Blake2Hasher, RlpCodec>> PolkadotApi for RemotePolkadotApiWrapper<B, E> {
type BlockBuilder = LightBlockBuilder;
fn session_keys(&self, at: &BlockId) -> Result<Vec<SessionKey>> {
......@@ -100,9 +100,9 @@ impl<B: Backend<Block, KeccakHasher, RlpCodec>, E: CallExecutor<Block, KeccakHas
Err(ErrorKind::UnknownRuntime.into())
}
fn inherent_extrinsics(&self, _at: &BlockId, _inherent: InherentData) -> Result<Vec<Vec<u8>>> {
fn inherent_extrinsics(&self, _at: &BlockId, _inherent: InherentData) -> Result<Vec<UncheckedExtrinsic>> {
Err(ErrorKind::UnknownRuntime.into())
}
}
impl<B: RemoteBackend<Block, KeccakHasher, RlpCodec>, E: CallExecutor<Block, KeccakHasher, RlpCodec>> RemotePolkadotApi for RemotePolkadotApiWrapper<B, E> {}
impl<B: RemoteBackend<Block, Blake2Hasher, RlpCodec>, E: CallExecutor<Block, Blake2Hasher, RlpCodec>> RemotePolkadotApi for RemotePolkadotApiWrapper<B, E> {}
......@@ -8,7 +8,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
polkadot-primitives = { path = "../primitives" }
parking_lot = "0.4"
log = "0.3"
substrate-codec = { git = "https://github.com/paritytech/substrate" }
parity-codec = { git = "https://github.com/paritytech/substrate" }
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
kvdb = { git = "https://github.com/paritytech/parity-common.git" }
kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common.git" }
......
......@@ -18,7 +18,7 @@
extern crate polkadot_primitives;
extern crate parking_lot;
extern crate substrate_codec as codec;
extern crate parity_codec as codec;
extern crate substrate_primitives;
extern crate kvdb;
extern crate kvdb_rocksdb;
......
......@@ -24,6 +24,5 @@ case $TARGET in
# Install prerequisites and build all wasm projects
./scripts/init.sh
./scripts/build.sh
./scripts/build-demos.sh
;;
esac
......@@ -7,12 +7,11 @@ description = "Collator node implementation"
[dependencies]
futures = "0.1.17"
substrate-client = { git = "https://github.com/paritytech/substrate" }
substrate-codec = { git = "https://github.com/paritytech/substrate" }
parity-codec = { git = "https://github.com/paritytech/substrate" }
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
polkadot-api = { path = "../api" }
polkadot-runtime = { path = "../runtime", version = "0.1" }
polkadot-primitives = { path = "../primitives", version = "0.1" }
polkadot-cli = { path = "../cli" }
log = "0.4"
ed25519 = { git = "https://github.com/paritytech/substrate" }
tokio = "0.1.7"
......@@ -46,9 +46,8 @@
extern crate futures;
extern crate substrate_client as client;
extern crate substrate_codec as codec;
extern crate parity_codec as codec;
extern crate substrate_primitives as primitives;
extern crate ed25519;
extern crate tokio;
extern crate polkadot_api;
......@@ -67,6 +66,7 @@ use std::time::{Duration, Instant};
use futures::{future, stream, Stream, Future, IntoFuture};
use client::BlockchainEvents;
use polkadot_api::PolkadotApi;
use primitives::ed25519;
use polkadot_primitives::{AccountId, BlockId, SessionKey};
use polkadot_primitives::parachain::{self, BlockData, DutyRoster, HeadData, ConsolidatedIngress, Message, Id as ParaId};
use polkadot_cli::{ServiceComponents, Service, CustomConfiguration};
......
......@@ -7,7 +7,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
futures = "0.1.17"
parking_lot = "0.4"
tokio = "0.1.7"
ed25519 = { git = "https://github.com/paritytech/substrate" }
error-chain = "0.12"
log = "0.3"
exit-future = "0.1"
......@@ -20,11 +19,11 @@ polkadot-runtime = { path = "../runtime" }
polkadot-statement-table = { path = "../statement-table" }
polkadot-transaction-pool = { path = "../transaction-pool" }
substrate-bft = { git = "https://github.com/paritytech/substrate" }
substrate-codec = { git = "https://github.com/paritytech/substrate" }
parity-codec = { git = "https://github.com/paritytech/substrate" }
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
substrate-runtime-support = { git = "https://github.com/paritytech/substrate" }
srml-support = { git = "https://github.com/paritytech/substrate" }
substrate-client = { git = "https://github.com/paritytech/substrate" }
substrate-runtime-primitives = { git = "https://github.com/paritytech/substrate" }
sr-primitives = { git = "https://github.com/paritytech/substrate" }
[dev-dependencies]
substrate-keyring = { git = "https://github.com/paritytech/substrate" }
......@@ -29,7 +29,6 @@
//!
//! Groups themselves may be compromised by malicious authorities.
extern crate ed25519;
extern crate parking_lot;
extern crate polkadot_api;
extern crate polkadot_availability_store as extrinsic_store;
......@@ -40,10 +39,10 @@ extern crate polkadot_runtime;
extern crate polkadot_primitives;
extern crate substrate_bft as bft;
extern crate substrate_codec as codec;
extern crate parity_codec as codec;
extern crate substrate_primitives as primitives;
extern crate substrate_runtime_support as runtime_support;
extern crate substrate_runtime_primitives as runtime_primitives;
extern crate srml_support as runtime_support;
extern crate sr_primitives as runtime_primitives;
extern crate substrate_client as client;
extern crate exit_future;
......@@ -71,7 +70,7 @@ use extrinsic_store::Store as ExtrinsicStore;
use polkadot_api::PolkadotApi;
use polkadot_primitives::{AccountId, Hash, Block, BlockId, BlockNumber, Header, Timestamp, SessionKey};
use polkadot_primitives::parachain::{Id as ParaId, Chain, DutyRoster, BlockData, Extrinsic as ParachainExtrinsic, CandidateReceipt, CandidateSignature};
use primitives::AuthorityId;
use primitives::{AuthorityId, ed25519};
use transaction_pool::TransactionPool;
use tokio::runtime::TaskExecutor;
use tokio::timer::{Delay, Interval};
......@@ -593,8 +592,7 @@ impl<C> bft::Proposer<Block> for Proposer<C>
fn import_misbehavior(&self, misbehavior: Vec<(AuthorityId, bft::Misbehavior<Hash>)>) {
use rhododendron::Misbehavior as GenericMisbehavior;
use runtime_primitives::bft::{MisbehaviorKind, MisbehaviorReport};
use runtime_primitives::MaybeUnsigned;
use polkadot_runtime::{Call, Extrinsic, BareExtrinsic, UncheckedExtrinsic, ConsensusCall};
use polkadot_runtime::{Call, UncheckedExtrinsic, ConsensusCall, RawAddress};
let local_id = self.local_key.public().0.into();
let mut next_index = {
......@@ -632,23 +630,18 @@ impl<C> bft::Proposer<Block> for Proposer<C>
=> MisbehaviorKind::BftDoubleCommit(round as u32, (h1, s1.signature), (h2, s2.signature)),
}
};
let extrinsic = BareExtrinsic {
signed: local_id,
index: next_index,
function: Call::Consensus(ConsensusCall::report_misbehavior(report)),
};
let payload = (next_index, Call::Consensus(ConsensusCall::report_misbehavior(report)));
let signature = self.local_key.sign(&payload.encode()).into();
next_index += 1;
let signature = MaybeUnsigned(self.local_key.sign(&extrinsic.encode()).into());
let extrinsic = Extrinsic {
signed: extrinsic.signed.into(),
index: extrinsic.index,
function: extrinsic.function,
let local_id = self.local_key.public().0.into();
let extrinsic = UncheckedExtrinsic {
signature: Some((RawAddress::Id(local_id), signature)),
index: payload.0,
function: payload.1,
};
let uxt: Vec<u8> = Decode::decode(&mut UncheckedExtrinsic::new(extrinsic, signature).encode().as_slice()).expect("Encoded extrinsic is valid");
self.transaction_pool.submit_one(&BlockId::hash(self.parent_hash), uxt)
let uxt: Vec<u8> = Decode::decode(&mut extrinsic.encode().as_slice()).expect("Encoded extrinsic is valid");
self.transaction_pool.submit_one(&BlockId::hash(self.parent_hash), polkadot_primitives::UncheckedExtrinsic(uxt))
.expect("locally signed extrinsic is valid; qed");
}
}
......@@ -663,7 +656,7 @@ impl<C> bft::Proposer<Block> for Proposer<C>
// this is determined by checking if our local validator would have been forced to skip the round.
let consider_online = was_proposed || {
let forced_delay = self.dynamic_inclusion.acceptable_in(Instant::now(), self.table.includable_count());
let public = ::ed25519::Public::from_raw(primary_validator.0);
let public = ed25519::Public::from_raw(primary_validator.0);
match forced_delay {
None => info!(
"Potential Offline Validator: {} failed to propose during assigned slot: {}",
......
......@@ -29,7 +29,7 @@ use std::sync::Arc;
use bft::{self, BftService};
use client::{BlockchainEvents, ChainHead, BlockBody};
use ed25519;
use primitives::ed25519;
use futures::prelude::*;
use polkadot_api::LocalPolkadotApi;
use polkadot_primitives::{Block, Header};
......
......@@ -30,6 +30,7 @@ use futures::{future, prelude::*};
use super::{GroupInfo, TableRouter};
use self::includable::IncludabilitySender;
use primitives::ed25519;
mod includable;
......@@ -39,7 +40,7 @@ pub use table::generic::Statement as GenericStatement;
struct TableContext {
parent_hash: Hash,
key: Arc<::ed25519::Pair>,
key: Arc<ed25519::Pair>,
groups: HashMap<ParaId, GroupInfo>,
}
......@@ -320,7 +321,7 @@ impl SharedTable {
/// block being built.
pub fn new(
groups: HashMap<ParaId, GroupInfo>,
key: Arc<::ed25519::Pair>,
key: Arc<ed25519::Pair>,
parent_hash: Hash,
extrinsic_store: ExtrinsicStore,
) -> Self {
......
......@@ -11,11 +11,10 @@ polkadot-availability-store = { path = "../availability-store" }
polkadot-consensus = { path = "../consensus" }
polkadot-primitives = { path = "../primitives" }
substrate-bft = { git = "https://github.com/paritytech/substrate" }
substrate-codec = { git = "https://github.com/paritytech/substrate" }
substrate-codec-derive = { git = "https://github.com/paritytech/substrate" }
parity-codec = { git = "https://github.com/paritytech/substrate" }
parity-codec-derive = { git = "https://github.com/paritytech/substrate" }
substrate-network = { git = "https://github.com/paritytech/substrate" }
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
ed25519 = { git = "https://github.com/paritytech/substrate" }
futures = "0.1"
tokio = "0.1.7"
log = "0.4"
......
......@@ -19,7 +19,7 @@
//! each time consensus begins on a new chain head.
use bft;
use ed25519;
use substrate_primitives::ed25519;
use substrate_network::{self as net, generic_message as msg};
use substrate_network::consensus_gossip::ConsensusMessage;
use polkadot_api::{PolkadotApi, LocalPolkadotApi};
......
......@@ -21,7 +21,7 @@
//! and more.
extern crate substrate_bft as bft;
extern crate substrate_codec as codec;
extern crate parity_codec as codec;
extern crate substrate_network;
extern crate substrate_primitives;
......@@ -30,7 +30,6 @@ extern crate polkadot_availability_store as av_store;
extern crate polkadot_consensus;
extern crate polkadot_primitives;
extern crate ed25519;
extern crate futures;
extern crate parking_lot;
extern crate tokio;
......@@ -39,7 +38,7 @@ extern crate rhododendron;
#[macro_use]
extern crate log;
#[macro_use]
extern crate substrate_codec_derive;
extern crate parity_codec_derive;
mod collator_pool;
mod local_collations;
......
......@@ -5,8 +5,8 @@ authors = ["Parity Technologies <admin@parity.io>"]
description = "Types and utilities for creating and working with parachains"
[dependencies]
substrate-codec = { git = "https://github.com/paritytech/substrate", default-features = false }
substrate-codec-derive = { git = "https://github.com/paritytech/substrate", default-features = false }
parity-codec = { git = "https://github.com/paritytech/substrate", default-features = false }
parity-codec-derive = { git = "https://github.com/paritytech/substrate", default-features = false }
wasmi = { version = "0.4", optional = true }
error-chain = { version = "0.12", optional = true }
......@@ -15,4 +15,4 @@ tiny-keccak = "1.4"
[features]
default = ["std"]
std = ["substrate-codec/std", "wasmi", "error-chain"]
std = ["parity-codec/std", "wasmi", "error-chain"]
......@@ -43,11 +43,11 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(alloc))]
/// Re-export of substrate-codec.
pub extern crate substrate_codec as codec;
/// Re-export of parity-codec.
pub extern crate parity_codec as codec;
#[macro_use]
extern crate substrate_codec_derive;
extern crate parity_codec_derive;
#[cfg(not(feature = "std"))]
extern crate alloc;
......
Supports Markdown
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