combine relay chain primitives into one module

This commit is contained in:
Robert Habermeier
2018-02-06 18:30:21 +01:00
parent 6672cf5196
commit 8bae8510f6
28 changed files with 47 additions and 47 deletions
+2 -5
View File
@@ -65,12 +65,11 @@ macro_rules! try_opt {
}
mod bytes;
pub mod block;
pub mod contract;
pub mod hash;
pub mod hexdisplay;
pub mod parachain;
pub mod transaction;
pub mod relay;
pub mod uint;
pub mod validator;
@@ -81,6 +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")]
@@ -101,9 +101,6 @@ pub type SessionKey = AccountId;
/// Indentifier for a chain.
pub type ChainID = u64;
/// Index of a block in the chain.
pub type BlockNumber = u64;
/// Index of a transaction.
pub type TxOrder = u64;
@@ -22,7 +22,7 @@ use bytes::Vec;
use codec::Slicable;
use hash::H256;
use parachain;
use transaction::UncheckedTransaction;
use relay::transaction::UncheckedTransaction;
/// Used to refer to a block number.
pub type Number = u64;
+9
View File
@@ -0,0 +1,9 @@
//! Relay chain primitives.
pub mod block;
pub mod transaction;
pub use self::block::*;
pub use self::transaction::*;
pub use self::block::Number as BlockNumber;
@@ -25,7 +25,7 @@ use std::fmt;
#[cfg(not(feature = "std"))]
use alloc::fmt;
use block::Number as BlockNumber;
use relay::block::Number as BlockNumber;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
@@ -217,7 +217,7 @@ pub enum Function {
/// Make a proposal for the governance system.
GovernancePropose(Proposal),
/// Approve a proposal for the governance system.
GovernanceApprove(::block::Number),
GovernanceApprove(BlockNumber),
}
impl Slicable for Function {
+2 -2
View File
@@ -19,8 +19,8 @@
use codec::Slicable;
use ::AccountId;
use block::{Block, Header, Digest, Log};
use transaction::{UncheckedTransaction, Transaction, Function};
use relay::block::{Block, Header, Digest, Log};
use relay::transaction::{UncheckedTransaction, Transaction, Function};
#[test]
fn serialise_transaction_works() {