ParseScript
.
RPC method ’encodescript' #14476
pull rodentrabies wants to merge 4 commits into bitcoin:master from rodentrabies:encodescript-rpc changing 4 files +211 −5-
rodentrabies commented at 7:38 pm on October 13, 2018: contributorImplements proposal in #12948. Fixes the problem with white space delimiters inside single-quoted strings in
-
rpc: implement 'encodescript' RPC method a534ee15f0
-
rodentrabies force-pushed on Oct 13, 2018
-
util: handle spaces/tabs/newlines inside quoted strings in ParseScript 67404434fa
-
meshcollider added the label RPC/REST/ZMQ on Oct 13, 2018
-
meshcollider commented at 8:01 am on October 14, 2018: contributorConcept ACK
-
util: replace boost::split with std::regex tokenizer 86315aa485
-
in src/core_read.cpp:50 in 67404434fa outdated
45@@ -46,8 +46,24 @@ CScript ParseScript(const std::string& s) 46 } 47 } 48 49+ std::vector<std::string> blocks; 50 std::vector<std::string> words; 51- boost::algorithm::split(words, s, boost::algorithm::is_any_of(" \t\n"), boost::algorithm::token_compress_on);
fanquake commented at 11:37 am on October 14, 2018: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.
rodentrabies commented at 2:57 pm on October 14, 2018:Thanks for pointing that out. Some of the ways to resolve this:
- function
Split
implemented in #13751 can be used in place ofboost::algorithm::split
introduced here as well, so it may be resolved by either amending to this commit, or to the one #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
split
is eliminated in one way or another; - implement small
split
utility and use it here, but that again overlaps with #13751; - use
std::regex
.
rodentrabies commented at 5:12 pm on October 14, 2018:See 86315aa forstd::regex
-based tokenizer. Noticed there’s nostd::regex
usage throughout code base, so let me know if there’s any policy against that.rodentrabies force-pushed on Oct 15, 2018test: add functional test for 'encodescript' RPC 2c5f9d5c2frodentrabies force-pushed on Oct 15, 2018rodentrabies closed this on Oct 15, 2018
rodentrabies reopened this on Oct 15, 2018
sipa commented at 7:49 am on October 17, 2018: memberI’m not convinced we need more pure utility functionality as RPCs. These things can be implemented as a library or whatever.laanwj commented at 10:21 am on October 18, 2018: memberI tend to agree with @sipa though also this discussion should probably have been done in #12948, @mrwhythat simply picked an open issue which didn’t seem to have anyone protesting against it, and implemented itDrahtBot commented at 10:00 am on October 20, 2018: memberThe following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #13751 (Utils and libraries: Drops the boost/algorithm/string/split.hpp dependency by 251Labs)
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.
in src/rpc/rawtransaction.cpp:581 in 2c5f9d5c2f
573@@ -574,6 +574,40 @@ static UniValue decoderawtransaction(const JSONRPCRequest& request) 574 return result; 575 } 576 577+static UniValue encodescript(const JSONRPCRequest& request) 578+{ 579+ if (request.fHelp || request.params.size() != 1) 580+ throw std::runtime_error( 581+ "encodescript \"asm\"\n"
MarcoFalke commented at 11:21 pm on November 13, 2018:Needs rebase and be switched toRPCHelpMan{"encodescript", { ...
rodentrabies commented at 5:53 pm on December 12, 2018: contributorClosing this because #12984 was rejected.rodentrabies closed this on Dec 12, 2018
rodentrabies deleted the branch on Mar 15, 2021DrahtBot locked this on Aug 18, 2022 - function
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-19 00:12 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-19 00:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me