-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f9688a
commit 7a6cfdf
Showing
10 changed files
with
134 additions
and
28 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
testing/jormungandr-integration-tests/src/jormungandr/bft/mod.rs
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
pub mod mempool; | ||
pub mod start_node; | ||
mod mempool; | ||
mod start_node; |
40 changes: 40 additions & 0 deletions
40
testing/jormungandr-integration-tests/src/jormungandr/block.rs
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,40 @@ | ||
use assert_fs::TempDir; | ||
use chain_impl_mockchain::chaintypes::ConsensusType; | ||
use jormungandr_lib::interfaces::SlotDuration; | ||
use jormungandr_testing_utils::testing::{ | ||
adversary::process::AdversaryNodeBuilder, | ||
jormungandr::{ConfigurationBuilder, Starter}, | ||
network::LeadershipMode, | ||
node::grpc::server::ProtocolVersion, | ||
Block0ConfigurationBuilder, | ||
}; | ||
|
||
#[test] | ||
/// Ensures that the genesis block fetched during bootstrapping is the requested one | ||
fn block0_with_incorrect_hash() { | ||
let block0 = Block0ConfigurationBuilder::new() | ||
.with_slot_duration(SlotDuration::new(10).unwrap()) | ||
.with_block0_consensus(ConsensusType::GenesisPraos) | ||
.build() | ||
.to_block(); | ||
|
||
let adversary = AdversaryNodeBuilder::new(block0) | ||
.with_protocol_version(ProtocolVersion::GenesisPraos) | ||
.with_invalid_block0_hash() | ||
.with_server_enabled() | ||
.build(); | ||
|
||
let passive_temp_dir = TempDir::new().unwrap(); | ||
|
||
let passive_params = ConfigurationBuilder::default() | ||
.with_block0_consensus(ConsensusType::GenesisPraos) | ||
.with_trusted_peers(vec![adversary.to_trusted_peer()]) | ||
.with_block_hash(format!("{}", adversary.genesis_block_hash())) | ||
.build(&passive_temp_dir); | ||
|
||
Starter::default() | ||
.config(passive_params) | ||
.leadership_mode(LeadershipMode::Passive) | ||
.start_with_fail_in_logs("failed to download block") | ||
.unwrap(); | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod bft; | ||
pub mod block; | ||
pub mod cors; | ||
pub mod explorer; | ||
pub mod fragments; | ||
|
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