[5.0 -> main] Fix base64 encoding - take 2#1893
Merged
Merged
Conversation
- Use string_view and return vector<char> instead of string
[5.0] Fix base64 encoding - take 2
spoonincode
approved these changes
Nov 13, 2023
greg7mdp
approved these changes
Nov 13, 2023
Comment on lines
+30
to
+31
| std::string b64_str(b64.begin(), b64.end()); | ||
| BOOST_CHECK_EQUAL(expected_output, b64_str); |
Contributor
There was a problem hiding this comment.
Again, not a required change, just a suggestion for here and the few next instances of the same pattern.
Suggested change
| std::string b64_str(b64.begin(), b64.end()); | |
| BOOST_CHECK_EQUAL(expected_output, b64_str); | |
| BOOST_CHECK_EQUAL(std::string_view(expected_output), std::string_view(b64.begin(), b64.end())); |
greg7mdp
approved these changes
Nov 13, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1482 fixed base64 encoding by removing the unneeded extra
=that variant added to base64 encoded data. However, it also updated the base64 library with a stricter one. This PR leaves the old base64 encoding/decoding library but does remove the extra=from the base64 encoded data so non-fc base64 decoders will not claim the data is invalid.This change still breaks backward compatibility with 3.2 & 4.0
cleos/nodeos. PRs to 3.2 (#1889) and 4.0 will be created that will allow them to work with this new base64 encoding (they will no longer expect the invalid=character).PR #1886 reverts #1482. This PR provided an alternative fix for #1461.
Included in this PR is an optimization to the existing
base64_decodeto avoid a copy for our use-cases by returning avector<char>instead of astring.Included in this PR is a change to the
nodeos_run_test.pyto keep thekeosdrunning with passed--leaving-runningwhich is useful for local testing. This was used to manually test using 3.2cleoswith 5.0.Merges
release/5.0intomainincluding #1888Resolves #1461