Skip to content
This repository was archived by the owner on Jul 4, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,9 @@ mod tests {

futures::executor::block_on(
service.transaction_pool().maintain(
ChainEvent::NewBlock {
is_new_best: true,
ChainEvent::NewBestBlock {
hash: parent_header.hash(),
tree_route: None,
header: parent_header.clone(),
},
)
);
Expand Down
2 changes: 1 addition & 1 deletion bin/node/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/substrate/"

[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.0" }
codec = { package = "parity-scale-codec", version = "1.3.5" }
node-primitives = { version = "2.0.0-alpha.5", path = "../primitives" }
node-runtime = { version = "2.0.0-alpha.5", path = "../runtime" }
sc-executor = { version = "0.8.0-alpha.5", path = "../../../client/executor" }
Expand Down
2 changes: 1 addition & 1 deletion client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description = "Substrate Client and associated logic."
[dependencies]
sc-block-builder = { version = "0.8.0-alpha.5", path = "block-builder" }
sc-client-api = { version = "2.0.0-alpha.5", path = "api" }
codec = { package = "parity-scale-codec", version = "1.3.0", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "1.3.5", features = ["derive"] }
sp-consensus = { version = "0.8.0-alpha.5", path = "../primitives/consensus/common" }
derive_more = { version = "0.99.2" }
sc-executor = { version = "0.8.0-alpha.5", path = "executor" }
Expand Down
2 changes: 1 addition & 1 deletion client/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ documentation = "https://docs.rs/sc-client-api"


[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "1.3.5", default-features = false, features = ["derive"] }
sp-consensus = { version = "0.8.0-alpha.5", path = "../../primitives/consensus/common" }
derive_more = { version = "0.99.2" }
sc-executor = { version = "0.8.0-alpha.5", path = "../executor" }
Expand Down
20 changes: 12 additions & 8 deletions client/api/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//! A set of APIs supported by the client along with their primitives.

use std::{fmt, collections::HashSet, sync::Arc};
use std::{fmt, collections::HashSet, sync::Arc, convert::TryFrom};
use sp_core::storage::StorageKey;
use sp_runtime::{
traits::{Block as BlockT, NumberFor},
Expand Down Expand Up @@ -245,13 +245,17 @@ pub struct FinalityNotification<Block: BlockT> {
pub header: Block::Header,
}

impl<B: BlockT> From<BlockImportNotification<B>> for sp_transaction_pool::ChainEvent<B> {
fn from(n: BlockImportNotification<B>) -> Self {
Self::NewBlock {
is_new_best: n.is_new_best,
hash: n.hash,
header: n.header,
tree_route: n.tree_route,
impl<B: BlockT> TryFrom<BlockImportNotification<B>> for sp_transaction_pool::ChainEvent<B> {
type Error = ();

fn try_from(n: BlockImportNotification<B>) -> Result<Self, ()> {
if n.is_new_best {
Ok(Self::NewBestBlock {
hash: n.hash,
tree_route: n.tree_route,
})
} else {
Err(())
}
}
}
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 @@ -14,7 +14,7 @@ prost-build = "0.6.1"

[dependencies]
bytes = "0.5.0"
codec = { package = "parity-scale-codec", default-features = false, version = "1.3.0" }
codec = { package = "parity-scale-codec", version = "1.3.5", default-features = false }
derive_more = "0.99.2"
futures = "0.3.4"
futures-timer = "3.0.1"
Expand Down
4 changes: 2 additions & 2 deletions client/authority-discovery/src/addr_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ where
return;
}

addresses.sort_unstable_by(|a, b| a.as_ref().cmp(b.as_ref()));
addresses.sort_by(|a, b| a.as_ref().cmp(b.as_ref()));
self.cache.insert(id, addresses);
}

Expand All @@ -89,7 +89,7 @@ where
.collect::<Vec<Addr>>();

addresses.dedup();
addresses.sort_unstable_by(|a, b| a.as_ref().cmp(b.as_ref()));
addresses.sort_by(|a, b| a.as_ref().cmp(b.as_ref()));

addresses
.choose_multiple(&mut rng, MAX_NUM_AUTHORITY_CONN)
Expand Down
2 changes: 1 addition & 1 deletion client/basic-authorship/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description = "Basic implementation of block-authoring logic."
[dependencies]
log = "0.4.8"
futures = "0.3.4"
codec = { package = "parity-scale-codec", version = "1.3.0" }
codec = { package = "parity-scale-codec", version = "1.3.5" }
sp-api = { version = "2.0.0-alpha.5", path = "../../primitives/api" }
sp-runtime = { version = "2.0.0-alpha.5", path = "../../primitives/runtime" }
sp-core = { version = "2.0.0-alpha.5", path = "../../primitives/core" }
Expand Down
4 changes: 1 addition & 3 deletions client/basic-authorship/src/basic_authorship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,9 @@ mod tests {
fn chain_event<B: BlockT>(header: B::Header) -> ChainEvent<B>
where NumberFor<B>: From<u64>
{
ChainEvent::NewBlock {
ChainEvent::NewBestBlock {
hash: header.hash(),
tree_route: None,
is_new_best: true,
header,
}
}

Expand Down
2 changes: 1 addition & 1 deletion client/block-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sp-blockchain = { version = "2.0.0-alpha.5", path = "../../primitives/blockchain
sp-core = { version = "2.0.0-alpha.5", path = "../../primitives/core" }
sp-block-builder = { version = "2.0.0-alpha.5", path = "../../primitives/block-builder" }
sc-client-api = { version = "2.0.0-alpha.5", path = "../api" }
codec = { package = "parity-scale-codec", version = "1.3.0", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "1.3.5", features = ["derive"] }

[dev-dependencies]
substrate-test-runtime-client = { path = "../../test-utils/runtime/client" }
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/aura/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sp-block-builder = { version = "2.0.0-alpha.5", path = "../../../primitives/bloc
sc-block-builder = { version = "0.8.0-alpha.5", path = "../../../client/block-builder" }
sc-client = { version = "0.8.0-alpha.5", path = "../../" }
sc-client-api = { version = "2.0.0-alpha.5", path = "../../api" }
codec = { package = "parity-scale-codec", version = "1.3.0" }
codec = { package = "parity-scale-codec", version = "1.3.5" }
sp-consensus = { version = "0.8.0-alpha.5", path = "../../../primitives/consensus/common" }
derive_more = "0.99.2"
futures = "0.3.4"
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/babe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repository = "https://github.com/paritytech/substrate/"
documentation = "https://docs.rs/sc-consensus-babe"

[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.0", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "1.3.5", features = ["derive"] }
sp-consensus-babe = { version = "0.8.0-alpha.5", path = "../../../primitives/consensus/babe" }
sp-core = { version = "2.0.0-alpha.5", path = "../../../primitives/core" }
sp-application-crypto = { version = "2.0.0-alpha.5", path = "../../../primitives/application-crypto" }
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/epochs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/substrate/"

[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.0", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "1.3.5", features = ["derive"] }
parking_lot = "0.10.0"
fork-tree = { version = "2.0.0-alpha.5", path = "../../../utils/fork-tree" }
sp-runtime = { path = "../../../primitives/runtime" , version = "2.0.0-alpha.5"}
Expand Down
14 changes: 7 additions & 7 deletions client/consensus/manual-seal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ mod tests {
use sc_client::LongestChain;
use sp_inherents::InherentDataProviders;
use sc_basic_authorship::ProposerFactory;
use sc_client_api::BlockBackend;

fn api() -> Arc<TestApi> {
Arc::new(TestApi::empty())
Expand Down Expand Up @@ -443,15 +444,13 @@ mod tests {
}
}
);
// assert that there's a new block in the db.
assert!(client.header(&BlockId::Number(0)).unwrap().is_some());
let block = client.block(&BlockId::Number(1)).unwrap().unwrap().block;
pool_api.add_block(block, true);
assert!(pool.submit_one(&BlockId::Number(1), SOURCE, uxt(Alice, 1)).await.is_ok());

let header = client.header(&BlockId::Number(1)).expect("db error").expect("imported above");
pool.maintain(sp_transaction_pool::ChainEvent::NewBlock {
pool.maintain(sp_transaction_pool::ChainEvent::NewBestBlock {
hash: header.hash(),
header,
is_new_best: true,
tree_route: None,
}).await;

Expand All @@ -466,10 +465,11 @@ mod tests {
rx1.await.expect("should be no error receiving"),
Ok(_)
);
assert!(client.header(&BlockId::Number(1)).unwrap().is_some());
let block = client.block(&BlockId::Number(2)).unwrap().unwrap().block;
pool_api.add_block(block, true);
pool_api.increment_nonce(Alice.into());

assert!(pool.submit_one(&BlockId::Number(2), SOURCE, uxt(Alice, 2)).await.is_ok());
assert!(pool.submit_one(&BlockId::Number(1), SOURCE, uxt(Alice, 2)).await.is_ok());
let (tx2, rx2) = futures::channel::oneshot::channel();
assert!(sink.send(EngineCommand::SealNewBlock {
parent_hash: Some(created_block.hash),
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/pow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/substrate/"

[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.0", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "1.3.5", features = ["derive"] }
sp-core = { version = "2.0.0-alpha.5", path = "../../../primitives/core" }
sp-blockchain = { version = "2.0.0-alpha.5", path = "../../../primitives/blockchain" }
sp-runtime = { version = "2.0.0-alpha.5", path = "../../../primitives/runtime" }
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/slots/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/substrate/"

[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.0" }
codec = { package = "parity-scale-codec", version = "1.3.5" }
sc-client-api = { version = "2.0.0-alpha.5", path = "../../api" }
sp-core = { version = "2.0.0-alpha.5", path = "../../../primitives/core" }
sp-blockchain = { version = "2.0.0-alpha.5", path = "../../../primitives/blockchain" }
Expand Down
2 changes: 1 addition & 1 deletion client/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kvdb-memorydb = "0.5.0"
linked-hash-map = "0.5.2"
hash-db = "0.15.2"
parity-util-mem = { version = "0.6.0", default-features = false, features = ["std"] }
codec = { package = "parity-scale-codec", version = "1.3.0", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "1.3.5", features = ["derive"] }

sc-client-api = { version = "2.0.0-alpha.5", path = "../api" }
sp-core = { version = "2.0.0-alpha.5", path = "../../primitives/core" }
Expand Down
2 changes: 1 addition & 1 deletion client/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ documentation = "https://docs.rs/sc-executor"

[dependencies]
derive_more = "0.99.2"
codec = { package = "parity-scale-codec", version = "1.3.0" }
codec = { package = "parity-scale-codec", version = "1.3.5" }
sp-io = { version = "2.0.0-alpha.5", path = "../../primitives/io" }
sp-core = { version = "2.0.0-alpha.5", path = "../../primitives/core" }
sp-trie = { version = "2.0.0-alpha.5", path = "../../primitives/trie" }
Expand Down
2 changes: 1 addition & 1 deletion client/executor/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ documentation = "https://docs.rs/sc-executor-common/"
[dependencies]
log = "0.4.8"
derive_more = "0.99.2"
codec = { package = "parity-scale-codec", version = "1.3.0" }
codec = { package = "parity-scale-codec", version = "1.3.5" }
wasmi = "0.6.2"
sp-core = { version = "2.0.0-alpha.5", path = "../../../primitives/core" }
sp-allocator = { version = "2.0.0-alpha.5", path = "../../../primitives/allocator" }
Expand Down
2 changes: 1 addition & 1 deletion client/executor/wasmi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ documentation = "https://docs.rs/sc-execturo-wasmi"
log = "0.4.8"
wasmi = "0.6.2"
parity-wasm = "0.41.0"
codec = { package = "parity-scale-codec", version = "1.3.0" }
codec = { package = "parity-scale-codec", version = "1.3.5" }
sc-executor-common = { version = "0.8.0-alpha.5", path = "../common" }
sp-wasm-interface = { version = "2.0.0-alpha.5", path = "../../../primitives/wasm-interface" }
sp-runtime-interface = { version = "2.0.0-alpha.5", path = "../../../primitives/runtime-interface" }
Expand Down
2 changes: 1 addition & 1 deletion client/executor/wasmtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description = "Defines a `WasmRuntime` that uses the Wasmtime JIT to execute."
log = "0.4.8"
scoped-tls = "1.0"
parity-wasm = "0.41.0"
codec = { package = "parity-scale-codec", version = "1.3.0" }
codec = { package = "parity-scale-codec", version = "1.3.5" }
sc-executor-common = { version = "0.8.0-alpha.5", path = "../common" }
sp-wasm-interface = { version = "2.0.0-alpha.5", path = "../../../primitives/wasm-interface" }
sp-runtime-interface = { version = "2.0.0-alpha.5", path = "../../../primitives/runtime-interface" }
Expand Down
2 changes: 1 addition & 1 deletion client/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ prost-build = "0.6.1"
[dependencies]
bitflags = "1.2.0"
bytes = "0.5.0"
codec = { package = "parity-scale-codec", version = "1.3.0", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "1.3.5", features = ["derive"] }
derive_more = "0.99.2"
either = "1.5.3"
erased-serde = "0.3.9"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl RegisteredProtocol {
id: protocol,
supported_versions: {
let mut tmp = versions.to_vec();
tmp.sort_unstable_by(|a, b| b.cmp(&a));
tmp.sort_by(|a, b| b.cmp(&a));
tmp
},
}
Expand Down
2 changes: 1 addition & 1 deletion client/offchain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ log = "0.4.8"
threadpool = "1.7"
num_cpus = "1.10"
sp-offchain = { version = "2.0.0-alpha.5", path = "../../primitives/offchain" }
codec = { package = "parity-scale-codec", version = "1.3.0", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "1.3.5", features = ["derive"] }
parking_lot = "0.10.0"
sp-core = { version = "2.0.0-alpha.5", path = "../../primitives/core" }
rand = "0.7.2"
Expand Down
2 changes: 1 addition & 1 deletion client/rpc-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repository = "https://github.com/paritytech/substrate/"
description = "Substrate RPC interfaces."

[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.0" }
codec = { package = "parity-scale-codec", version = "1.3.5" }
derive_more = "0.99.2"
futures = { version = "0.3.1", features = ["compat"] }
jsonrpc-core = "14.0.3"
Expand Down
2 changes: 1 addition & 1 deletion client/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sc-rpc-api = { version = "0.8.0-alpha.5", path = "../rpc-api" }
sc-client-api = { version = "2.0.0-alpha.5", path = "../api" }
sc-client = { version = "0.8.0-alpha.5", path = "../" }
sp-api = { version = "2.0.0-alpha.5", path = "../../primitives/api" }
codec = { package = "parity-scale-codec", version = "1.3.0" }
codec = { package = "parity-scale-codec", version = "1.3.5" }
futures = { version = "0.3.1", features = ["compat"] }
jsonrpc-pubsub = "14.0.3"
log = "0.4.8"
Expand Down
2 changes: 1 addition & 1 deletion client/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ sc-client-api = { version = "2.0.0-alpha.5", path = "../api" }
sc-client = { version = "0.8.0-alpha.5", path = "../" }
sp-api = { version = "2.0.0-alpha.5", path = "../../primitives/api" }
sc-client-db = { version = "0.8.0-alpha.5", path = "../db" }
codec = { package = "parity-scale-codec", version = "1.3.0" }
codec = { package = "parity-scale-codec", version = "1.3.5" }
sc-executor = { version = "0.8.0-alpha.5", path = "../executor" }
sc-transaction-pool = { version = "2.0.0-rc3", path = "../transaction-pool" }
sp-transaction-pool = { version = "2.0.0-rc2", path = "../../primitives/transaction-pool" }
Expand Down
2 changes: 1 addition & 1 deletion client/state-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ parking_lot = "0.10.0"
log = "0.4.8"
sc-client-api = { version = "2.0.0-alpha.5", path = "../api" }
sp-core = { version = "2.0.0-alpha.5", path = "../../primitives/core" }
codec = { package = "parity-scale-codec", version = "1.3.0", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "1.3.5", features = ["derive"] }
parity-util-mem = "0.6"
parity-util-mem-derive = "0.1.0"

Expand Down
2 changes: 1 addition & 1 deletion client/transaction-pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description = "Substrate transaction pool implementation."
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.0" }
codec = { package = "parity-scale-codec", version = "1.3.5" }
derive_more = "0.99.2"
futures = { version = "0.3.1", features = ["compat"] }
futures-diagnose = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion client/transaction-pool/graph/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ linked-hash-map = "0.5.2"

[dev-dependencies]
assert_matches = "1.3.0"
codec = { package = "parity-scale-codec", version = "1.3.0" }
codec = { package = "parity-scale-codec", version = "1.3.5" }
substrate-test-runtime = { version = "2.0.0-alpha.5", path = "../../../test-utils/runtime" }
criterion = "0.3"

Expand Down
Loading