-
Notifications
You must be signed in to change notification settings - Fork 38.7k
RPC method 'encodescript' #14476
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
RPC method 'encodescript' #14476
Conversation
6534261 to
a534ee1
Compare
|
Concept ACK |
|
|
||
| std::vector<std::string> blocks; | ||
| std::vector<std::string> words; | ||
| boost::algorithm::split(words, s, boost::algorithm::is_any_of(" \t\n"), boost::algorithm::token_compress_on); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes are overlapping with the work in #13751, here: https://github.com/bitcoin/bitcoin/pull/13751/files#diff-846395c972e400d3933d195c29740098R50.
It might be worth helping review those changes, and/or considering how to do this without introducing new Boost usage, as the project is trying to reduce it where possible, see https://github.com/bitcoin/bitcoin/projects/3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out. Some of the ways to resolve this:
- function
Splitimplemented in Utils and libraries: Drops the boost/algorithm/string/split.hpp dependency #13751 can be used in place ofboost::algorithm::splitintroduced here as well, so it may be resolved by either amending to this commit, or to the one Utils and libraries: Drops the boost/algorithm/string/split.hpp dependency #13751, depending on what's first to get tomaster; - since this change is not that important for this PR, so I can just delete the last commit and it push it when boost's
splitis eliminated in one way or another; - implement small
splitutility and use it here, but that again overlaps with Utils and libraries: Drops the boost/algorithm/string/split.hpp dependency #13751; - use
std::regex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See 86315aa for std::regex-based tokenizer. Noticed there's no std::regex usage throughout code base, so let me know if there's any policy against that.
eccd06e to
caa2101
Compare
caa2101 to
2c5f9d5
Compare
|
I'm not convinced we need more pure utility functionality as RPCs. These things can be implemented as a library or whatever. |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
I created an issue to discuss a tool that could replace pure utility RPC calls: #14671 |
| { | ||
| if (request.fHelp || request.params.size() != 1) | ||
| throw std::runtime_error( | ||
| "encodescript \"asm\"\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs rebase and be switched to RPCHelpMan{"encodescript", { ...
|
Closing this because #12984 was rejected. |
Implements proposal in #12948. Fixes the problem with white space delimiters inside single-quoted strings in
ParseScript.