refactoring: Drop UpdateTransaction in favor of UpdateInput #13269

pull Empact wants to merge 1 commits into bitcoin:master from Empact:update-transaction changing 7 files +14 −21
  1. Empact commented at 1:00 am on May 18, 2018: member

    Updating the input explicitly requires the caller to present a mutable input, which more clearly communicates the effects and intent of the call (and, often, the enclosing loop).

    In most cases, this input is already immediately available and need not be looked up.

  2. fanquake added the label Refactoring on May 18, 2018
  3. kallewoof approved
  4. kallewoof commented at 5:22 am on May 18, 2018: member

    utACK 49d8e2d3ee4e50f625137204432780f85125af28

    Looks like a clear win to me.

  5. in src/test/transaction_tests.cpp:632 in 49d8e2d3ee outdated
    628@@ -629,7 +629,7 @@ BOOST_AUTO_TEST_CASE(test_witness)
    629     CreateCreditAndSpend(keystore2, scriptMulti, output2, input2, false);
    630     CheckWithFlag(output2, input2, 0, false);
    631     BOOST_CHECK(*output1 == *output2);
    632-    UpdateTransaction(input1, 0, CombineSignatures(output1->vout[0].scriptPubKey, MutableTransactionSignatureChecker(&input1, 0, output1->vout[0].nValue), DataFromTransaction(input1, 0), DataFromTransaction(input2, 0)));
    633+    UpdateInput(input1.vin.at(0), CombineSignatures(output1->vout[0].scriptPubKey, MutableTransactionSignatureChecker(&input1, 0, output1->vout[0].nValue), DataFromTransaction(input1, 0), DataFromTransaction(input2, 0)));
    


    promag commented at 3:08 pm on May 18, 2018:
    Replace all .at() usages with operator[].

    Empact commented at 6:06 pm on May 18, 2018:
    Thanks, I used at because UpdateTransaction asserted on the length, so it seemed more consistent, but I see now that CreateCreditAndSpend consistently creates this input.
  6. promag commented at 3:10 pm on May 18, 2018: member
    Concept ACK.
  7. Empact force-pushed on May 18, 2018
  8. Drop UpdateTransaction in favor of UpdateInput
    Updating the input explicitly requires the caller to present a mutable
    input, which more clearly communicates the effects and intent of the method.
    
    In most cases, this input is already immediately available and need not be
    looked up.
    6aa33feadb
  9. Empact force-pushed on May 18, 2018
  10. promag commented at 3:33 pm on May 21, 2018: member
    utACK 6aa33fe.
  11. MarcoFalke commented at 3:55 pm on May 21, 2018: member
    utACK 6aa33feadbe11bfa505a80a691d84db966aca134
  12. laanwj commented at 5:06 pm on June 5, 2018: member
    utACK 6aa33feadbe11bfa505a80a691d84db966aca134
  13. laanwj merged this on Jun 5, 2018
  14. laanwj closed this on Jun 5, 2018

  15. laanwj referenced this in commit f0fd39f376 on Jun 5, 2018
  16. Empact deleted the branch on Jul 2, 2018
  17. kittywhiskers referenced this in commit 39cd39f4ce on Jun 4, 2021
  18. kittywhiskers referenced this in commit 4cb155e3e8 on Jun 4, 2021
  19. UdjinM6 referenced this in commit 8fb8a12271 on Jun 7, 2021
  20. barrystyle referenced this in commit acb122e6cf on Jun 8, 2021
  21. barrystyle referenced this in commit 9166796714 on Jun 8, 2021
  22. kittywhiskers referenced this in commit fd6fe1c89b on Jun 9, 2021
  23. UdjinM6 referenced this in commit aac1e34aad on Jun 19, 2021
  24. UdjinM6 referenced this in commit e03b4c0ef8 on Jun 24, 2021
  25. UdjinM6 referenced this in commit b72833ebaf on Jun 26, 2021
  26. UdjinM6 referenced this in commit f159f31761 on Jun 26, 2021
  27. UdjinM6 referenced this in commit f679d8c788 on Jun 28, 2021
  28. kittywhiskers referenced this in commit 41a82cecd4 on Jul 9, 2021
  29. kittywhiskers referenced this in commit 427e09bd0c on Jul 13, 2021
  30. kittywhiskers referenced this in commit dae890b516 on Jul 13, 2021
  31. PastaPastaPasta referenced this in commit e98241da5d on Jul 13, 2021
  32. MarcoFalke locked this on Sep 8, 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: 2024-12-19 03:12 UTC

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