Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scale: allocate slice elements when decoding #587

Merged
merged 10 commits into from
Feb 3, 2020
Merged

Conversation

noot
Copy link
Contributor

@noot noot commented Jan 31, 2020

Changes

  • update DecodeArray to allocate a slice instead of assigning to the interface that's passed in, allows for arrays to be decoded without knowing how many elements are in it
  • update DecodeTuple to handle [][]byte

Tests:

go test ./codec/...

Issues:

closes #584

}

// TODO: finalize block actually returns a header, not a block. need to update this function
// as well as buildBlock
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@ryanchristo ryanchristo 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 to me! Also tested with updates in #572, which will now be unblocked!

@noot noot merged commit 27019a8 into development Feb 3, 2020
@noot noot deleted the noot/fix-scale branch February 3, 2020 16:36
ryanchristo pushed a commit that referenced this pull request Jun 24, 2020
* update DecodeArray to allocate a slice instead of assigning to the interface that's passed in, allows for arrays to be decoded without knowing how many elements are in it
* update DecodeTuple to handle [][]byte
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.

scale: properly handle arrays when decoding
3 participants