Add assert_equal in some tests to check the submitblock return value
test: Check submitblock return values #18745
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2004-testSubmitblockReturnVal changing 3 files +8 −8-
MarcoFalke commented at 8:58 PM on April 22, 2020: member
-
test: Check submitblock return values fa262712ca
- DrahtBot added the label Tests on Apr 22, 2020
-
robot-visions commented at 5:35 PM on April 24, 2020: contributor
ACK fa262712ca0981cb0ee68cd3dd99a214a20dcbf1
Updated tests pass locally for me.
Future follow-ups:
- Does it make sense to document the RPC API strings like
block-validation-failedsomewhere? - It looks like there are a few other test files that call
submitblockwithout checking the return value; should those be updated as well?
- Does it make sense to document the RPC API strings like
-
MarcoFalke commented at 5:37 PM on April 24, 2020: member
It looks like there are a few other test files that call submitblock without checking the return value; should those be updated as well?
I'd say no. Most of them just send a valid block, so the result is
None. If the block wasn't valid, the tests would fail for that reason already.Does it make sense to document the RPC API strings like block-validation-failed somewhere?
Doesn't the documentation of submitblock tell that those are BIP22 reasons?
-
robot-visions commented at 7:00 PM on April 24, 2020: contributor
The documentation does say they're BIP22 reasons:
Result: null (json null) Returns JSON Null when valid, a string according to BIP22 otherwiseHowever, BIP22 doesn't give a full list of possible strings. For example, it doesn't include
inconclusive,block-validation-failed,bad-witness-nonce-size, orbad-witness-merkle-match.My question was whether it's important to document the full list of reasons somewhere. I don't have a strong opinion about this: mostly I am trying to understand how you think about what documentation is important.
-
MarcoFalke commented at 7:04 PM on April 24, 2020: member
No opinion on whether all detailed reasons should be documented. This seems unrelated to this test change either way?
-
robot-visions commented at 7:09 PM on April 24, 2020: contributor
Correct, it doesn't block this change at all.
When I said "Future Follow-Ups" I meant it as a way to get your input about future work (possibly that I might do) in separate PRs. Sorry I distracted from the main point of this change.
- MarcoFalke merged this on Apr 24, 2020
- MarcoFalke closed this on Apr 24, 2020
- MarcoFalke deleted the branch on Apr 24, 2020
- sidhujag referenced this in commit e32b0d1638 on Apr 24, 2020
- Fabcien referenced this in commit bd3d556490 on Jan 20, 2021
- DrahtBot locked this on Feb 15, 2022