This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* sc-light * remove unused deps * fix line width * move more fns to sc_light
- Loading branch information
1 parent
4b1d862
commit 6c01b10
Showing
18 changed files
with
145 additions
and
63 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[package] | ||
description = "components for a light client" | ||
name = "sc-light" | ||
version = "2.0.0-rc3" | ||
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" | ||
authors = ["Parity Technologies <admin@parity.io>"] | ||
edition = "2018" | ||
homepage = "https://substrate.dev" | ||
repository = "https://github.com/paritytech/substrate/" | ||
documentation = "https://docs.rs/sc-light" | ||
|
||
[dependencies] | ||
parking_lot = "0.10.0" | ||
lazy_static = "1.4.0" | ||
hash-db = "0.15.2" | ||
sp-runtime = { version = "2.0.0-rc2", path = "../../primitives/runtime" } | ||
sp-externalities = { version = "0.8.0-rc2", path = "../../primitives/externalities" } | ||
sp-blockchain = { version = "2.0.0-rc2", path = "../../primitives/blockchain" } | ||
sp-core = { version = "2.0.0-rc2", path = "../../primitives/core" } | ||
sp-state-machine = { version = "0.8.0-rc2", path = "../../primitives/state-machine" } | ||
sc-client-api = { version = "2.0.0-rc2", path = "../api" } | ||
sp-api = { version = "2.0.0-rc2", path = "../../primitives/api" } | ||
codec = { package = "parity-scale-codec", version = "1.3.0" } | ||
sc-executor = { version = "0.8.0-rc2", path = "../executor" } | ||
|
||
[features] | ||
default = [] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// This file is part of Substrate. | ||
|
||
// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd. | ||
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 | ||
|
||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
//! Light client components. | ||
use sp_runtime::traits::{Block as BlockT, HashFor}; | ||
use sc_client_api::CloneableSpawn; | ||
use std::sync::Arc; | ||
use sp_core::traits::CodeExecutor; | ||
|
||
pub mod backend; | ||
pub mod blockchain; | ||
pub mod call_executor; | ||
pub mod fetcher; | ||
|
||
pub use {backend::*, blockchain::*, call_executor::*, fetcher::*}; | ||
|
||
/// Create an instance of fetch data checker. | ||
pub fn new_fetch_checker<E, B: BlockT, S: BlockchainStorage<B>>( | ||
blockchain: Arc<Blockchain<S>>, | ||
executor: E, | ||
spawn_handle: Box<dyn CloneableSpawn>, | ||
) -> LightDataChecker<E, HashFor<B>, B, S> | ||
where | ||
E: CodeExecutor, | ||
{ | ||
LightDataChecker::new(blockchain, executor, spawn_handle) | ||
} | ||
|
||
/// Create an instance of light client blockchain backend. | ||
pub fn new_light_blockchain<B: BlockT, S: BlockchainStorage<B>>(storage: S) -> Arc<Blockchain<S>> { | ||
Arc::new(Blockchain::new(storage)) | ||
} | ||
|
||
/// Create an instance of light client backend. | ||
pub fn new_light_backend<B, S>(blockchain: Arc<Blockchain<S>>) -> Arc<Backend<S, HashFor<B>>> | ||
where | ||
B: BlockT, | ||
S: BlockchainStorage<B>, | ||
{ | ||
Arc::new(Backend::new(blockchain)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.