mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 18:11:10 +00:00
Refactor primitives.
This commit is contained in:
Generated
+9
-9
@@ -827,8 +827,8 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"polkadot-codec 0.1.0",
|
||||
"polkadot-primitives 0.1.0",
|
||||
"polkadot-runtime-codec 0.1.0",
|
||||
"polkadot-runtime-std 0.1.0",
|
||||
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@@ -1003,14 +1003,18 @@ dependencies = [
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"native-runtime 0.1.0",
|
||||
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"polkadot-codec 0.1.0",
|
||||
"polkadot-executor 0.1.0",
|
||||
"polkadot-primitives 0.1.0",
|
||||
"polkadot-runtime-codec 0.1.0",
|
||||
"polkadot-serializer 0.1.0",
|
||||
"polkadot-state-machine 0.1.0",
|
||||
"triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "polkadot-codec"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "polkadot-collator"
|
||||
version = "0.1.0"
|
||||
@@ -1031,8 +1035,8 @@ dependencies = [
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"native-runtime 0.1.0",
|
||||
"parity-wasm 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"polkadot-codec 0.1.0",
|
||||
"polkadot-primitives 0.1.0",
|
||||
"polkadot-runtime-codec 0.1.0",
|
||||
"polkadot-runtime-std 0.1.0",
|
||||
"polkadot-serializer 0.1.0",
|
||||
"polkadot-state-machine 0.1.0",
|
||||
@@ -1075,7 +1079,7 @@ dependencies = [
|
||||
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fixed-hash 0.1.3 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)",
|
||||
"polkadot-runtime-codec 0.1.0",
|
||||
"polkadot-codec 0.1.0",
|
||||
"polkadot-serializer 0.1.0",
|
||||
"pretty_assertions 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-hex 2.0.0 (git+https://github.com/rphmeier/rustc-hex.git)",
|
||||
@@ -1108,18 +1112,14 @@ dependencies = [
|
||||
"polkadot-rpc 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "polkadot-runtime-codec"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "polkadot-runtime-std"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"ed25519 0.1.0",
|
||||
"environmental 0.1.0",
|
||||
"polkadot-codec 0.1.0",
|
||||
"polkadot-primitives 0.1.0",
|
||||
"polkadot-runtime-codec 0.1.0",
|
||||
"polkadot-state-machine 0.1.0",
|
||||
"pwasm-alloc 0.1.0",
|
||||
"pwasm-libc 0.1.0",
|
||||
|
||||
@@ -20,7 +20,7 @@ members = [
|
||||
"primitives",
|
||||
"rpc-servers",
|
||||
"rpc",
|
||||
"runtime-codec",
|
||||
"codec",
|
||||
"runtime-std",
|
||||
"serializer",
|
||||
"state-machine",
|
||||
|
||||
@@ -11,7 +11,7 @@ polkadot-primitives = { path = "../primitives", version = "0.1" }
|
||||
polkadot-state-machine = { path = "../state-machine", version = "0.1" }
|
||||
polkadot-serializer = { path = "../serializer" }
|
||||
polkadot-executor = { path = "../executor" }
|
||||
polkadot-runtime-codec = { path = "../runtime-codec", version = "0.1" }
|
||||
polkadot-codec = { path = "../codec", version = "0.1" }
|
||||
native-runtime = { path = "../native-runtime" }
|
||||
triehash = "0.1"
|
||||
hex-literal = "0.1"
|
||||
|
||||
@@ -46,8 +46,8 @@ mod tests {
|
||||
use state_machine::OverlayedChanges;
|
||||
use state_machine::backend::InMemory;
|
||||
use polkadot_executor::executor;
|
||||
use primitives::{AccountId, Hash};
|
||||
use primitives::relay::{BlockNumber, Header, Digest, UncheckedTransaction, Transaction, Function};
|
||||
use primitives::relay::{AccountId, Hash, BlockNumber, Header, Digest, UncheckedTransaction,
|
||||
Transaction, Function};
|
||||
use primitives::contract::CallData;
|
||||
use ed25519::Pair;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
extern crate polkadot_primitives as primitives;
|
||||
extern crate polkadot_state_machine as state_machine;
|
||||
extern crate polkadot_serializer as ser;
|
||||
extern crate polkadot_runtime_codec as codec;
|
||||
extern crate polkadot_codec as codec;
|
||||
extern crate polkadot_executor;
|
||||
extern crate native_runtime;
|
||||
extern crate ed25519;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "polkadot-runtime-codec"
|
||||
name = "polkadot-codec"
|
||||
description = "Serialization and deserialization codec for runtime values"
|
||||
version = "0.1.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
@@ -60,7 +60,7 @@ pub trait ParachainContext {
|
||||
fn produce_candidate<I: IntoIterator<Item=(ParaId, Message)>>(
|
||||
&self,
|
||||
ingress: I,
|
||||
) -> (parachain::BlockData, primitives::Signature);
|
||||
) -> (parachain::BlockData, primitives::relay::Signature);
|
||||
}
|
||||
|
||||
/// Relay chain context needed to collate.
|
||||
|
||||
@@ -22,9 +22,12 @@ extern crate untrusted;
|
||||
extern crate rustc_hex;
|
||||
|
||||
use ring::{rand, signature};
|
||||
use primitives::Signature;
|
||||
use primitives::hash::H512;
|
||||
use rustc_hex::FromHex;
|
||||
|
||||
/// Alias to 520-bit hash when used in the context of a signature on the relay chain.
|
||||
pub type Signature = H512;
|
||||
|
||||
/// Verify a message without type checking the parameters' types for the right size.
|
||||
pub fn verify(sig: &[u8], message: &[u8], public: &[u8]) -> bool {
|
||||
let public_key = untrusted::Input::from(public);
|
||||
|
||||
@@ -5,7 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
|
||||
[dependencies]
|
||||
error-chain = "0.11"
|
||||
polkadot-runtime-codec = { path = "../runtime-codec", version = "0.1" }
|
||||
polkadot-codec = { path = "../codec", version = "0.1" }
|
||||
polkadot-runtime-std = { path = "../runtime-std", version = "0.1" }
|
||||
polkadot-primitives = { path = "../primitives", version = "0.1" }
|
||||
polkadot-serializer = { path = "../serializer", version = "0.1" }
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#![warn(missing_docs)]
|
||||
|
||||
extern crate polkadot_runtime_codec as codec;
|
||||
extern crate polkadot_codec as codec;
|
||||
extern crate polkadot_runtime_std as runtime_std;
|
||||
extern crate polkadot_primitives as primitives;
|
||||
extern crate polkadot_serializer as serializer;
|
||||
|
||||
@@ -63,8 +63,9 @@ mod tests {
|
||||
use native_runtime::support::{one, two, Hashable};
|
||||
use native_runtime::runtime::staking::balance;
|
||||
use state_machine::TestExternalities;
|
||||
use primitives::{twox_128, Hash};
|
||||
use primitives::relay::{Header, BlockNumber, Block, Digest, Transaction, UncheckedTransaction, Function};
|
||||
use primitives::twox_128;
|
||||
use primitives::relay::{Hash, Header, BlockNumber, Block, Digest, Transaction,
|
||||
UncheckedTransaction, Function, AccountId};
|
||||
use ed25519::Pair;
|
||||
|
||||
const BLOATY_CODE: &[u8] = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.wasm");
|
||||
@@ -164,7 +165,7 @@ mod tests {
|
||||
], }
|
||||
}
|
||||
|
||||
fn secret_for(who: &::primitives::AccountId) -> Option<Pair> {
|
||||
fn secret_for(who: &AccountId) -> Option<Pair> {
|
||||
match who {
|
||||
x if *x == one() => Some(Pair::from_seed(b"12345678901234567890123456789012")),
|
||||
x if *x == two() => Some("9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60".into()),
|
||||
|
||||
@@ -293,8 +293,8 @@ mod tests {
|
||||
use native_runtime::support::{one, two};
|
||||
use native_runtime::runtime::staking::balance;
|
||||
use state_machine::TestExternalities;
|
||||
use primitives::{twox_128, AccountId};
|
||||
use primitives::relay::{Header, Transaction, UncheckedTransaction, Function};
|
||||
use primitives::twox_128;
|
||||
use primitives::relay::{Header, Transaction, UncheckedTransaction, Function, AccountId};
|
||||
use runtime_std;
|
||||
use ed25519::Pair;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ version = "0.1.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
|
||||
[dependencies]
|
||||
polkadot-runtime-codec = { path = "../runtime-codec", version = "0.1" }
|
||||
polkadot-codec = { path = "../codec", version = "0.1" }
|
||||
polkadot-runtime-std = { path = "../runtime-std", version = "0.1" }
|
||||
polkadot-primitives = { path = "../primitives", version = "0.1" }
|
||||
rustc-hex = "1.0"
|
||||
@@ -13,4 +13,4 @@ log = { version = "0.3", optional = true }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = ["polkadot-runtime-codec/std", "polkadot-runtime-std/std", "polkadot-primitives/std", "log"]
|
||||
std = ["polkadot-codec/std", "polkadot-runtime-std/std", "polkadot-primitives/std", "log"]
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
|
||||
use std::borrow::Borrow;
|
||||
use primitives::parachain::Id as ParachainId;
|
||||
use primitives::AccountId;
|
||||
use primitives::relay::{BlockNumber, HeaderHash, Header, Body};
|
||||
use primitives::relay::{AccountId, BlockNumber, HeaderHash, Header, Body};
|
||||
use service::Role as RoleFlags;
|
||||
|
||||
pub type RequestId = u64;
|
||||
|
||||
@@ -13,7 +13,7 @@ uint = { git = "https://github.com/rphmeier/primitives.git", branch = "compile-f
|
||||
twox-hash = { version = "1.1.0", optional = true }
|
||||
byteorder = { version = "1.1", default_features = false }
|
||||
blake2-rfc = { version = "0.2.18", optional = true }
|
||||
polkadot-runtime-codec = { path = "../runtime-codec", version = "0.1", default_features = false }
|
||||
polkadot-codec = { path = "../codec", version = "0.1", default_features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
polkadot-serializer = { path = "../serializer", version = "0.1" }
|
||||
@@ -24,7 +24,7 @@ default = ["std"]
|
||||
std = [
|
||||
"uint/std",
|
||||
"fixed-hash/std",
|
||||
"polkadot-runtime-codec/std",
|
||||
"polkadot-codec/std",
|
||||
"serde/std",
|
||||
"rustc-hex/std",
|
||||
"twox-hash",
|
||||
|
||||
@@ -43,7 +43,7 @@ extern crate uint as uint_crate;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
extern crate core;
|
||||
extern crate polkadot_runtime_codec as codec;
|
||||
extern crate polkadot_codec as codec;
|
||||
#[cfg(test)]
|
||||
extern crate polkadot_serializer;
|
||||
#[cfg(test)]
|
||||
@@ -80,38 +80,7 @@ mod tests;
|
||||
pub mod hashing;
|
||||
|
||||
pub use self::hash::{H160, H256};
|
||||
pub use self::relay::BlockNumber;
|
||||
pub use self::uint::{U256, U512};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
pub use hashing::{blake2_256, twox_128, twox_256};
|
||||
|
||||
/// Virtual account ID that represents the idea of a dispatch/statement being signed by everybody
|
||||
/// (who matters). Essentially this means that a majority of validators have decided it is
|
||||
/// "correct".
|
||||
pub const EVERYBODY: AccountId = [255u8; 32];
|
||||
|
||||
/// Alias to Ed25519 pubkey that identifies an account.
|
||||
pub type AccountId = [u8; 32];
|
||||
|
||||
/// The Ed25519 pub key of an session that belongs to an authority. This is used as what the
|
||||
/// external environment/consensus algorithm calls an "authority".
|
||||
pub type SessionKey = AccountId;
|
||||
|
||||
/// Indentifier for a chain.
|
||||
pub type ChainID = u64;
|
||||
|
||||
/// Index of a transaction.
|
||||
pub type TxOrder = u64;
|
||||
|
||||
/// A hash of some data.
|
||||
pub type Hash = hash::H256;
|
||||
|
||||
/// Alias to 520-bit hash when used in the context of a signature.
|
||||
pub type Signature = hash::H512;
|
||||
|
||||
/// A balance in the staking subsystem.
|
||||
pub type Balance = u64;
|
||||
|
||||
/// A timestamp.
|
||||
pub type Timestamp = u64;
|
||||
|
||||
@@ -54,7 +54,7 @@ pub struct Candidate {
|
||||
/// The ID of the parachain this is a proposal for.
|
||||
pub parachain_index: Id,
|
||||
/// Collator's signature
|
||||
pub collator_signature: ::Signature,
|
||||
pub collator_signature: ::relay::Signature,
|
||||
/// Unprocessed ingress queue.
|
||||
///
|
||||
/// Ordered by parachain ID and block number.
|
||||
@@ -71,12 +71,12 @@ pub struct Candidate {
|
||||
pub struct CandidateReceipt {
|
||||
/// The ID of the parachain this is a candidate for.
|
||||
pub parachain_index: Id,
|
||||
/// The collator's account ID
|
||||
pub collator: ::AccountId,
|
||||
/// The collator's relay-chain account ID
|
||||
pub collator: ::relay::AccountId,
|
||||
/// The head-data
|
||||
pub head_data: HeadData,
|
||||
/// Balance uploads to the relay chain.
|
||||
pub balance_uploads: Vec<(::AccountId, ::uint::U256)>,
|
||||
pub balance_uploads: Vec<(::relay::AccountId, ::uint::U256)>,
|
||||
/// Egress queue roots.
|
||||
pub egress_queue_roots: Vec<(Id, ::hash::H256)>,
|
||||
/// Fees paid from the chain to the relay chain validators
|
||||
|
||||
@@ -7,3 +7,27 @@ pub use self::block::*;
|
||||
pub use self::transaction::*;
|
||||
|
||||
pub use self::block::Number as BlockNumber;
|
||||
|
||||
/// Virtual account ID that represents the idea of a dispatch/statement being signed by everybody
|
||||
/// (who matters). Essentially this means that a majority of validators have decided it is
|
||||
/// "correct".
|
||||
pub const EVERYBODY: AccountId = [255u8; 32];
|
||||
|
||||
/// Alias to Ed25519 pubkey that identifies an account on the relay chain.
|
||||
pub type AccountId = [u8; 32];
|
||||
|
||||
/// The Ed25519 pub key of an session that belongs to an authority of the relay chain. This is
|
||||
/// used as what the external environment/consensus algorithm calls an "authority".
|
||||
pub type SessionKey = AccountId;
|
||||
|
||||
/// Indentifier for a chain.
|
||||
pub type ChainID = u64;
|
||||
|
||||
/// Index of a transaction in the relay chain.
|
||||
pub type TxOrder = u64;
|
||||
|
||||
/// A hash of some data used by the relay chain.
|
||||
pub type Hash = ::hash::H256;
|
||||
|
||||
/// Alias to 520-bit hash when used in the context of a signature on the relay chain.
|
||||
pub type Signature = ::hash::H512;
|
||||
|
||||
@@ -205,15 +205,15 @@ impl FunctionId {
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
pub enum Function {
|
||||
/// Set the timestamp.
|
||||
TimestampSet(::Timestamp),
|
||||
TimestampSet(u64),
|
||||
/// Set temporary session key as a validator.
|
||||
SessionSetKey(::SessionKey),
|
||||
SessionSetKey(::relay::SessionKey),
|
||||
/// Staking subsystem: begin staking.
|
||||
StakingStake,
|
||||
/// Staking subsystem: stop staking.
|
||||
StakingUnstake,
|
||||
/// Staking subsystem: transfer stake.
|
||||
StakingTransfer(::AccountId, ::Balance),
|
||||
StakingTransfer(::relay::AccountId, u64),
|
||||
/// Make a proposal for the governance system.
|
||||
GovernancePropose(Proposal),
|
||||
/// Approve a proposal for the governance system.
|
||||
@@ -288,9 +288,9 @@ impl Slicable for Function {
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
pub struct Transaction {
|
||||
/// Who signed it (note this is not a signature).
|
||||
pub signed: ::AccountId,
|
||||
pub signed: super::AccountId,
|
||||
/// The number of transactions have come before from the same signer.
|
||||
pub nonce: ::TxOrder,
|
||||
pub nonce: super::TxOrder,
|
||||
/// The function that should be called.
|
||||
pub function: Function,
|
||||
}
|
||||
@@ -326,7 +326,7 @@ pub struct UncheckedTransaction {
|
||||
/// The actual transaction information.
|
||||
pub transaction: Transaction,
|
||||
/// The signature; should be an Ed25519 signature applied to the serialised `transaction` field.
|
||||
pub signature: ::Signature,
|
||||
pub signature: super::Signature,
|
||||
}
|
||||
|
||||
impl Slicable for UncheckedTransaction {
|
||||
|
||||
@@ -17,10 +17,7 @@
|
||||
//! Tests.
|
||||
|
||||
use codec::Slicable;
|
||||
|
||||
use ::AccountId;
|
||||
use relay::block::{Block, Header, Digest, Log};
|
||||
use relay::transaction::{UncheckedTransaction, Transaction, Function};
|
||||
use relay::{AccountId, Block, Header, Digest, Log, UncheckedTransaction, Transaction, Function};
|
||||
|
||||
#[test]
|
||||
fn serialise_transaction_works() {
|
||||
|
||||
@@ -13,7 +13,7 @@ pwasm-libc = { path = "../wasm-runtime/pwasm-libc", version = "0.1" }
|
||||
environmental = { path = "../environmental", version = "0.1", optional = true }
|
||||
polkadot-state-machine = { path = "../state-machine", version = "0.1", optional = true }
|
||||
polkadot-primitives = { path = "../primitives", version = "0.1", default_features = false }
|
||||
polkadot-runtime-codec = { path = "../runtime-codec", version = "0.1", default_features = false }
|
||||
polkadot-codec = { path = "../codec", version = "0.1", default_features = false }
|
||||
triehash = { version = "0.1", optional = true }
|
||||
ed25519 = { path = "../ed25519", version = "0.1", optional = true }
|
||||
|
||||
@@ -24,7 +24,7 @@ std = [
|
||||
"polkadot-state-machine",
|
||||
"triehash",
|
||||
"polkadot-primitives/std",
|
||||
"polkadot-runtime-codec/std",
|
||||
"polkadot-codec/std",
|
||||
"ed25519",
|
||||
]
|
||||
nightly = []
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! This is part of the Polkadot runtime.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![cfg_attr(not(feature = "std"), feature(lang_items))]
|
||||
#![cfg_attr(not(feature = "std"), feature(core_intrinsics))]
|
||||
@@ -22,7 +24,7 @@
|
||||
#![cfg_attr(feature = "std", doc = "Polkadot runtime standard library as compiled when linked with Rust's standard library.")]
|
||||
#![cfg_attr(not(feature = "std"), doc = "Polkadot's runtime standard library as compiled without Rust's standard library.")]
|
||||
|
||||
extern crate polkadot_runtime_codec as codec;
|
||||
extern crate polkadot_codec as codec;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
include!("../with_std.rs");
|
||||
@@ -41,7 +43,7 @@ pub mod prelude {
|
||||
/// Type definitions and helpers for transactions.
|
||||
pub mod transaction {
|
||||
pub use primitives::relay::{Transaction, UncheckedTransaction};
|
||||
use primitives::Signature;
|
||||
use primitives::relay::Signature;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use std::ops;
|
||||
@@ -81,4 +83,3 @@ pub mod transaction {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Generated
+7
-7
@@ -375,6 +375,10 @@ dependencies = [
|
||||
"crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "polkadot-codec"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "polkadot-primitives"
|
||||
version = "0.1.0"
|
||||
@@ -383,7 +387,7 @@ dependencies = [
|
||||
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fixed-hash 0.1.3 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)",
|
||||
"polkadot-runtime-codec 0.1.0",
|
||||
"polkadot-codec 0.1.0",
|
||||
"rustc-hex 2.0.0 (git+https://github.com/rphmeier/rustc-hex.git)",
|
||||
"serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -391,18 +395,14 @@ dependencies = [
|
||||
"uint 0.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "polkadot-runtime-codec"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "polkadot-runtime-std"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"ed25519 0.1.0",
|
||||
"environmental 0.1.0",
|
||||
"polkadot-codec 0.1.0",
|
||||
"polkadot-primitives 0.1.0",
|
||||
"polkadot-runtime-codec 0.1.0",
|
||||
"polkadot-state-machine 0.1.0",
|
||||
"pwasm-alloc 0.1.0",
|
||||
"pwasm-libc 0.1.0",
|
||||
@@ -551,8 +551,8 @@ dependencies = [
|
||||
name = "runtime-polkadot"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"polkadot-codec 0.1.0",
|
||||
"polkadot-primitives 0.1.0",
|
||||
"polkadot-runtime-codec 0.1.0",
|
||||
"polkadot-runtime-std 0.1.0",
|
||||
]
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
polkadot-runtime-codec = { path = "../../runtime-codec", version = "0.1", default-features = false }
|
||||
polkadot-codec = { path = "../../codec", version = "0.1", default-features = false }
|
||||
polkadot-runtime-std = { path = "../../runtime-std", version = "0.1", default-features = false }
|
||||
polkadot-primitives = { path = "../../primitives", version = "0.1", default-features = false }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
std = ["polkadot-runtime-codec/std", "polkadot-runtime-std/std", "polkadot-primitives/std"]
|
||||
std = ["polkadot-codec/std", "polkadot-runtime-std/std", "polkadot-primitives/std"]
|
||||
|
||||
@@ -27,7 +27,7 @@ extern crate rustc_hex;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
extern crate polkadot_runtime_codec as codec;
|
||||
extern crate polkadot_codec as codec;
|
||||
extern crate polkadot_primitives as primitives;
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
use runtime_std::prelude::*;
|
||||
use support::storage::unhashed::StorageVec;
|
||||
use primitives::SessionKey;
|
||||
use primitives::relay::SessionKey;
|
||||
|
||||
struct AuthorityStorageVec {}
|
||||
impl StorageVec for AuthorityStorageVec {
|
||||
|
||||
@@ -20,8 +20,7 @@ use std::collections::HashMap;
|
||||
use runtime_std::twox_128;
|
||||
use codec::{KeyedVec, Joiner};
|
||||
use support::Hashable;
|
||||
use primitives::relay::{Number as BlockNumber, Block};
|
||||
use primitives::AccountId;
|
||||
use primitives::relay::{Number as BlockNumber, Block, AccountId};
|
||||
use runtime::staking::Balance;
|
||||
|
||||
/// Configuration of a general Polkadot genesis block.
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
use runtime_std::prelude::*;
|
||||
use codec::KeyedVec;
|
||||
use support::storage;
|
||||
use primitives::{AccountId, Hash, BlockNumber};
|
||||
use primitives::relay::Proposal;
|
||||
use primitives::relay::{Proposal, AccountId, Hash, BlockNumber};
|
||||
use runtime::{staking, system, session};
|
||||
|
||||
const APPROVALS_REQUIRED: &[u8] = b"gov:apr";
|
||||
@@ -149,8 +148,7 @@ mod tests {
|
||||
use runtime_std::{with_externalities, twox_128, TestExternalities};
|
||||
use codec::{KeyedVec, Joiner};
|
||||
use support::{one, two, with_env};
|
||||
use primitives::AccountId;
|
||||
use primitives::relay::InternalFunction;
|
||||
use primitives::relay::{AccountId, InternalFunction};
|
||||
use runtime::{staking, session};
|
||||
|
||||
fn new_test_ext() -> TestExternalities {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
use runtime_std::prelude::*;
|
||||
use codec::KeyedVec;
|
||||
use support::{storage, StorageVec};
|
||||
use primitives::{AccountId, SessionKey, BlockNumber};
|
||||
use primitives::relay::{AccountId, SessionKey, BlockNumber};
|
||||
use runtime::{system, staking, consensus};
|
||||
|
||||
const SESSION_LENGTH: &[u8] = b"ses:len";
|
||||
@@ -140,7 +140,7 @@ mod tests {
|
||||
use runtime_std::{with_externalities, twox_128, TestExternalities};
|
||||
use codec::{KeyedVec, Joiner};
|
||||
use support::{one, two, with_env};
|
||||
use primitives::AccountId;
|
||||
use primitives::relay::AccountId;
|
||||
use runtime::{consensus, session};
|
||||
|
||||
fn simple_setup() -> TestExternalities {
|
||||
|
||||
@@ -21,7 +21,7 @@ use runtime_std::cell::RefCell;
|
||||
use runtime_std::print;
|
||||
use codec::KeyedVec;
|
||||
use support::{storage, StorageVec};
|
||||
use primitives::{BlockNumber, AccountId};
|
||||
use primitives::relay::{BlockNumber, AccountId};
|
||||
use runtime::{system, session, governance};
|
||||
|
||||
/// The balance of an account.
|
||||
@@ -216,7 +216,7 @@ mod tests {
|
||||
use runtime_std::{with_externalities, twox_128, TestExternalities};
|
||||
use codec::{KeyedVec, Joiner};
|
||||
use support::{one, two, with_env};
|
||||
use primitives::AccountId;
|
||||
use primitives::relay::AccountId;
|
||||
use runtime::{staking, session};
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -21,8 +21,8 @@ use runtime_std::prelude::*;
|
||||
use runtime_std::{mem, storage_root, enumerated_trie_root};
|
||||
use codec::{KeyedVec, Slicable};
|
||||
use support::{Hashable, storage, with_env};
|
||||
use primitives::{AccountId, Hash, TxOrder, BlockNumber};
|
||||
use primitives::relay::{Block, Header, UncheckedTransaction, Function, Log};
|
||||
use primitives::relay::{AccountId, Hash, TxOrder, BlockNumber, Block, Header, UncheckedTransaction,
|
||||
Function, Log};
|
||||
use runtime::{staking, session};
|
||||
|
||||
const NONCE_OF: &[u8] = b"sys:non:";
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
//! Timestamp manager: just handles the current timestamp.
|
||||
|
||||
use support::storage;
|
||||
use primitives::Timestamp;
|
||||
|
||||
pub type Timestamp = u64;
|
||||
|
||||
const CURRENT_TIMESTAMP: &[u8] = b"tim:val";
|
||||
|
||||
|
||||
@@ -21,8 +21,7 @@ use runtime_std::mem;
|
||||
use runtime_std::cell::RefCell;
|
||||
use runtime_std::rc::Rc;
|
||||
|
||||
use primitives::relay::{BlockNumber, Digest};
|
||||
use primitives::Hash;
|
||||
use primitives::relay::{BlockNumber, Digest, Hash};
|
||||
|
||||
#[derive(Default)]
|
||||
/// The information that can be accessed globally.
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
//! Testing helpers.
|
||||
|
||||
use primitives::AccountId;
|
||||
use primitives::relay::AccountId;
|
||||
use super::statichex::StaticHexInto;
|
||||
|
||||
#[macro_export]
|
||||
|
||||
Reference in New Issue
Block a user