test: Set mock time before creating block #21998

pull rnicoll wants to merge 1 commits into bitcoin:master from rnicoll:validate-block-test-time changing 1 files +1 −1
  1. rnicoll commented at 6:36 PM on May 19, 2021: contributor

    Set mock time before creating block template in validation_block_tests, rather than setting it after the template has been built. This ensures the time used when calculating difficulty bits matches the time on the block after mining.

  2. Set mock time before creating block
    Set mock time before creating block template in validation_block_tests, rather than setting it after the template has been built. This ensures the time used when calculating difficulty bits matches the time on the block after mining.
    eeb58e2b55
  3. DrahtBot added the label Tests on May 19, 2021
  4. MarcoFalke commented at 6:01 AM on May 20, 2021: member

    Regtest doesn't have difficulty adjustments

  5. rnicoll commented at 8:17 AM on May 20, 2021: contributor

    The tests as-is do not reach a point where the difficulty changes, which is why this doesn't make a difference to the outcome, but this patch comes from experimenting with retarget interval causing this test to fail.

  6. MarcoFalke commented at 8:38 AM on May 20, 2021: member

    ~0. Looks good, but it might be better to submit this as part of the pull request that changes the retarget

  7. rnicoll commented at 11:22 AM on May 22, 2021: contributor

    As you had probably guessed, I had in fact broken the no-retarget logic. Closing.

  8. rnicoll closed this on May 22, 2021

  9. rnicoll deleted the branch on May 22, 2021
  10. DrahtBot locked this on Aug 18, 2022
Contributors
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-21 21:14 UTC

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