Skip to content

Conversation

@jcnelson
Copy link
Member

Value::expect_buff(x) should work or buffers with fewer than x bytes.

@jcnelson jcnelson requested a review from kantai October 21, 2020 03:39
Copy link
Contributor

@psq psq left a comment

Choose a reason for hiding this comment

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

will no longer panic on a bad hash param

if let Value::Sequence(SequenceData::Buffer(mut buffdata)) = self {
if buffdata.data.len() <= sz {
for _ in buffdata.data.len()..sz {
buffdata.data.push(0u8)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since these expect_ functions are basically destructuring routines, it makes more sense for data padding to happen in the caller rather than in this function (a destructuring routine shouldn't mutate the returned data).

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair enough. Will fix.

Copy link
Contributor

@kantai kantai left a comment

Choose a reason for hiding this comment

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

LGTM! Before performing a chain reset, can you also merge next to master?

@jcnelson jcnelson merged commit 878bf5b into master Oct 22, 2020
@blockstack-devops
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Nov 29, 2024
@kantai kantai deleted the fix/1984 branch March 11, 2025 15:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants