Skip to content

Commit 8763378

Browse files
committed
correction: rank only current CRC padding
1 parent 024efb2 commit 8763378

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

‎src/codex32/correction.py‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
from codex32.gf32 import _inverse as _gf32_inverse
5050
from codex32.gf32 import _multiply as _gf32_multiply
5151
from codex32.profiles import Profile, _optional_profile_rules
52-
from codex32.profiles.ms32 import MasterSeed, _has_generation_padding, _has_legacy_generation_padding
52+
from codex32.profiles.ms32 import MasterSeed, _has_generation_padding
5353

5454

5555
@dataclass(frozen=True, slots=True)
@@ -747,16 +747,10 @@ def _allowed(context: CorrectionContext, candidate: CorrectionCandidate) -> bool
747747
)
748748

749749

750-
def _legacy_padding_match(candidate: CorrectionCandidate) -> bool | None:
751-
artifact = candidate.artifact
752-
return _has_legacy_generation_padding(artifact) if isinstance(artifact, MasterSeed) else None
753-
754-
755750
def _candidate_order(candidate: CorrectionCandidate) -> tuple[object, ...]:
756751
return (
757752
candidate.addend_hamming_weight,
758753
candidate.crc_padding_match is not True,
759-
_legacy_padding_match(candidate) is not True,
760754
candidate.artifact.text.lower(),
761755
tuple((edit.reverse_index, edit.kind, edit.observed, edit.replacement) for edit in candidate.edits),
762756
)
@@ -808,10 +802,7 @@ def _best(
808802
tied = [item for item in tied if len(item.artifact.text) in (48, 74)]
809803
hamming = min(item.addend_hamming_weight for item in tied)
810804
tied = [item for item in tied if item.addend_hamming_weight == hamming]
811-
hints: tuple[Callable[[CorrectionCandidate], bool | None], ...] = (
812-
(lambda item: item.crc_padding_match),
813-
_legacy_padding_match,
814-
)
805+
hints: tuple[Callable[[CorrectionCandidate], bool | None], ...] = (lambda item: item.crc_padding_match,)
815806
if fingerprint_match is not None:
816807
hints += (fingerprint_match,)
817808
for hint in hints:

0 commit comments

Comments
 (0)