Skip to content

chore: Add serialization for BlockInputs#2112

Merged
bobbinth merged 1 commit intonextfrom
sergerad-block-inputs-serde
Nov 26, 2025
Merged

chore: Add serialization for BlockInputs#2112
bobbinth merged 1 commit intonextfrom
sergerad-block-inputs-serde

Conversation

@sergerad
Copy link
Contributor

@sergerad sergerad commented Nov 26, 2025

Unblocks 0xMiden/node#1381.

Will not merge if it ends up being unnecessary for that node PR.

@sergerad sergerad added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Nov 26, 2025
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you!

@bobbinth bobbinth merged commit cc968e9 into next Nov 26, 2025
17 of 18 checks passed
@bobbinth bobbinth deleted the sergerad-block-inputs-serde branch November 26, 2025 08:16
Comment on lines +139 to +145
fn write_into<W: ByteWriter>(&self, target: &mut W) {
self.prev_block_header.write_into(target);
self.partial_blockchain.write_into(target);
self.account_witnesses.write_into(target);
self.nullifier_witnesses.write_into(target);
self.unauthenticated_note_proofs.write_into(target);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I like deconstructing in these type of situations so that one is forced to revisit this if you add a new field

Suggested change
fn write_into<W: ByteWriter>(&self, target: &mut W) {
self.prev_block_header.write_into(target);
self.partial_blockchain.write_into(target);
self.account_witnesses.write_into(target);
self.nullifier_witnesses.write_into(target);
self.unauthenticated_note_proofs.write_into(target);
}
fn write_into<W: ByteWriter>(&self, target: &mut W) {
let Self {
prev_block_header,
partial_blockchain,
account_witnesses,
nullifier_witnesses,
unauthenticated_note_proofs,
} = self;
prev_block_header.write_into(target);
partial_blockchain.write_into(target);
account_witnesses.write_into(target);
nullifier_witnesses.write_into(target);
unauthenticated_note_proofs.write_into(target);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Excellent point, will remember in future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants