Skip to content

Commit

Permalink
[State Sync] Remove redundant data types and update dependencies.
Browse files Browse the repository at this point in the history
Closes: #9057
  • Loading branch information
JoshLind authored and ankitkacn committed Jan 3, 2023
1 parent ab757e9 commit 3deb47c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 32 deletions.
19 changes: 18 additions & 1 deletion Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -147,6 +147,7 @@ members = [
"secure/storage",
"secure/storage/github",
"secure/storage/vault",
"state-sync/inter-component/consensus-notifications",
"state-sync/inter-component/mempool-notifications",
"state-sync/state-sync-v1",
"state-sync/state-sync-v2",
Expand Down
2 changes: 1 addition & 1 deletion mempool/src/lib.rs
Expand Up @@ -60,7 +60,7 @@ mod tests;
pub use shared_mempool::{
bootstrap, network,
types::{
gen_mempool_reconfig_subscription, CommitResponse, ConsensusRequest, ConsensusResponse,
gen_mempool_reconfig_subscription, ConsensusRequest, ConsensusResponse,
MempoolClientSender, SubmissionStatus, TransactionExclusion,
},
};
Expand Down
25 changes: 0 additions & 25 deletions mempool/src/shared_mempool/types.rs
Expand Up @@ -166,31 +166,6 @@ pub enum ConsensusResponse {
CommitResponse(),
}

#[derive(Debug)]
pub struct CommitResponse {
pub success: bool,
/// The error message if `success` is false.
pub error_message: Option<String>,
}

impl CommitResponse {
// Returns a new CommitResponse without an error.
pub fn success() -> Self {
CommitResponse {
success: true,
error_message: None,
}
}

// Returns a new CommitResponse holding the given error message.
pub fn error(error_message: String) -> Self {
CommitResponse {
success: false,
error_message: Some(error_message),
}
}
}

#[derive(Clone)]
pub struct TransactionExclusion {
pub sender: AccountAddress,
Expand Down
4 changes: 2 additions & 2 deletions state-sync/inter-component/consensus-notifications/Cargo.toml
Expand Up @@ -16,9 +16,9 @@ serde = { version = "1.0.124", default-features = false }
thiserror = "1.0.24"
tokio = { version = "1.8.1" }

diem-crypto = { path = "../../../crypto/crypto" }
diem-crypto = { path = "../../../crates/diem-crypto" }
diem-types = { path = "../../../types" }
diem-workspace-hack = { path = "../../../common/workspace-hack" }
diem-workspace-hack = { path = "../../../crates/diem-workspace-hack" }

[dev-dependencies]
move-core-types = { path = "../../../language/move-core/types" }
4 changes: 2 additions & 2 deletions state-sync/inter-component/mempool-notifications/Cargo.toml
Expand Up @@ -17,7 +17,7 @@ thiserror = "1.0.24"
tokio = { version = "1.8.1" }

diem-types = { path = "../../../types" }
diem-workspace-hack = { path = "../../../common/workspace-hack" }
diem-workspace-hack = { path = "../../../crates/diem-workspace-hack" }

[dev-dependencies]
diem-crypto = { path = "../../../crypto/crypto" }
diem-crypto = { path = "../../../crates/diem-crypto" }
2 changes: 1 addition & 1 deletion state-sync/state-sync-v1/Cargo.toml
Expand Up @@ -52,7 +52,7 @@ bytes = "1.0.1"
proptest = "1.0.0"

consensus-notifications = { path = "../inter-component/consensus-notifications" }
channel = { path = "../../common/channel" }
channel = { path = "../../crates/channel" }
diem-framework-releases= { path = "../../language/diem-framework/releases" }
diem-crypto = { path = "../../crates/diem-crypto" }
diem-genesis-tool = {path = "../../config/management/genesis", features = ["testing"] }
Expand Down

0 comments on commit 3deb47c

Please sign in to comment.