Skip to content

Commit

Permalink
[State Sync] Added unit tests for the bootstrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLind authored and aptos-bot committed Apr 26, 2022
1 parent 1a22183 commit 9dfb47e
Show file tree
Hide file tree
Showing 7 changed files with 806 additions and 25 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions state-sync/state-sync-v2/state-sync-driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ storage-interface = { path = "../../../storage/storage-interface" }

[dev-dependencies]
anyhow = "1.0.52"
async-trait = "0.1.42"
bcs = "0.1.2"
claim = "0.5.0"
mockall = "0.11.0"
Expand All @@ -49,4 +50,5 @@ executor-test-helpers = { path = "../../../execution/executor-test-helpers" }
move-core-types = { git = "https://github.com/move-language/move", rev = "1b6b7513dcc1a5c866f178ca5c1e74beb2ce181e", features=["address32"] }
network = { path = "../../../network", features = ["fuzzing"] }
storage-service-client = { path = "../../storage-service/client" }
storage-service-types = { path = "../../storage-service/types" }
vm-genesis = { path = "../../../aptos-move/vm-genesis", features = ["fuzzing"] }
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use storage_interface::DbReader;

/// A simple container for verified epoch states and epoch ending ledger infos
/// that have been fetched from the network.
struct VerifiedEpochStates {
pub(crate) struct VerifiedEpochStates {
// If new epoch ending ledger infos have been fetched from the network
fetched_epoch_ending_ledger_infos: bool,

Expand Down Expand Up @@ -1296,4 +1296,10 @@ impl<
self.speculative_stream_state = None;
self.active_data_stream = None;
}

/// Returns the verified epoch states struct for testing purposes.
#[cfg(test)]
pub(crate) fn get_verified_epoch_states(&mut self) -> &mut VerifiedEpochStates {
&mut self.verified_epoch_states
}
}
Loading

0 comments on commit 9dfb47e

Please sign in to comment.