Page MenuHomePhabricator

[qa] fix pad_tx to better match the desired size
ClosedPublic

Authored by schancel on Nov 19 2018, 07:27.

Details

Summary

Currently, pad_tx overpads quite often. This diff makes it pad the
correct amount except in specific cases. This enables us to simplify
some other tests which need to pad blocks.

Test Plan
./test/functional/test_runner.py

Diff Detail

Repository
rABC Bitcoin ABC
Branch
fix-pad-tx (branched from master)
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3988
Build 6048: Bitcoin ABC Buildbot (legacy)
Build 6047: arc lint + arc unit

Event Timeline

jasonbcox added inline comments.
test/functional/test_framework/txtools.py
53 ↗(On Diff #5926)

remove

55 ↗(On Diff #5926)

Rebase

jasonbcox requested changes to this revision.Nov 19 2018, 07:32
jasonbcox added inline comments.
test/functional/test_framework/txtools.py
27 ↗(On Diff #5926)

Does this deserve it's own assert before the loop? This way, we can provide a useful error message if the caller manages to build such a tx

28 ↗(On Diff #5926)

These comments should refer to pad_to_size, not MAX_TX_SIZE

This revision now requires changes to proceed.Nov 19 2018, 07:32
test/functional/test_framework/txtools.py
44

temp variable for required_padding - padding_len - extra_bytes

test/functional/test_framework/txtools.py
35

padding_len is always equal to required_padding at this line. remove this line and make the next line:
padding_len = min(required_padding, MAX_TXOUT_PUBKEY_SCRIPT - extra_bytes)

This revision is now accepted and ready to land.Nov 19 2018, 08:16
This revision was automatically updated to reflect the committed changes.