test(audit-guard): wire drift_validator_test.rs into crate; drop unused FixedOffset - #378
Open
Paranoa-dev wants to merge 1 commit into
Open
test(audit-guard): wire drift_validator_test.rs into crate; drop unused FixedOffset#378Paranoa-dev wants to merge 1 commit into
Paranoa-dev wants to merge 1 commit into
Conversation
…ed FixedOffset (closes Vero-protocol#349)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test: wire
drift_validator_test.rsinto the crate (GrantFox OSS / Third Campaign)Problem
drift_validator_test.rsexisted but was never compiled or run:grep -rn drift_validator_test .matched only the file's own first line.mod drift_validator_test;anywhere inlib.rs(modulelist at lines 6‑8, 24‑32, 154), and it was not under
tests/.As a result,
validate_driftandDriftEvent::validate_structurehad zero executedcoverage despite a test file existing. Additionally,
drift_validator.rs:33importedFixedOffsetfromchrono, which is unused (onlyDateTimeis used).Changes
Wired the test in at the correct scope. The test module uses
super::*andreferences
DriftEvent,validate_drift, andDriftError. Those names resolveonly inside the
drift_validatormodule (whereDriftErroris imported viause crate::drift_error::DriftError;), so the declaration was added insidedrift_validator.rsrather than at the crate root:Removed the unused import.
use chrono::{DateTime, FixedOffset};→use chrono::DateTime;, clearing the unused-import warning.Verification
cargo test --locked(insrc/audit-guard) now compiles and runs the driftvalidator tests:
test_valid_drifttest_exceeds_thresholdtest_malformed_idtest_invalid_timestampdrift_validator.rs.Files changed
src/audit-guard/src/drift_validator.rscloses #349