Commit graph

31 commits

Author SHA1 Message Date
MarcoFalke fa499b5f02
rpc: bugfix: Properly use iswitness in converttopsbt
Also explain the param in all RPCs
2019-05-16 15:56:04 -04:00
MarcoFalke 8cca1fbea9
Merge #14818: Bugfix: test/functional/rpc_psbt: Remove check for specific error message that depends on uncertain assumptions
c87fc71f7e Bugfix: test/functional/rpc_psbt: Correct test description comment (Luke Dashjr)
097c4aa379 Bugfix: test/functional/rpc_psbt: Remove check for specific error message that depends on uncertain assumptions (Luke Dashjr)

Pull request description:

  When converttopsbt is called with a signed transaction, it either fails with "TX decode failed" if one or more inputs were segwit, or "Inputs must not have scriptSigs and scriptWitnesses" otherwise.
  Since no effort is made by the test to ensure the inputs are segwit or not, avoid checking the exact message used.
  The error code is still checked to ensure it is of the correct kind of failure.

ACKs for commit c87fc7:
  instagibbs:
    utACK  c87fc71f7e
  achow101:
    utACK c87fc71f7e

Tree-SHA512: 61312b5d49aa50652902f30ba9693dfba9e5b7e6478f23becda20202d8b328ddb3e040f2199b617a68df133a5f1f8b5d68bc19d4621303f17c1963dca01bd9ef
2019-04-25 11:24:14 -04:00
MarcoFalke fafe5f0d09
test: Remove unused imports 2019-04-09 12:10:35 -04:00
MarcoFalke fa16a09215
scripted-diff: use self.sync_* methods
-BEGIN VERIFY SCRIPT-
sed -i -e 's/sync_blocks(self.nodes)/self.sync_blocks()/g'     $(git grep -l 'sync_blocks(self.nodes)'   ./test/functional/*.py)
sed -i -e 's/sync_mempools(self.nodes)/self.sync_mempools()/g' $(git grep -l 'sync_mempools(self.nodes)' ./test/functional/*.py)

sed -i -e 's/  sync_blocks(/  self.sync_blocks(/g'     $(git grep -l sync_blocks   ./test/functional/*.py)
sed -i -e 's/  sync_mempools(/  self.sync_mempools(/g' $(git grep -l sync_mempools ./test/functional/*.py)
-END VERIFY SCRIPT-
2019-04-09 12:09:53 -04:00
fanquake 335931df4a
rpc: return a number for estimated_feerate in analyzepsbt 2019-03-12 07:17:42 +08:00
MarcoFalke faa7cdf764
scripted-diff: Update copyright in ./test
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./test/
-END VERIFY SCRIPT-
2019-03-02 10:58:35 -05:00
MarcoFalke fa0e65b772
scripted-diff: test: Remove brackets after assert
-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e 's/assert ?\((.+)\)(( )*)?(#.*)?$/assert \1\3\3\4/g' $(git grep -l --extended-regexp 'assert ?\(' test)
-END VERIFY SCRIPT-
2019-03-02 10:51:35 -05:00
Amiti Uttarwar 8e4b4f683a Address test todos by removing -txindex to nodes.
Originally added when updating getrawtransaction to stop searching unspent utxos.
2019-02-17 21:42:08 -08:00
Andrew Chow 540729ef4b Implement analyzepsbt RPC and tests 2019-02-16 11:51:02 -05:00
Andrew Chow 08f749c914 Implement joinpsbts RPC and tests
Adds a joinpsbts RPC which combines multiple distinct PSBTs into
one PSBT.
2019-02-16 00:04:27 -05:00
Andrew Chow 7344a7b998 Implement utxoupdatepsbt RPC and tests 2019-02-16 00:04:27 -05:00
Glenn Willen c734aaa15d Split DecodePSBT into Base64 and Raw versions
Split up DecodePSBT, which both decodes base64 and then deserializes a
PartiallySignedTransaction, into two functions: DecodeBase64PSBT, which retains
the old behavior, and DecodeRawPSBT, which only performs the deserialization.

Add a test for base64 decoding failure.
2019-02-11 12:23:14 -08:00
benthecarman 30d0f7be6e rpc: Fix for segfault if combinepsbt called with empty inputs 2019-02-04 21:26:52 -06:00
Amiti Uttarwar 04da9f4834 [RPC] Update getrawtransaction interface 2019-01-26 18:36:53 -08:00
MarcoFalke 13a7454fbd
Merge #14380: fix assert crash when specified change output spend size is unknown
0fb2e69815 CreateTransaction: Assume minimum p2sh-p2wpkh spend size for unknown change (Gregory Sanders)
b06483c96a Remove stale comment in CalculateMaximumSignedInputSize (Gregory Sanders)

Pull request description:

  This is triggered anytime a fundraw type call(psbt or legacy) is used with a change output address that the wallet doesn't know how to sign for.

  This regression was added in 6a34ff5335 since BnB coin selection actually cares about this.

  The fix is to assume the smallest typical spend, a P2SH-P2WPKH, which is calculated using a "prototype" dummy signature flow. Future work could generalize this infrastructure to get estimated sizes of inputs for a variety of types.

  I also removed a comment which I believe is stale and misleading.

Tree-SHA512: c7e2be189e524f81a7aa4454ad9370cefba715e3781f1e462c8bab77e4d27540191419029e3ebda11e3744c0703271e479dcd560d05e4d470048d9633e34da16
2018-11-30 10:49:49 -05:00
Luke Dashjr c87fc71f7e Bugfix: test/functional/rpc_psbt: Correct test description comment 2018-11-27 17:46:20 +00:00
Luke Dashjr 097c4aa379 Bugfix: test/functional/rpc_psbt: Remove check for specific error message that depends on uncertain assumptions
When converttopsbt is called with a signed transaction, it either fails with "TX decode failed" if one or more inputs were segwit, or "Inputs must not have scriptSigs and scriptWitnesses" otherwise.
Since no effort is made by the test to ensure the inputs are segwit or not, avoid checking the exact message used.
The error code is still checked to ensure it is of the correct kind of failure.
2018-11-27 17:43:48 +00:00
Wladimir J. van der Laan 47ed24cf8a
Merge #14356: fix converttopsbt permitsigdata arg, add basic test
88a79cb436 fix converttopsbt permitsigdata arg, add basic test (Gregory Sanders)

Pull request description:

  The final check for extraneous sigdata has a flipped boolean, resulting in incorrect behavior.

  Resolves https://github.com/bitcoin/bitcoin/issues/14355

Tree-SHA512: 5157a74b8ddebd7d836fba96765c4d7ed15a73d4289817353d3566a0f6803bd4bbc3f936735c517c7a83a6cbdb4052b9c61d23f6cc4ad00a6077278cd51adbd4
2018-11-12 19:14:13 +01:00
Gregory Sanders 0fb2e69815 CreateTransaction: Assume minimum p2sh-p2wpkh spend size for unknown change 2018-11-12 13:12:09 -05:00
Pieter Wuille 16e3b17578
Merge #14689: Require a public key to be retrieved when signing a P2PKH input
6b8d86ddb8 Require a public key to be retrieved when signing a P2PKH input (Andrew Chow)

Pull request description:

  If we do not have the public key for a P2PKH input, we should not continue to attempt to sign for it.

  This fixes a problem where a PSBT with a P2PKH output would include invalid BIP 32 derivation paths that are missing the public key.

Tree-SHA512: 850d5e74c06833da937d5bf0348bd134180be7167b6f9b9cecbf09f75e3543fbad60d0abbc0b9afdfa51ce165aa36168849f24a7c5abf1e75f37ce8f9a13d127
2018-11-09 20:14:28 -08:00
Andrew Chow 6b8d86ddb8 Require a public key to be retrieved when signing a P2PKH input
If we do not have the public key for a P2PKH input, we should not
continue to attempt to sign for it.
2018-11-08 10:38:43 -05:00
Glenn Willen e13fea975d Add regression test for PSBT signing bug #14473 2018-11-01 12:14:21 -07:00
Gregory Sanders 88a79cb436 fix converttopsbt permitsigdata arg, add basic test 2018-09-29 22:09:15 -04:00
Pieter Wuille 862d159d63 Add test for conversion from non-witness to witness UTXO 2018-09-22 15:27:25 -04:00
MarcoFalke fac9539836
qa: Run all tests even if wallet is not compiled 2018-09-10 17:53:21 -04:00
practicalswift ada356208e Fix typos reported by codespell 2018-09-04 13:11:26 +02:00
Gregory Sanders 61fe653bd9 fix walletcreatefundedpsbt deriv paths, add test 2018-08-24 17:03:55 -04:00
Gregory Sanders 1f0c4282e9 QA: add basic walletcreatefunded optional arg test 2018-08-20 13:02:20 -04:00
Andrew Chow 5df6f089b5 More tests of signer checks 2018-08-13 08:41:19 -07:00
practicalswift 68400d8b96 tests: Use explicit imports 2018-08-13 14:13:39 +02:00
Andrew Chow 020628e3a4 Tests for PSBT
Added functional tests for PSBT that test the RPCs. Also added all
of the BIP 174 test vectors (except for the updater tests) in the
functional tests.

Added a Unit test for the BIP 174 updater test vector.
2018-07-16 17:05:30 -07:00