Skip to content

Commit f2d7953

Browse files
authored
fix: Bump MSRV (#291)
* fix: Bump MSRV and add unsafes * fix: Docker readme file
1 parent b2e71c3 commit f2d7953

File tree

10 files changed

+36
-27
lines changed

10 files changed

+36
-27
lines changed

.github/workflows/release-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
password: ${{ secrets.DOCKERHUB_PAT }}
9292
repository: ${{ env.DOCKERHUB_IMAGE }}
9393
short-description: ${{ github.event.repository.description }}
94-
readme-filepath: ./DOCKERHUB_README.md
94+
readme-filepath: ./DOCKER_README.md
9595
- name: Slack notification success or failure
9696
uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0
9797
with:

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "openzeppelin-monitor"
33
version = "1.0.0"
44
edition = "2021"
5-
rust-version = "1.84" #MSRV
5+
rust-version = "1.86" #MSRV
66

77
[profile.release]
88
opt-level = 0

docs/modules/ROOT/pages/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ The monitor implements protocol security validations across different components
240240
* *Warning*: Using other ports will trigger security warnings
241241
* *Valid Format*: Email addresses must follow RFC 5322 format
242242

243-
====== Notifcations Retry Policy
243+
====== Notifications Retry Policy
244244

245245
Following notification protocols support retry policies:
246246

src/services/blockchain/transports/endpoint_manager.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,8 @@ impl EndpointManager {
292292
if ROTATE_ON_ERROR_CODES.contains(&status.as_u16()) {
293293
tracing::debug!(
294294
"send_raw_request: HTTP status {} on '{}' triggers URL rotation attempt",
295-
status, current_url_snapshot
295+
status,
296+
current_url_snapshot
296297
);
297298

298299
match self.try_rotate_url(transport).await {
@@ -338,7 +339,10 @@ impl EndpointManager {
338339
// Always attempt rotation on network errors
339340
match self.try_rotate_url(transport).await {
340341
Ok(new_url) => {
341-
tracing::debug!("Rotation successful after network error, retrying request on new URL: '{}'", new_url);
342+
tracing::debug!(
343+
"Rotation successful after network error, retrying request on new URL: '{}'",
344+
new_url
345+
);
342346
continue; // Retry on the new active URL
343347
}
344348
Err(rotation_error) => {

src/services/filter/filters/evm/evaluator.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ impl<'a> EVMConditionEvaluator<'a> {
117117
} else {
118118
// For Eq/Ne, a number literal cannot be equal to a JSON array string.
119119
let msg = format!(
120-
"Expected string literal (representing a JSON array) for EVM 'array' Eq/Ne comparison, found number: {:?}",
121-
rhs_literal
120+
"Expected string literal (representing a JSON array) for EVM 'array' Eq/Ne comparison, found number: {:?}",
121+
rhs_literal
122122
);
123123
return Err(EvaluationError::type_mismatch(msg, None, None));
124124
}
@@ -167,8 +167,8 @@ impl<'a> EVMConditionEvaluator<'a> {
167167
// Ensure both parsed values are actually arrays
168168
if !lhs_json_value.is_array() || !rhs_json_value.is_array() {
169169
let msg = format!(
170-
"For 'array' Eq/Ne comparison, both LHS ('{}') and RHS ('{}') must resolve to JSON arrays.",
171-
lhs_json_array_str, rhs_target_str
170+
"For 'array' Eq/Ne comparison, both LHS ('{}') and RHS ('{}') must resolve to JSON arrays.",
171+
lhs_json_array_str, rhs_target_str
172172
);
173173
return Err(EvaluationError::type_mismatch(msg, None, None));
174174
}
@@ -572,9 +572,9 @@ impl<'a> EVMConditionEvaluator<'a> {
572572
serde_json::from_str::<serde_json::Map<String, JsonValue>>(lhs_json_map_str)
573573
.map_err(|e| {
574574
let msg = format!(
575-
"Failed to parse LHS value '{}' as JSON map for 'contains' operator",
576-
lhs_json_map_str
577-
);
575+
"Failed to parse LHS value '{}' as JSON map for 'contains' operator",
576+
lhs_json_map_str
577+
);
578578
EvaluationError::parse_error(msg, Some(e.into()), None)
579579
})?;
580580

src/services/filter/filters/stellar/evaluator.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ impl<'a> StellarConditionEvaluator<'a> {
158158
// Fallback to CSV
159159
tracing::debug!(
160160
"LHS for 'vec' ('{}') not valid JSON array, falling back to CSV check for value '{}'",
161-
lhs_str, rhs_target_str
161+
lhs_str,
162+
rhs_target_str
162163
);
163164
let csv_values: Vec<&str> = lhs_str.split(',').map(str::trim).collect();
164165
Ok(csv_values.contains(&rhs_target_str))
@@ -474,9 +475,9 @@ impl<'a> StellarConditionEvaluator<'a> {
474475
serde_json::from_str::<serde_json::Map<String, JsonValue>>(lhs_json_map_str)
475476
.map_err(|e| {
476477
let msg = format!(
477-
"Failed to parse LHS value '{}' as JSON map for 'contains' operator",
478-
lhs_json_map_str
479-
);
478+
"Failed to parse LHS value '{}' as JSON map for 'contains' operator",
479+
lhs_json_map_str
480+
);
480481
EvaluationError::parse_error(msg, Some(e.into()), None)
481482
})?;
482483

src/services/notification/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl NotificationService {
188188
"Invalid email configuration".to_string(),
189189
None,
190190
None,
191-
))
191+
));
192192
}
193193
};
194194

@@ -222,7 +222,7 @@ impl NotificationService {
222222
"Invalid script configuration".to_string(),
223223
None,
224224
None,
225-
))
225+
));
226226
}
227227
};
228228
let script = trigger_scripts
@@ -241,7 +241,7 @@ impl NotificationService {
241241
let script_content = match &script {
242242
Ok(content) => content,
243243
Err(e) => {
244-
return Err(NotificationError::config_error(e.to_string(), None, None))
244+
return Err(NotificationError::config_error(e.to_string(), None, None));
245245
}
246246
};
247247

src/services/notification/telegram.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl Notifier for TelegramNotifier {
234234

235235
// Send the notification using the inner Webhook notifier
236236
self.inner
237-
// TODO: The `message` parameter is required by the Notifier trait for generic
237+
// TODO: The `message` parameter is required by the Notifier trait for generic
238238
// webhook signing, but it's duplicated in this specific payload
239239
.notify_with_payload(message, payload_fields)
240240
.await
@@ -383,7 +383,9 @@ mod tests {
383383
fn test_escape_markdown_v2() {
384384
// Test for real life examples
385385
assert_eq!(
386-
TelegramNotifier::escape_markdown_v2("*Transaction Alert*\n*Network:* Base Sepolia\n*From:* 0x00001\n*To:* 0x00002\n*Transaction:* [View on Blockscout](https://base-sepolia.blockscout.com/tx/0x00003)"),
386+
TelegramNotifier::escape_markdown_v2(
387+
"*Transaction Alert*\n*Network:* Base Sepolia\n*From:* 0x00001\n*To:* 0x00002\n*Transaction:* [View on Blockscout](https://base-sepolia.blockscout.com/tx/0x00003)"
388+
),
387389
"*Transaction Alert*\n*Network:* Base Sepolia\n*From:* 0x00001\n*To:* 0x00002\n*Transaction:* [View on Blockscout](https://base\\-sepolia\\.blockscout\\.com/tx/0x00003)"
388390
);
389391

src/utils/monitor/execution.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,14 @@ pub async fn execute_monitor<
260260
"Midnight network not supported",
261261
None,
262262
None,
263-
))
263+
));
264264
}
265265
BlockChainType::Solana => {
266266
return Err(MonitorExecutionError::execution_error(
267267
"Solana network not supported",
268268
None,
269269
None,
270-
))
270+
));
271271
}
272272
};
273273

tests/integration/bootstrap/main.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,12 @@ async fn test_initialize_services() {
151151
"TriggerExecutionService should be wrapped in Arc"
152152
);
153153

154-
assert!(active_monitors.iter().any(|m| m.name == "test"
155-
&& m.networks.contains(&"ethereum_mainnet".to_string())
156-
&& m.triggers
157-
.contains(&"evm_large_transfer_usdc_slack".to_string())));
154+
assert!(active_monitors.iter().any(|m| {
155+
m.name == "test"
156+
&& m.networks.contains(&"ethereum_mainnet".to_string())
157+
&& m.triggers
158+
.contains(&"evm_large_transfer_usdc_slack".to_string())
159+
}));
158160
assert!(networks.contains_key("ethereum_mainnet"));
159161

160162
assert!(Arc::strong_count(&monitor_service) >= 1);

0 commit comments

Comments
 (0)