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
  1. MarcoFalke commented at 8:58 PM on April 22, 2020: member

    Add assert_equal in some tests to check the submitblock return value

  2. test: Check submitblock return values fa262712ca
  3. DrahtBot added the label Tests on Apr 22, 2020
  4. 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-failed somewhere?
    • It looks like there are a few other test files that call submitblock without checking the return value; should those be updated as well?
  5. 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?

  6. 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 otherwise
    

    However, BIP22 doesn't give a full list of possible strings. For example, it doesn't include inconclusive, block-validation-failed, bad-witness-nonce-size, or bad-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.

  7. 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?

  8. 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.

  9. MarcoFalke merged this on Apr 24, 2020
  10. MarcoFalke closed this on Apr 24, 2020

  11. MarcoFalke deleted the branch on Apr 24, 2020
  12. sidhujag referenced this in commit e32b0d1638 on Apr 24, 2020
  13. Fabcien referenced this in commit bd3d556490 on Jan 20, 2021
  14. DrahtBot locked this on Feb 15, 2022
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me