diff --git a/crates/core/app/src/genesis.rs b/crates/core/app/src/genesis.rs index 32d01944bf..8b07b24b68 100644 --- a/crates/core/app/src/genesis.rs +++ b/crates/core/app/src/genesis.rs @@ -173,6 +173,10 @@ impl DomainType for AppState { } impl Content { + pub fn with_chain_id(self, chain_id: String) -> Self { + Self { chain_id, ..self } + } + pub fn with_epoch_duration(self, epoch_duration: u64) -> Self { Self { sct_content: penumbra_sct::genesis::Content { diff --git a/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs b/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs index b783bf2db4..e06d07c97b 100644 --- a/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs +++ b/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs @@ -35,8 +35,11 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { let storage = TempStorage::new().await?; // Configure an AppState with slightly shorter epochs than usual. - let app_state = - AppState::Content(genesis::Content::default().with_epoch_duration(EPOCH_DURATION)); + let app_state = AppState::Content( + genesis::Content::default() + .with_epoch_duration(EPOCH_DURATION) + .with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), + ); // Start the test node. let mut node = { diff --git a/crates/core/app/tests/app_can_deposit_into_community_pool.rs b/crates/core/app/tests/app_can_deposit_into_community_pool.rs index ecdee26f92..3c927dca19 100644 --- a/crates/core/app/tests/app_can_deposit_into_community_pool.rs +++ b/crates/core/app/tests/app_can_deposit_into_community_pool.rs @@ -2,7 +2,10 @@ use { self::common::BuilderExt, anyhow::anyhow, cnidarium::TempStorage, - penumbra_app::{genesis::AppState, server::consensus::Consensus}, + penumbra_app::{ + genesis::{self, AppState}, + server::consensus::Consensus, + }, penumbra_asset::asset, penumbra_community_pool::{CommunityPoolDeposit, StateReadExt}, penumbra_keys::test_keys, @@ -29,7 +32,9 @@ async fn app_can_deposit_into_community_pool() -> anyhow::Result<()> { // Define our application state, and start the test node. let mut test_node = { - let app_state = AppState::default(); + let app_state = AppState::Content( + genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), + ); let consensus = Consensus::new(storage.as_ref().clone()); TestNode::builder() .single_validator() diff --git a/crates/core/app/tests/app_can_disable_community_pool_spends.rs b/crates/core/app/tests/app_can_disable_community_pool_spends.rs index 3648b06bba..e53944e7bf 100644 --- a/crates/core/app/tests/app_can_disable_community_pool_spends.rs +++ b/crates/core/app/tests/app_can_disable_community_pool_spends.rs @@ -111,6 +111,7 @@ async fn app_can_disable_community_pool_spends() -> anyhow::Result<()> { // Define our application state, and start the test node. let mut test_node = { let mut content = Content { + chain_id: TestNode::<()>::CHAIN_ID.to_string(), governance_content: penumbra_governance::genesis::Content { governance_params: penumbra_governance::params::GovernanceParameters { proposal_deposit_amount: 0_u32.into(), diff --git a/crates/core/app/tests/app_can_propose_community_pool_spends.rs b/crates/core/app/tests/app_can_propose_community_pool_spends.rs index fe308b9761..f399de85f9 100644 --- a/crates/core/app/tests/app_can_propose_community_pool_spends.rs +++ b/crates/core/app/tests/app_can_propose_community_pool_spends.rs @@ -111,6 +111,7 @@ async fn app_can_propose_community_pool_spends() -> anyhow::Result<()> { // Define our application state, and start the test node. let mut test_node = { let mut content = Content { + chain_id: TestNode::<()>::CHAIN_ID.to_string(), governance_content: penumbra_governance::genesis::Content { governance_params: penumbra_governance::params::GovernanceParameters { proposal_deposit_amount: 0_u32.into(), diff --git a/crates/core/app/tests/app_can_spend_notes_and_detect_outputs.rs b/crates/core/app/tests/app_can_spend_notes_and_detect_outputs.rs index 547525cca6..0372c448a7 100644 --- a/crates/core/app/tests/app_can_spend_notes_and_detect_outputs.rs +++ b/crates/core/app/tests/app_can_spend_notes_and_detect_outputs.rs @@ -2,7 +2,10 @@ use { self::common::BuilderExt, anyhow::anyhow, cnidarium::TempStorage, - penumbra_app::{genesis::AppState, server::consensus::Consensus}, + penumbra_app::{ + genesis::{self, AppState}, + server::consensus::Consensus, + }, penumbra_keys::test_keys, penumbra_mock_client::MockClient, penumbra_mock_consensus::TestNode, @@ -26,7 +29,9 @@ async fn app_can_spend_notes_and_detect_outputs() -> anyhow::Result<()> { let guard = common::set_tracing_subscriber(); let storage = TempStorage::new().await?; let mut test_node = { - let app_state = AppState::default(); + let app_state = AppState::Content( + genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), + ); let consensus = Consensus::new(storage.as_ref().clone()); TestNode::builder() .single_validator() diff --git a/crates/core/app/tests/app_can_undelegate_from_a_validator.rs b/crates/core/app/tests/app_can_undelegate_from_a_validator.rs index 12365df179..bc6e34d1f9 100644 --- a/crates/core/app/tests/app_can_undelegate_from_a_validator.rs +++ b/crates/core/app/tests/app_can_undelegate_from_a_validator.rs @@ -60,6 +60,7 @@ async fn app_can_undelegate_from_a_validator() -> anyhow::Result<()> { // Configure an AppState with slightly shorter epochs than usual. let app_state = AppState::Content( genesis::Content::default() + .with_chain_id(TestNode::<()>::CHAIN_ID.to_string()) .with_epoch_duration(EPOCH_DURATION) .with_unbonding_delay(UNBONDING_DELAY), ); diff --git a/crates/core/app/tests/app_rejects_validator_definitions_with_invalid_auth_sigs.rs b/crates/core/app/tests/app_rejects_validator_definitions_with_invalid_auth_sigs.rs index a245d03488..4013a20524 100644 --- a/crates/core/app/tests/app_rejects_validator_definitions_with_invalid_auth_sigs.rs +++ b/crates/core/app/tests/app_rejects_validator_definitions_with_invalid_auth_sigs.rs @@ -2,7 +2,10 @@ use { self::common::{BuilderExt, ValidatorDataReadExt}, cnidarium::TempStorage, decaf377_rdsa::{SigningKey, SpendAuth, VerificationKey}, - penumbra_app::{genesis::AppState, server::consensus::Consensus}, + penumbra_app::{ + genesis::{self, AppState}, + server::consensus::Consensus, + }, penumbra_keys::test_keys, penumbra_mock_client::MockClient, penumbra_mock_consensus::TestNode, @@ -25,7 +28,9 @@ async fn app_rejects_validator_definitions_with_invalid_auth_sigs() -> anyhow::R // Start the test node. let mut node = { let consensus = Consensus::new(storage.as_ref().clone()); - let app_state = AppState::default(); + let app_state = AppState::Content( + genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), + ); TestNode::builder() .single_validator() .with_penumbra_auto_app_state(app_state)? diff --git a/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_missing_blocks.rs b/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_missing_blocks.rs index e9f93ba232..6d55488163 100644 --- a/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_missing_blocks.rs +++ b/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_missing_blocks.rs @@ -2,7 +2,10 @@ use { self::common::{BuilderExt, ValidatorDataReadExt}, anyhow::Context, cnidarium::TempStorage, - penumbra_app::{genesis::AppState, server::consensus::Consensus}, + penumbra_app::{ + genesis::{self, AppState}, + server::consensus::Consensus, + }, penumbra_mock_consensus::TestNode, penumbra_stake::component::validator_handler::validator_store::ValidatorDataRead, tap::Tap, @@ -19,7 +22,9 @@ async fn app_tracks_uptime_for_genesis_validator_missing_blocks() -> anyhow::Res // Start the test node. let mut node = { - let app_state = AppState::default(); + let app_state = AppState::Content( + genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), + ); let consensus = Consensus::new(storage.as_ref().clone()); TestNode::builder() .single_validator() diff --git a/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_signing_blocks.rs b/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_signing_blocks.rs index 4f20881b8e..9685a37395 100644 --- a/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_signing_blocks.rs +++ b/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_signing_blocks.rs @@ -2,7 +2,10 @@ use { self::common::{BuilderExt, ValidatorDataReadExt}, anyhow::Context, cnidarium::TempStorage, - penumbra_app::{genesis::AppState, server::consensus::Consensus}, + penumbra_app::{ + genesis::{self, AppState}, + server::consensus::Consensus, + }, penumbra_mock_consensus::TestNode, penumbra_stake::component::validator_handler::validator_store::ValidatorDataRead, tap::Tap, @@ -19,7 +22,9 @@ async fn app_tracks_uptime_for_genesis_validator_missing_blocks() -> anyhow::Res // Start the test node. let mut node = { - let app_state = AppState::default(); + let app_state = AppState::Content( + genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), + ); let consensus = Consensus::new(storage.as_ref().clone()); TestNode::builder() .single_validator() diff --git a/crates/core/app/tests/app_tracks_uptime_for_validators_only_once_active.rs b/crates/core/app/tests/app_tracks_uptime_for_validators_only_once_active.rs index 2c3f228f0c..27529dcf21 100644 --- a/crates/core/app/tests/app_tracks_uptime_for_validators_only_once_active.rs +++ b/crates/core/app/tests/app_tracks_uptime_for_validators_only_once_active.rs @@ -35,8 +35,11 @@ async fn app_tracks_uptime_for_validators_only_once_active() -> anyhow::Result<( let storage = TempStorage::new().await?; // Configure an AppState with slightly shorter epochs than usual. - let app_state = - AppState::Content(genesis::Content::default().with_epoch_duration(EPOCH_DURATION)); + let app_state = AppState::Content( + genesis::Content::default() + .with_epoch_duration(EPOCH_DURATION) + .with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), + ); // Start the test node. let mut node = { diff --git a/crates/core/app/tests/mock_consensus_can_define_a_genesis_validator.rs b/crates/core/app/tests/mock_consensus_can_define_a_genesis_validator.rs index 2d478ea52a..da66bd8575 100644 --- a/crates/core/app/tests/mock_consensus_can_define_a_genesis_validator.rs +++ b/crates/core/app/tests/mock_consensus_can_define_a_genesis_validator.rs @@ -2,7 +2,10 @@ use { self::common::{BuilderExt, ValidatorDataReadExt}, anyhow::anyhow, cnidarium::TempStorage, - penumbra_app::{genesis::AppState, server::consensus::Consensus}, + penumbra_app::{ + genesis::{self, AppState}, + server::consensus::Consensus, + }, penumbra_mock_consensus::TestNode, penumbra_stake::component::validator_handler::ValidatorDataRead as _, tap::{Tap, TapFallible}, @@ -18,7 +21,9 @@ async fn mock_consensus_can_define_a_genesis_validator() -> anyhow::Result<()> { let guard = common::set_tracing_subscriber(); let storage = TempStorage::new().await?; let test_node = { - let app_state = AppState::default(); + let app_state = AppState::Content( + genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), + ); let consensus = Consensus::new(storage.as_ref().clone()); TestNode::builder() .single_validator() diff --git a/crates/core/app/tests/mock_consensus_can_send_a_sequence_of_empty_blocks.rs b/crates/core/app/tests/mock_consensus_can_send_a_sequence_of_empty_blocks.rs index 74e662285b..cf66c15fdc 100644 --- a/crates/core/app/tests/mock_consensus_can_send_a_sequence_of_empty_blocks.rs +++ b/crates/core/app/tests/mock_consensus_can_send_a_sequence_of_empty_blocks.rs @@ -1,7 +1,10 @@ use { self::common::BuilderExt, cnidarium::TempStorage, - penumbra_app::{genesis::AppState, server::consensus::Consensus}, + penumbra_app::{ + genesis::{self, AppState}, + server::consensus::Consensus, + }, penumbra_mock_consensus::TestNode, penumbra_sct::component::clock::EpochRead as _, tap::TapFallible, @@ -17,7 +20,9 @@ async fn mock_consensus_can_send_a_sequence_of_empty_blocks() -> anyhow::Result< let guard = common::set_tracing_subscriber(); let storage = TempStorage::new().await?; let mut test_node = { - let app_state = AppState::default(); + let app_state = AppState::Content( + genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), + ); let consensus = Consensus::new(storage.as_ref().clone()); TestNode::builder() .single_validator()