From 365ba048444bcf0c19d9a48b3b6db73d1119f5da Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 1 Mar 2024 02:24:20 -0500 Subject: [PATCH] refactor: strip out the proofSectionLength from all for readability of the offsets --- metadata/media_metadata.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/metadata/media_metadata.go b/metadata/media_metadata.go index fe24a32..cd5f45e 100644 --- a/metadata/media_metadata.go +++ b/metadata/media_metadata.go @@ -80,13 +80,15 @@ func (m *MediaMetadata) decodeProof(dec *msgpack.Decoder) error { proofSectionLength := utils.DecodeEndian(all[0:2]) - bodyBytes := all[2+proofSectionLength:] + all = all[2:] + + bodyBytes := all[proofSectionLength:] if proofSectionLength == 0 { return nil } - childDec := msgpack.NewDecoder(bytes.NewReader(all[2 : 2+proofSectionLength])) + childDec := msgpack.NewDecoder(bytes.NewReader(all[:proofSectionLength])) b3hash := blake3.Sum256(bodyBytes)