Merge feee029d29 into merged_master (Elements PR ElementsProject/elements#1020)

Messy merge conflicts because this PR backported some ad-hoc stuff from
upstream while keeping a few things that upstream deleted. Hopefully
reviewing is easier than doing this in the first place, since ultimately
all I did was delete code from one side or another of the conflicts.
(Ok, I also changed some boost optional stuff to std::optional, and had
to patch up a test file for test framework changes.)

When reviewing the detailed crypto, bear in mind that taptweaks, like all
hashes are the kind of crypto that cannot be subtly wrong -- it will either
fail very hard or be correct. And we have independent implementations in
C++ and Python that cross-check each other, si it's unlikely to be the former.
This commit is contained in:
Andrew Poelstra 2021-09-05 12:35:58 +00:00
commit 6387aaf765
17 changed files with 1795 additions and 48 deletions

View file

@ -1469,7 +1469,7 @@ BOOST_AUTO_TEST_CASE(script_HasValidOps)
BOOST_CHECK(script.HasValidOps());
script = ScriptFromHex("ff88ac"); // Script with OP_INVALIDOPCODE explicit
BOOST_CHECK(!script.HasValidOps());
script = ScriptFromHex("88acc4"); // Script with undefined opcode: one higher then MAX_OPCODE
script = ScriptFromHex("88ace5"); // Script with undefined opcode: one higher then MAX_OPCODE
BOOST_CHECK(!script.HasValidOps());
}