-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: simplify checksum data extraction (#6338)
Description --- Updates checksum validation to return the data slice. Motivation and Context --- After [validating](https://github.com/tari-project/tari/blob/9920916f891fbd26759f7cb4912701189b7579a1/base_layer/common_types/src/dammsum.rs#L73-L85) a checksum, the caller is responsible for removing it to obtain the underlying data. This is brittle, since it breaks the checksum abstraction somewhat. This PR updates checksum validation to return the underlying data slice, making it easier for callers. It also exposes the checksum size for callers that need to know it for encoding purposes, and adds an unrelated `EmojiId` sanity check for a data size constant. How Has This Been Tested? --- Existing, new, and updated tests pass. What process can a PR reviewer use to test or verify this change? --- Check to make sure that the updated validation API operates as expected and is properly tested.
- Loading branch information
1 parent
301ea00
commit 5db26f3
Showing
2 changed files
with
29 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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