From 258182475c6f952acdf4703641b0cf047f6b5a6f Mon Sep 17 00:00:00 2001 From: timorleph <145755355+timorleph@users.noreply.github.com> Date: Fri, 29 Nov 2024 16:29:40 +0100 Subject: [PATCH] Reexport useful traits and types (#500) --- Cargo.lock | 2 +- README.md | 2 +- consensus/Cargo.toml | 2 +- consensus/src/extension/mod.rs | 3 +-- consensus/src/lib.rs | 9 +++++---- consensus/src/member.rs | 7 ++++--- consensus/src/runway/mod.rs | 6 +++--- consensus/src/testing/dag.rs | 3 +-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ac297e40..03882df5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,7 +28,7 @@ dependencies = [ [[package]] name = "aleph-bft" -version = "0.38.2" +version = "0.39.0" dependencies = [ "aleph-bft-mock", "aleph-bft-rmc", diff --git a/README.md b/README.md index 79608255..0a78b290 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ More details are available [in the book][reference-link-implementation-details]. - Import AlephBFT in your crate ```toml [dependencies] - aleph-bft = "^0.38" + aleph-bft = "^0.39" ``` - The main entry point is the `run_session` function, which returns a Future that runs the consensus algorithm. diff --git a/consensus/Cargo.toml b/consensus/Cargo.toml index 819c8983..86b8f5fd 100644 --- a/consensus/Cargo.toml +++ b/consensus/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aleph-bft" -version = "0.38.2" +version = "0.39.0" edition = "2021" authors = ["Cardinal Cryptography"] categories = ["algorithms", "data-structures", "cryptography", "database"] diff --git a/consensus/src/extension/mod.rs b/consensus/src/extension/mod.rs index 2a2f3721..482fd2b7 100644 --- a/consensus/src/extension/mod.rs +++ b/consensus/src/extension/mod.rs @@ -1,10 +1,9 @@ -use crate::{dag::DagUnit, MultiKeychain}; +use crate::{dag::DagUnit, MultiKeychain, UnitFinalizationHandler}; mod election; mod extender; mod units; -use aleph_bft_types::UnitFinalizationHandler; use extender::Extender; /// A struct responsible for executing the Consensus protocol on a local copy of the Dag. diff --git a/consensus/src/lib.rs b/consensus/src/lib.rs index 0260fdd6..70b9ce23 100644 --- a/consensus/src/lib.rs +++ b/consensus/src/lib.rs @@ -20,10 +20,11 @@ mod task_queue; mod testing; pub use aleph_bft_types::{ - Data, DataProvider, Hasher, IncompleteMultisignatureError, Index, Indexed, Keychain, - MultiKeychain, Multisigned, Network, NodeCount, NodeIndex, NodeMap, NodeSubset, - PartialMultisignature, PartiallyMultisigned, Recipient, Round, SessionId, Signable, Signature, - SignatureError, SignatureSet, Signed, SpawnHandle, TaskHandle, UncheckedSigned, + Data, DataProvider, FinalizationHandler, Hasher, IncompleteMultisignatureError, Index, Indexed, + Keychain, MultiKeychain, Multisigned, Network, NodeCount, NodeIndex, NodeMap, NodeSubset, + OrderedUnit, PartialMultisignature, PartiallyMultisigned, Recipient, Round, SessionId, + Signable, Signature, SignatureError, SignatureSet, Signed, SpawnHandle, TaskHandle, + UncheckedSigned, UnitFinalizationHandler, }; pub use config::{ create_config, default_config, default_delay_config, exponential_slowdown, Config, DelayConfig, diff --git a/consensus/src/member.rs b/consensus/src/member.rs index 1681ce56..6bf9ea52 100644 --- a/consensus/src/member.rs +++ b/consensus/src/member.rs @@ -8,10 +8,11 @@ use crate::{ }, task_queue::TaskQueue, units::{UncheckedSignedUnit, Unit, UnitCoord}, - Config, Data, DataProvider, Hasher, MultiKeychain, Network, NodeIndex, Receiver, Recipient, - Round, Sender, Signature, SpawnHandle, Terminator, UncheckedSigned, + Config, Data, DataProvider, FinalizationHandler, Hasher, MultiKeychain, Network, NodeIndex, + OrderedUnit, Receiver, Recipient, Round, Sender, Signature, SpawnHandle, Terminator, + UncheckedSigned, UnitFinalizationHandler, }; -use aleph_bft_types::{FinalizationHandler, NodeMap, OrderedUnit, UnitFinalizationHandler}; +use aleph_bft_types::NodeMap; use codec::{Decode, Encode}; use futures::{channel::mpsc, pin_mut, AsyncRead, AsyncWrite, FutureExt, StreamExt}; use futures_timer::Delay; diff --git a/consensus/src/runway/mod.rs b/consensus/src/runway/mod.rs index cbdc6234..f42cfd39 100644 --- a/consensus/src/runway/mod.rs +++ b/consensus/src/runway/mod.rs @@ -10,10 +10,10 @@ use crate::{ SignedUnit, UncheckedSignedUnit, Unit, UnitCoord, UnitStore, UnitStoreStatus, Validator, WrappedUnit, }, - Config, Data, DataProvider, Hasher, Index, Keychain, MultiKeychain, NodeIndex, Receiver, Round, - Sender, Signature, SpawnHandle, Terminator, UncheckedSigned, + Config, Data, DataProvider, Hasher, Index, Keychain, MultiKeychain, NodeIndex, Receiver, + Recipient, Round, Sender, Signature, SpawnHandle, Terminator, UncheckedSigned, + UnitFinalizationHandler, }; -use aleph_bft_types::{Recipient, UnitFinalizationHandler}; use futures::{ channel::{mpsc, oneshot}, future::pending, diff --git a/consensus/src/testing/dag.rs b/consensus/src/testing/dag.rs index 770fa628..30023b26 100644 --- a/consensus/src/testing/dag.rs +++ b/consensus/src/testing/dag.rs @@ -9,10 +9,9 @@ use crate::{ ControlHash, FullUnit, PreUnit, SignedUnit as GenericSignedUnit, Unit, UnitStore, UnitWithParents as _, Validator, }, - NodeCount, NodeIndex, NodeMap, NodeSubset, Round, Signed, + NodeCount, NodeIndex, NodeMap, NodeSubset, OrderedUnit, Round, Signed, UnitFinalizationHandler, }; use aleph_bft_mock::{Data, Hash64, Hasher64, Keychain}; -use aleph_bft_types::{OrderedUnit, UnitFinalizationHandler}; use log::debug; use parking_lot::Mutex; use rand::{distributions::Open01, prelude::*};