Skip to content

Fix length calculation for complex data#94

Open
konradkonrad wants to merge 1 commit intomainfrom
fix/complex_etd_data
Open

Fix length calculation for complex data#94
konradkonrad wants to merge 1 commit intomainfrom
fix/complex_etd_data

Conversation

@konradkonrad
Copy link
Contributor

This adds a test for validation of complex data (e.g. []bytes with more than one word). The length calculation for these kinds of arguments was fixed.

Fixes one bulletpoint of #84

This adds a test for validation of complex data (e.g. []bytes with more
than one word). The length calculation for these kinds of arguments was
fixed.
Copy link
Contributor

@blockchainluffy blockchainluffy left a comment

Choose a reason for hiding this comment

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

small suggestion

lp.ValuePredicate.Op = shs.BytesEq
lp.ValuePredicate.ByteArgs = [][]byte{Align(val)}
length = uint64(len(val) / shs.Word)
length = uint64((len(val) + 32) / shs.Word)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
length = uint64((len(val) + 32) / shs.Word)
length = uint64((len(val) / shs.Word)+1)

Small suggestion to make it more readable

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.

2 participants