Skip to content

Commit

Permalink
chore: use constant for the default major_version 1 for decision message
Browse files Browse the repository at this point in the history
  • Loading branch information
gk-kindred committed Sep 9, 2024
1 parent bb8af2e commit 1e4b0ad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/talos_certifier/src/model/decision_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use crate::certifier::Outcome;

use super::{candidate_message::CandidateMessage, metrics::TxProcessingTimeline};

pub const DEFAULT_DECISION_MESSAGE_VERSION: u64 = 1_u64;

#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)]
pub enum Decision {
#[serde(rename = "committed")]
Expand Down
2 changes: 1 addition & 1 deletion packages/talos_certifier/src/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ pub mod delivery_order;
pub mod metrics;

pub use candidate_message::{CandidateMessage, CandidateReadWriteSet};
pub use decision_message::{Decision, DecisionMessage, DecisionMessageTrait};
pub use decision_message::{Decision, DecisionMessage, DecisionMessageTrait, DEFAULT_DECISION_MESSAGE_VERSION};
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use tokio::sync::mpsc;

use crate::core::ServiceResult;
use crate::model::decision_headers::{DecisionCertHeaders, DecisionHeaderBuilder, DecisionMetaHeaders};
use crate::model::DEFAULT_DECISION_MESSAGE_VERSION;
use crate::{
core::{DecisionOutboxChannelMessage, System, SystemService},
errors::{SystemServiceError, SystemServiceErrorKind},
Expand Down Expand Up @@ -114,7 +115,7 @@ impl SystemService for DecisionOutboxService {
} = decision_channel_message;
tokio::spawn({
let decision_headers = DecisionHeaderBuilder::with_additional_headers(headers.into()).add_meta_headers(DecisionMetaHeaders::new(
1_u64, // major version of decision message
DEFAULT_DECISION_MESSAGE_VERSION, // major version of decision message
self.system.name.clone(),
None,
));
Expand Down

0 comments on commit 1e4b0ad

Please sign in to comment.