Skip to content

Commit 484386a

Browse files
committed
Merge #122: A few website updates
438a523 Remove Blockstream affiliation (Pieter Wuille) 700eafc Stop using deprecated em++ env variable in Makefile (Pieter Wuille) 51f017c Adapt js_bindings.cpp to API changes (Pieter Wuille) Pull request description: * Fix compilation errors in js_bindinds.cpp * Modernize em++ command line * Drop Blockstream affiliation now most work isn't being done there anymore ACKs for top commit: darosior: utACK 438a523 Tree-SHA512: 78a33564764cf295d178398503ad8599d7581845ace1eb2b0243b025fc275cd73527d7bc5f10349c14a4a38e395abd028bffa49f77e8b3d3917da31a75f3e1bc
2 parents ca67548 + 438a523 commit 484386a

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ miniscript: $(HEADERS) $(SOURCES) main.cpp
55
g++ -O3 -g0 -Wall -std=c++17 -march=native -flto -Ibitcoin $(SOURCES) main.cpp -o miniscript
66

77
miniscript.js: $(HEADERS) $(SOURCES) js_bindings.cpp
8-
em++ -O3 -g0 -Wall -std=c++17 -fno-rtti -flto -Ibitcoin $(SOURCES) js_bindings.cpp -s WASM=1 -s FILESYSTEM=0 -s ENVIRONMENT=web -s DISABLE_EXCEPTION_CATCHING=0 -s EXPORTED_FUNCTIONS='["_miniscript_compile","_miniscript_analyze","_malloc","_free"]' -s EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap","UTF8ToString"]' -o miniscript.js
8+
em++ -O3 -g0 -Wall -std=c++17 -fno-rtti -flto -Ibitcoin $(SOURCES) js_bindings.cpp -s WASM=1 -s FILESYSTEM=0 -s ENVIRONMENT=web -s DISABLE_EXCEPTION_CATCHING=0 -s EXPORTED_FUNCTIONS='["_miniscript_compile","_miniscript_analyze","_malloc","_free"]' -s EXPORTED_RUNTIME_METHODS='["cwrap","UTF8ToString"]' -o miniscript.js
99

1010
wrapper.dot: wrapper.txt
1111
(echo "digraph wrapper {"; cat wrapper.txt | sed -e 's/^ \+//g' | sed -e 's/ \+/ /g' | cut -d ' ' -f 2 | rev | sed -e 's/l/u/g' | sed -e 's/s/a/g' | sort | uniq | sed -e 's/\([a-z]\)/\1,\1/g' | sed -e 's/^[a-z]//g' | sed -e 's/,[a-z]$$//g' | sed -e 's/,\(.\)\(.\)/ \1 -> \2;\n/g' | sort | uniq | sed -e 's/u/"l\/u"/g' | sed -e 's/a/\"a\/s\"/g'; echo "}") >wrapper.dot

blockstream.png

-44.7 KB
Binary file not shown.

index.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -656,11 +656,5 @@ <h4>Guaranteeing non-malleability</h4>
656656

657657
</div>
658658

659-
<footer class="footer">
660-
<div class="container text-center">
661-
<img height="144" src="blockstream.png" width="288" alt="Blockstream logo">
662-
</div>
663-
</footer>
664-
665659
</body>
666660
</html>

js_bindings.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,10 @@ std::string Props(const miniscript::NodeRef<std::string>& node, std::string in)
4343
std::string Analyze(const miniscript::NodeRef<std::string>& node) {
4444
switch (node->fragment) {
4545
case miniscript::Fragment::PK_K: {
46-
std::string str;
47-
COMPILER_CTX.ToString(node->keys[0], str);
48-
return Props(node, "pk_k(" + std::move(str) + ")");
46+
return Props(node, "pk_k(" + (*COMPILER_CTX.ToString(node->keys[0])) + ")");
4947
}
5048
case miniscript::Fragment::PK_H: {
51-
std::string str;
52-
COMPILER_CTX.ToString(node->keys[0], str);
53-
return Props(node, "pk_h(" + std::move(str) + ")");
49+
return Props(node, "pk_h(" + (*COMPILER_CTX.ToString(node->keys[0])) + ")");
5450
}
5551
case miniscript::Fragment::MULTI: return Props(node, "multi(" + std::to_string(node->k) + " of " + std::to_string(node->keys.size()) + ")");
5652
case miniscript::Fragment::AFTER: return Props(node, "after(" + std::to_string(node->k) + ")");
@@ -101,8 +97,7 @@ void miniscript_compile(const char* desc, char* msout, int msoutlen, char* costo
10197
Output("[compile error]", asmout, asmoutlen);
10298
return;
10399
}
104-
ret->ToString(COMPILER_CTX, str);
105-
Output(Abbreviate(std::move(str)), msout, msoutlen);
100+
Output(Abbreviate(*(ret->ToString(COMPILER_CTX))), msout, msoutlen);
106101
std::string coststr = "<ul><li>Script: " + std::to_string(ret->ScriptSize()) + " WU</li><li>Input: " + std::to_string(avgcost) + " WU</li><li>Total: " + std::to_string(ret->ScriptSize() + avgcost) + " WU</li></ul>";
107102
Output(coststr, costout, costoutlen);
108103
Output(Disassemble(ret->ToScript(COMPILER_CTX)), asmout, asmoutlen);

0 commit comments

Comments
 (0)