Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Reorganising the repository - external renames and moves #4074

Merged
merged 75 commits into from
Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
fa071ff
Adding first rough ouline of the repository structure
gnunicorn Nov 10, 2019
b2b48ed
Remove old CI stuff
gnunicorn Nov 10, 2019
c0556ea
add title
gnunicorn Nov 10, 2019
425814d
formatting fixes
gnunicorn Nov 10, 2019
4f7d22e
move node-exits job's script to scripts dir
TriplEight Nov 10, 2019
b3c4d8b
Move docs into subdir
gnunicorn Nov 10, 2019
7887f7b
move to bin
gnunicorn Nov 10, 2019
09000f3
move maintainence scripts, configs and helpers into its own dir
gnunicorn Nov 10, 2019
eea9398
add .local to ignore
gnunicorn Nov 10, 2019
a4e451c
move core->client
gnunicorn Nov 10, 2019
bd9cee1
start up 'test' area
gnunicorn Nov 11, 2019
b18dac0
move test client
gnunicorn Nov 11, 2019
a925eea
move test runtime
gnunicorn Nov 11, 2019
8c10e12
make test move compile
gnunicorn Nov 11, 2019
95d9981
Add dependencies rule enforcement.
tomusdrw Nov 11, 2019
0c1814e
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
tomusdrw Nov 11, 2019
c1eb318
Fix indexing.
tomusdrw Nov 11, 2019
26004a7
Update docs to reflect latest changes
gnunicorn Nov 11, 2019
72e690e
Merge remote-tracking branch 'origin/master' into the-big-reorg
gnunicorn Nov 11, 2019
d9ffec8
Moving /srml->/paint
gnunicorn Nov 11, 2019
3266289
update docs
gnunicorn Nov 11, 2019
e04b4fc
move client/sr-* -> primitives/
gnunicorn Nov 11, 2019
ddd0ffb
clean old readme
gnunicorn Nov 11, 2019
83de634
remove old broken code in rhd
gnunicorn Nov 11, 2019
1fd17a8
update lock
gnunicorn Nov 11, 2019
733c0f6
Step 1.
tomusdrw Nov 11, 2019
6adf9af
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
tomusdrw Nov 11, 2019
5080d91
Merge branch 'master' into the-big-reorg
tomusdrw Nov 11, 2019
367819e
starting to untangle client
gnunicorn Nov 11, 2019
1b28184
Fix after merge.
tomusdrw Nov 11, 2019
1a64595
start splitting out client interfaces
gnunicorn Nov 11, 2019
c82823c
Fix the fix.
tomusdrw Nov 11, 2019
8964125
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
gnunicorn Nov 11, 2019
c103b78
move children and blockchain interfaces
gnunicorn Nov 11, 2019
a60c537
Move trie and state-machine to primitives.
tomusdrw Nov 11, 2019
a1984de
Fix WASM builds.
tomusdrw Nov 11, 2019
1ab7ac7
fixing broken imports
gnunicorn Nov 11, 2019
5cbd18d
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
gnunicorn Nov 11, 2019
bc02c35
more interface moves
gnunicorn Nov 11, 2019
f75cfba
move backend and light to interfaces
gnunicorn Nov 12, 2019
f10ee92
move CallExecutor
gnunicorn Nov 12, 2019
224f318
move cli off client
gnunicorn Nov 12, 2019
9c3752d
moving around more interfaces
gnunicorn Nov 12, 2019
4738b9d
re-add consensus crates into the mix
gnunicorn Nov 12, 2019
2cd3316
fix subkey path
gnunicorn Nov 12, 2019
cab5727
relieve client from executor
gnunicorn Nov 12, 2019
ee8bed2
starting to pull out client from grandpa
gnunicorn Nov 12, 2019
2285766
move is_decendent_of out of client
gnunicorn Nov 12, 2019
7376b51
grandpa still depends on client directly
gnunicorn Nov 12, 2019
d288ec0
lemme tests pass
gnunicorn Nov 13, 2019
f0d7d20
Merge branch 'master' into the-big-reorg
tomusdrw Nov 13, 2019
5e60373
rename srml->paint
gnunicorn Nov 13, 2019
9fe4663
Make it compile.
tomusdrw Nov 13, 2019
87c8a75
rename interfaces->client-api
gnunicorn Nov 13, 2019
9b27c66
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
gnunicorn Nov 13, 2019
1feec16
Move keyring to primitives.
tomusdrw Nov 13, 2019
9fab2ba
fixup libp2p dep
gnunicorn Nov 13, 2019
946b624
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
tomusdrw Nov 13, 2019
0c7a49d
fix broken use
gnunicorn Nov 13, 2019
97d78bb
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
tomusdrw Nov 13, 2019
58a3fe1
allow dependency enforcement to fail
gnunicorn Nov 13, 2019
c32b70d
Merge branch 'the-big-reorg' of github.com:paritytech/substrate into …
tomusdrw Nov 13, 2019
48dba8f
Merge branch 'master' into the-big-reorg
tomusdrw Nov 14, 2019
62edb89
move fork-tree
gnunicorn Nov 14, 2019
44effe4
Moving wasm-builder
gnunicorn Nov 14, 2019
191fa20
make env
gnunicorn Nov 14, 2019
b3a7e1f
move build-script-utils
gnunicorn Nov 14, 2019
fb5fc06
Merge branch 'master' into the-big-reorg
tomusdrw Nov 14, 2019
8fb157e
fixup broken crate depdencies and names
gnunicorn Nov 14, 2019
444d41e
fix imports for authority discovery
gnunicorn Nov 14, 2019
be9be03
fix typo
gnunicorn Nov 14, 2019
7b68eda
update cargo.lock
gnunicorn Nov 14, 2019
cc85b0b
fixing imports
gnunicorn Nov 14, 2019
9e849bc
Fix paths and add missing crates
bkchr Nov 14, 2019
a94ed57
re-add missing crates
gnunicorn Nov 14, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move children and blockchain interfaces
  • Loading branch information
gnunicorn committed Nov 11, 2019
commit c103b78f966e8643b25d7461ce2360d0f4d610ed
943 changes: 476 additions & 467 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ header-metadata = { package = "substrate-header-metadata", path = "header-metada
hex-literal = { version = "0.2.1" }
inherents = { package = "substrate-inherents", path = "../primitives/inherents" }
keyring = { package = "substrate-keyring", path = "keyring" }
kvdb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" }
log = { version = "0.4.8" }
parking_lot = { version = "0.9.0" }
primitives = { package = "substrate-primitives", path = "../primitives/core" }
Expand Down
2 changes: 1 addition & 1 deletion client/authority-discovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ prost-build = "0.5.0"
[dependencies]
authority-discovery-primitives = { package = "substrate-authority-discovery-primitives", path = "../../primitives/authority-discovery" }
bytes = "0.4.12"
client = { package = "substrate-client", path = "../" }
interfaces = { package = "substrate-client-interfaces", path = "../interfaces" }
codec = { package = "parity-scale-codec", default-features = false, version = "1.0.3" }
derive_more = "0.15.0"
futures-preview = "0.3.0-alpha.19"
Expand Down
2 changes: 1 addition & 1 deletion client/authority-discovery/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub enum Error {
/// Failed to hash the authority id to be used as a dht key.
HashingAuthorityId(libp2p::core::multiaddr::multihash::EncodeError),
/// Failed calling into the Substrate runtime.
CallingRuntime(client::error::Error),
CallingRuntime(interfaces::error::Error),
/// Failed signing the dht payload via the Substrate runtime.
SigningDhtPayload,
/// From the Dht we only get the hashed authority id. In order to retrieve the actual authority id and to ensure it
Expand Down
36 changes: 18 additions & 18 deletions client/authority-discovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ use futures::Future;
use futures_timer::Interval;

use authority_discovery_primitives::{AuthorityDiscoveryApi, AuthorityId, Signature};
use client::blockchain::HeaderBackend;
use interfaces::blockchain::HeaderBackend;
use error::{Error, Result};
use log::{debug, error, log_enabled, warn};
use network::specialization::NetworkSpecialization;
Expand Down Expand Up @@ -105,7 +105,7 @@ where
Block: BlockT + Unpin + 'static,
Network: NetworkProvider,
Client: ProvideRuntimeApi + Send + Sync + 'static + HeaderBackend<Block>,
<Client as ProvideRuntimeApi>::Api: AuthorityDiscoveryApi<Block, Error = client::error::Error>,
<Client as ProvideRuntimeApi>::Api: AuthorityDiscoveryApi<Block, Error = interfaces::error::Error>,
Self: Future<Output = ()>,
{
/// Return a new authority discovery.
Expand Down Expand Up @@ -303,7 +303,7 @@ where
Block: BlockT + Unpin + 'static,
Network: NetworkProvider,
Client: ProvideRuntimeApi + Send + Sync + 'static + HeaderBackend<Block>,
<Client as ProvideRuntimeApi>::Api: AuthorityDiscoveryApi<Block, Error = client::error::Error>,
<Client as ProvideRuntimeApi>::Api: AuthorityDiscoveryApi<Block, Error = interfaces::error::Error>,
{
type Output = ();

Expand Down Expand Up @@ -430,12 +430,12 @@ mod tests {
fn header(
&self,
_id: BlockId<Block>,
) -> std::result::Result<Option<Block::Header>, client::error::Error> {
) -> std::result::Result<Option<Block::Header>, interfaces::error::Error> {
Ok(None)
}

fn info(&self) -> client::blockchain::Info<Block> {
client::blockchain::Info {
fn info(&self) -> interfaces::blockchain::Info<Block> {
interfaces::blockchain::Info {
best_hash: Default::default(),
best_number: Zero::zero(),
finalized_hash: Default::default(),
Expand All @@ -447,21 +447,21 @@ mod tests {
fn status(
&self,
_id: BlockId<Block>,
) -> std::result::Result<client::blockchain::BlockStatus, client::error::Error> {
Ok(client::blockchain::BlockStatus::Unknown)
) -> std::result::Result<interfaces::blockchain::BlockStatus, interfaces::error::Error> {
Ok(interfaces::blockchain::BlockStatus::Unknown)
}

fn number(
&self,
_hash: Block::Hash,
) -> std::result::Result<Option<NumberFor<Block>>, client::error::Error> {
) -> std::result::Result<Option<NumberFor<Block>>, interfaces::error::Error> {
Ok(None)
}

fn hash(
&self,
_number: NumberFor<Block>,
) -> std::result::Result<Option<Block::Hash>, client::error::Error> {
) -> std::result::Result<Option<Block::Hash>, interfaces::error::Error> {
Ok(None)
}
}
Expand All @@ -475,7 +475,7 @@ mod tests {
_: ExecutionContext,
_: Option<()>,
_: Vec<u8>,
) -> std::result::Result<NativeOrEncoded<RuntimeVersion>, client::error::Error> {
) -> std::result::Result<NativeOrEncoded<RuntimeVersion>, interfaces::error::Error> {
unimplemented!("Not required for testing!")
}

Expand All @@ -485,7 +485,7 @@ mod tests {
_: ExecutionContext,
_: Option<(Block)>,
_: Vec<u8>,
) -> std::result::Result<NativeOrEncoded<()>, client::error::Error> {
) -> std::result::Result<NativeOrEncoded<()>, interfaces::error::Error> {
unimplemented!("Not required for testing!")
}

Expand All @@ -495,13 +495,13 @@ mod tests {
_: ExecutionContext,
_: Option<&<Block as BlockT>::Header>,
_: Vec<u8>,
) -> std::result::Result<NativeOrEncoded<()>, client::error::Error> {
) -> std::result::Result<NativeOrEncoded<()>, interfaces::error::Error> {
unimplemented!("Not required for testing!")
}
}

impl ApiExt<Block> for RuntimeApi {
type Error = client::error::Error;
type Error = interfaces::error::Error;

fn map_api_result<F: FnOnce(&Self) -> std::result::Result<R, E>, R, E>(
&self,
Expand All @@ -513,7 +513,7 @@ mod tests {
fn runtime_version_at(
&self,
_: &BlockId<Block>,
) -> std::result::Result<RuntimeVersion, client::error::Error> {
) -> std::result::Result<RuntimeVersion, interfaces::error::Error> {
unimplemented!("Not required for testing!")
}

Expand All @@ -533,7 +533,7 @@ mod tests {
_: ExecutionContext,
_: Option<()>,
_: Vec<u8>,
) -> std::result::Result<NativeOrEncoded<Vec<AuthorityId>>, client::error::Error> {
) -> std::result::Result<NativeOrEncoded<Vec<AuthorityId>>, interfaces::error::Error> {
return Ok(NativeOrEncoded::Native(vec![
AuthorityId("test-authority-id-1".as_bytes().to_vec()),
AuthorityId("test-authority-id-2".as_bytes().to_vec()),
Expand All @@ -547,7 +547,7 @@ mod tests {
_: Vec<u8>,
) -> std::result::Result<
NativeOrEncoded<Option<(Signature, AuthorityId)>>,
client::error::Error,
interfaces::error::Error,
> {
return Ok(NativeOrEncoded::Native(Some((
Signature("test-signature-1".as_bytes().to_vec()),
Expand All @@ -560,7 +560,7 @@ mod tests {
_: ExecutionContext,
args: Option<(&Vec<u8>, &Signature, &AuthorityId)>,
_: Vec<u8>,
) -> std::result::Result<NativeOrEncoded<bool>, client::error::Error> {
) -> std::result::Result<NativeOrEncoded<bool>, interfaces::error::Error> {
if *args.unwrap().1 == Signature("test-signature-1".as_bytes().to_vec()) {
return Ok(NativeOrEncoded::Native(true));
}
Expand Down
1 change: 1 addition & 0 deletions client/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common", rev="b0317
kvdb-memorydb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" }
linked-hash-map = "0.5.2"
hash-db = "0.15.2"
interfaces = { package = "substrate-client-interfaces", path = "../interfaces" }
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
sr-primitives = { path = "../../primitives/sr-primitives" }
client = { package = "substrate-client", path = "../" }
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion client/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
pub mod light;
pub mod offchain;

mod children;
mod cache;
mod storage_cache;
mod utils;
Expand Down Expand Up @@ -64,7 +65,6 @@ use state_machine::{
};
use crate::utils::{Meta, db_err, meta_keys, read_db, read_meta};
use client::leaves::{LeafSet, FinalizationDisplaced};
use client::children;
use state_db::StateDb;
use header_metadata::{CachedHeaderMetadata, HeaderMetadata, HeaderMetadataCache};
use crate::storage_cache::{CachingState, SharedCache, new_shared_cache};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use parking_lot::Mutex;

use header_metadata::HeaderMetadata;

use interfaces::error::{Error, Result};
use crate::error::{Error, Result};

/// Blockchain database header backend. Does not perform any validation.
pub trait HeaderBackend<Block: BlockT>: Send + Sync {
Expand Down
3 changes: 2 additions & 1 deletion client/interfaces/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pub mod errors;
pub mod errors;
pub mod blockchain;
4 changes: 2 additions & 2 deletions client/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use sr_primitives::{generic::BlockId, Justification, StorageOverlay, ChildrenSto
use sr_primitives::traits::{Block as BlockT, NumberFor};
use state_machine::backend::Backend as StateBackend;
use state_machine::{ChangesTrieStorage as StateChangesTrieStorage, ChangesTrieTransaction};
use crate::blockchain::well_known_cache_keys;
use interfaces::blockchain::well_known_cache_keys;
use consensus::BlockOrigin;
use hash_db::Hasher;
use parking_lot::Mutex;
Expand Down Expand Up @@ -216,7 +216,7 @@ pub trait Backend<Block, H>: AuxStore + Send + Sync where
/// Associated block insertion operation type.
type BlockImportOperation: BlockImportOperation<Block, H, State=Self::State>;
/// Associated blockchain backend type.
type Blockchain: crate::blockchain::Backend<Block>;
type Blockchain: interfaces::blockchain::Backend<Block>;
/// Associated state backend type.
type State: StateBackend<H>;
/// Changes trie storage.
Expand Down
2 changes: 1 addition & 1 deletion client/src/in_mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use interfaces::error;
use crate::backend::{self, NewBlockState, StorageCollection, ChildStorageCollection};
use crate::light;
use crate::leaves::LeafSet;
use crate::blockchain::{
use interfaces::blockchain::{
self, BlockStatus, HeaderBackend, well_known_cache_keys::Id as CacheKeyId
};

Expand Down
7 changes: 3 additions & 4 deletions client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,19 @@
#![warn(missing_docs)]
#![recursion_limit="128"]

pub mod blockchain;
pub mod backend;
pub mod cht;
pub mod in_mem;
pub mod genesis;
pub mod light;
pub mod leaves;
pub mod children;
mod call_executor;
mod client;
mod notifications;

pub use interfaces::error;
pub use crate::blockchain::Info as ChainInfo;
pub use interfaces::blockchain;
pub use interfaces::blockchain::Info as ChainInfo;
pub use crate::call_executor::{CallExecutor, LocalCallExecutor};
pub use crate::client::{
new_with_backend,
Expand All @@ -102,4 +101,4 @@ pub use crate::client::{
pub use crate::notifications::{StorageEventStream, StorageChangeSet};
pub use state_machine::{ExecutionStrategy, StorageProof};
pub use crate::leaves::LeafSet;
pub use crate::blockchain::well_known_cache_keys;
pub use interfaces::blockchain::well_known_cache_keys;
2 changes: 1 addition & 1 deletion client/src/light/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::backend::{
AuxStore, Backend as ClientBackend, BlockImportOperation, RemoteBackend, NewBlockState,
StorageCollection, ChildStorageCollection,
};
use crate::blockchain::{HeaderBackend as BlockchainHeaderBackend, well_known_cache_keys};
use interfaces::blockchain::{HeaderBackend as BlockchainHeaderBackend, well_known_cache_keys};
use interfaces::error::{Error as ClientError, Result as ClientResult};
use crate::light::blockchain::{Blockchain, Storage as BlockchainStorage};
use hash_db::Hasher;
Expand Down
4 changes: 2 additions & 2 deletions client/src/light/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use sr_primitives::traits::{Block as BlockT, Header as HeaderT, NumberFor, Zero}
use header_metadata::{HeaderMetadata, CachedHeaderMetadata};

use crate::backend::{AuxStore, NewBlockState};
use crate::blockchain::{
use interfaces::blockchain::{
Backend as BlockchainBackend, BlockStatus, Cache as BlockchainCache,
HeaderBackend as BlockchainHeaderBackend, Info as BlockchainInfo, ProvideCache,
well_known_cache_keys
Expand Down Expand Up @@ -250,7 +250,7 @@ pub mod tests {
use std::collections::HashMap;
use parking_lot::Mutex;
use test_client::runtime::{Hash, Block, Header};
use crate::blockchain::Info;
use interfaces::blockchain::Info;
use super::*;

pub type DummyBlockchain = Blockchain<DummyStorage>;
Expand Down