[WIP] test: Extract BuildCrediting/SpendingTransaction to shared factories folder #15133

pull Empact wants to merge 1 commits into bitcoin:master from Empact:factories changing 8 files +107 −103
  1. Empact commented at 6:28 AM on January 9, 2019: member

    This is a first step toward a library of common factory functions for test and bench purposes.

    This reduces duplication and supports writing tests by giving easier construction of the underlying types.

    Previously open as #14892.

  2. fanquake added the label Tests on Jan 9, 2019
  3. ryanofsky commented at 3:40 PM on January 9, 2019: member

    You may want to make this a "test_util" library instead of a "factory" library. That would clarify what this code is used for, make this a test-only change that should be easier to merge, and also create a home for other test code that could be reused.

  4. in src/factories/transactions.cpp:34 in 2c393e24d7 outdated
      29 | +    return txSpend;
      30 | +}
      31 | +
      32 | +CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CMutableTransaction& txCredit)
      33 | +{
      34 | +    return BuildSpendingTransaction(scriptSig, txCredit.vout[0].nValue, txCredit.GetHash());
    


    practicalswift commented at 8:51 PM on January 9, 2019:

    Aware of the implicit precision losing conversion from long (CAmount) to int here? Should be made explicit or perhaps add an assertion for the allowed value range?

  5. Empact force-pushed on Jan 9, 2019
  6. Empact force-pushed on Jan 9, 2019
  7. DrahtBot commented at 10:46 PM on January 9, 2019: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #15045 ([test] Apply maximal flags to tx_valid tests and minimal flags to tx_invalid tests by jl2012)
    • #13926 ([Tools] bitcoin-wallet - a tool for creating and managing wallets offline by jnewbery)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  8. Empact force-pushed on Jan 17, 2019
  9. test: Extract BuildCrediting/SpendingTransaction to shared factories folder
    This is a first step toward a library of common factory functions for test and
    bench purposes.
    2e526aef3a
  10. Empact force-pushed on Jan 17, 2019
  11. Empact closed this on Jan 17, 2019

  12. DrahtBot locked this on Dec 16, 2021

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-30 00:15 UTC

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