Skip to content

Commit 76e4c23

Browse files
committed
322: create builder for verification config to maintain version
compatibility in future
1 parent 8abe28c commit 76e4c23

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

crates/hotfix/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
- possibility to disalbe original sending time(tag 122) for admin messages([#322](https://github.com/Boku-Labs/boku-hotfix/pull/3))
12+
1013
## [0.11.0](https://github.com/Validus-Risk-Management/hotfix/compare/hotfix-v0.10.0...hotfix-v0.11.0) - 2026-03-25
1114

1215
### Added

crates/hotfix/src/config.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,47 @@ pub struct VerificationConfig {
128128
pub check_orig_sending_time_for_admin: bool,
129129
}
130130

131+
impl VerificationConfig {
132+
pub fn builder() -> VerificationConfigBuilder {
133+
VerificationConfigBuilder::default()
134+
}
135+
}
136+
131137
impl Default for VerificationConfig {
138+
fn default() -> Self {
139+
VerificationConfigBuilder::default().build()
140+
}
141+
}
142+
143+
pub struct VerificationConfigBuilder {
144+
check_orig_sending_time_for_admin: bool,
145+
}
146+
147+
impl Default for VerificationConfigBuilder {
132148
fn default() -> Self {
133149
Self {
134150
check_orig_sending_time_for_admin: true,
135151
}
136152
}
137153
}
138154

155+
impl VerificationConfigBuilder {
156+
pub fn new() -> Self {
157+
Self::default()
158+
}
159+
160+
pub fn check_orig_sending_time_for_admin(mut self, value: bool) -> Self {
161+
self.check_orig_sending_time_for_admin = value;
162+
self
163+
}
164+
165+
pub fn build(self) -> VerificationConfig {
166+
VerificationConfig {
167+
check_orig_sending_time_for_admin: self.check_orig_sending_time_for_admin,
168+
}
169+
}
170+
}
171+
139172
fn default_true() -> bool {
140173
true
141174
}

0 commit comments

Comments
 (0)