tari-project / tari

The Tari protocol
https://tari.com
BSD 3-Clause "New" or "Revised" License
345 stars 212 forks source link

chore: simplify checksum data extraction #6338

Closed AaronFeickert closed 3 months ago

AaronFeickert commented 3 months ago

Description

Updates checksum validation to return the data slice.

Motivation and Context

After validating 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.

github-actions[bot] commented 3 months ago

Test Results (CI)

    3 files    120 suites   40m 51s :stopwatch: 1 279 tests 1 279 :white_check_mark: 0 :zzz: 0 :x: 3 829 runs  3 829 :white_check_mark: 0 :zzz: 0 :x:

Results for commit f797342d.

github-actions[bot] commented 3 months ago

Test Results (Integration tests)

33 tests  +33   33 :white_check_mark: +33   13m 59s :stopwatch: + 13m 59s 11 suites +11    0 :zzz: ± 0   2 files   + 2    0 :x: ± 0 

Results for commit f797342d. ± Comparison against base commit 9920916f.