Skip to content

Conversation

@shruggr
Copy link
Collaborator

@shruggr shruggr commented Dec 5, 2025

Changes

Block Header Type

  • New Header struct in block package representing the 80-byte Bitcoin block header
  • Serialization/deserialization from bytes and hex
  • JSON marshaling with standard field tags
  • Hash calculation via double SHA-256

Clone Methods

  • Beef.Clone(): Now performs deep copy of all nested structures (BUMPs, transactions, input references)
  • MerklePath.Clone(): New method for deep copying via serialize/deserialize round-trip

Tests

  • Header tests using mainnet genesis block
  • Clone tests covering nil receivers and edge cases

@shruggr shruggr requested a review from rohenaz as a code owner December 5, 2025 17:37
@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
block/header.go 70.00% 6 Missing and 6 partials ⚠️

📢 Thoughts on this report? Let us know!

@shruggr shruggr changed the title Feeat/beef clone Add block Header type and fix Beef/MerklePath Clone methods Dec 5, 2025
Copy link
Collaborator

@rohenaz rohenaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@shruggr shruggr merged commit 5707ed7 into master Dec 5, 2025
6 of 7 checks passed
@shruggr shruggr deleted the feeat/beef-clone branch December 5, 2025 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants