Add the two new test vectors from:
https://github.com/bitcoin/bips/pull/2275 additionally requires existing Combine vectors to run in both orders, so we do that here too.
Add the two new test vectors from:
https://github.com/bitcoin/bips/pull/2275 additionally requires existing Combine vectors to run in both orders, so we do that here too.
Test both input orders per bitcoin/bips#2275.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36329.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline and AI policy for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | brunoerg, aaron-leeb |
If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
ACK f2a0db6
I tested the code locally and also did some code tracing to understand that the updates to combiner test are meant to run an additional test case where the last psbt is the first processed. The purpose is to ensure that no matter the order the psbts are processed, the underlying merge logic is order-independent
Personal note: I now understand that the combinepsbt method uses dynamic dispatch to handle the RPC command "combinepsbt" received by the node and runs the C++ code from psbt.cpp line 838 where the merge takes place.
The addition of the invalid psbt test data with <valuesize> not matching the expected <valuedata> for the psbt, checks that this code from psbt.h line 134 runs with expected behavior:
if (remaining_after + expected_size != remaining_before) { throw std::ios_base::failure("Size of value was not the stated size");
0 | @@ -1,5 +1,6 @@ 1 | { 2 | "invalid" : [ 3 | + "cHNidP8BADN0Af8HAAEAAAABAP8BAApzMXQo/wAAAAAB/wEDAQAAAQAAAAAAAAAAdgEAAABBAAkAAAAAAA==",
nit: could move it to invalid_with_msg with its expected error.
diff --git a/test/functional/data/rpc_psbt.json b/test/functional/data/rpc_psbt.json
--- a/test/functional/data/rpc_psbt.json
+++ b/test/functional/data/rpc_psbt.json
@@ -1,6 +1,5 @@
{
"invalid" : [
- "cHNidP8BADN0Af8HAAEAAAABAP8BAApzMXQo/wAAAAAB/wEDAQAAAQAAAAAAAAAAdgEAAABBAAkAAAAAAA==",
"AgAAAAEmgXE3Ht/yhek3re6ks3t4AAwFZsuzrWRkFxPKQhcb9gAAAABqRzBEAiBwsiRRI+a/R01gxbUMBD1MaRpd...
"cHNidP8BAHUCAAAAASaBcTce3/KF6Tet7qSze3gADAVmy7OtZGQXE8pCFxv2AAAAAAD+////AtPf9QUAAAAAGXap...
"cHNidP8BAP0KAQIAAAACqwlJoIxa98SbghL0F+LxWrP1wz3PFTghqBOfh3pbe+QAAAAAakcwRAIgR1lmF5fAGwNr...
@@ -157,6 +156,10 @@
[
"cHNidP8BAgQCAAAAAQMEAAAAAAEEAQEBBQECAQYBBwH7BAIAAAAAAQBSAgAAAAHBqiVuIUuWoYIvk95Cv/O18/+N...
"Required height based locktime is invalid (0)"
+ ],
+ [
+ "cHNidP8BADN0Af8HAAEAAAABAP8BAApzMXQo/wAAAAAB/wEDAQAAAQAAAAAAAAAAdgEAAABBAAkAAAAAAA==",
+ "Size of value was not the stated size"
]
],
"valid" : [
Done
Would there be any reason to do the same for the other "invalid" without a message for further clarity?
ACK f2a0db6309681c8ddc2963f34fb8519441f6668f
I'm re-running a mutation analysis for psbt, will have a result soon.
From bitcoin/bips#1971.
reACK 6fa2f3974cbb69fb2086a8f89d300deec4486662
reACK 6fa2f39