elements/test/functional/test_framework
Andrew Poelstra 578ee6183f Merge a9335e4f12 into merged_master (Bitcoin PR #16546)
There are a few layers of bullshit to this PR.

First, there is the fact that it adds a functional test gated on a new
config flag which is disabled by default, so it actually adds broken
code with no tests, waiting to ruin your day 520 PRs later when #21935
enables the broken test.

Second, the test appears to be superficially nonsensical because it
generates two transactions from different wallets and tries to compare
them for byte-for-byte equality, which doesn't make sense (at least)
because change outputs are randomly located...so something fishy is
going on.

Of course, in Elements the transactions are *not* equal half the time
because the outputs are permuted, which may have let me quickly figure
out the issue, except...

Third, there is a red herring of a bug where the two transactions have
slightly different feerates. This turns out to be caused by
CWallet::CalculateMaximumSignedTxSize using differently sized dummy
transactions depending on whether watchonly outputs are included (this
fact is conveniently disguised by #17211 slightly changing this logic;
this is an unmerged PR in Core that Elements has a backport of an old
version of). And the two wallets have different watchonly settings.

A sub-red-herring is the fact that this bug results in a discrepancy
of 0.25 vbytes, so it does not appear in Core but does appear in
Elements (there is a 3/16 probability that we should be so unlucky...
we are).

But this is all irrelevant, because...

Fourth, this test is actually super bullshit. The way it works is by
constructing a PSBT legitimately, saving this to disk, then re-"signs"
using the external signer interface by using a mock signer that
COMPLETELY REPLACES THE TRANSACTION UNDER CONSTRUCTION. So it doesn't
matter what the fee output looks like and it doesn't matter what the
order of the outputs. Core does not detect this malfeasance and
neither does Elements. For some reason, Core has a functional test
that explicitly checks that you can do this even though it is insane
and it is hard to think of non-malicious reasons to do it.

Fifth, while Elements fails to detect that its external signer is
actually changing the transaction out from under it, it DOES assume
that this won't happen. In CWallet::SignPSBT it blithely un-replaces
the transaction, which undermines the functional test.

Sixth, the original PR where this test was introduced has comments
locked, so anyone who spent six hours reverse-engineering this idiotic
broken test, and is still feeling charitable enough to discuss it with
the Core developors, can go pound sand.

Anyway, just disabled the broken test and move on with our lives.
2021-07-27 00:19:01 +00:00
..
__init__.py Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
address.py ci: various linter / CI compiler error fixes 2021-03-26 17:33:04 +00:00
authproxy.py test: retry when write to a socket fails on macOS 2020-06-25 17:26:20 +07:00
bdb.py test: remove unnecessary assignment in bdb 2021-02-09 10:22:50 -03:00
bip340_test_vectors.csv tests: add BIP340 Schnorr signature support to test framework 2020-10-12 17:18:47 -07:00
blocktools.py Merge 4a540683ec into merged_master (Bitcoin PR #20813) 2021-06-16 14:11:07 +00:00
coverage.py Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
descriptors.py Output a descriptor in createmultisig and addmultisigaddress 2020-01-30 23:55:36 -05:00
key.py tests: Replace CECKey with new ECKey impl from Bitcoin master 2021-02-22 13:45:37 +00:00
liquid_addr.py fix len check in blech32 decode() in test framework 2019-09-13 20:24:23 +05:00
messages.py Merge 860f916803 into merged_master (Bitcoin PR #20524) 2021-06-24 13:40:22 +00:00
muhash.py test: Change MuHash Python implementation to match cpp version again 2020-12-22 01:48:34 +01:00
netutil.py doc: Use https URLs where possible 2021-01-04 12:23:16 +08:00
p2p.py Merge 860f916803 into merged_master (Bitcoin PR #20524) 2021-06-24 13:40:22 +00:00
script.py Merge b401b09355 into merged_master (Bitcoin PR #21107) 2021-06-21 08:23:27 +00:00
script_util.py scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
segwit_addr.py [tests] Rename segwit encode and decode functions 2020-09-03 16:47:49 +01:00
siphash.py Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
socks5.py scripted-diff: Update copyright in ./test 2019-03-02 10:58:35 -05:00
test_framework.py Merge a9335e4f12 into merged_master (Bitcoin PR #16546) 2021-07-27 00:19:01 +00:00
test_node.py Merge a9335e4f12 into merged_master (Bitcoin PR #16546) 2021-07-27 00:19:01 +00:00
test_shell.py TestShell: Return self from setup() 2019-11-05 12:55:52 +01:00
util.py Merge 11cbd4bb54 into merged_master (Bitcoin PR #17556) 2021-06-18 14:40:09 +00:00
wallet.py Merge 32e59fc371 into merged_master (Bitcoin PR #20916) 2021-06-17 23:00:15 +00:00
wallet_util.py Merge 85f7db2284 into merged_master (Bitcoin PR #19239) 2020-11-26 01:09:03 +00:00