Page MenuHomePhabricator

test: Mockwallet
ClosedPublic

Authored by PiRK on Sep 24 2021, 19:20.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC088ba20c3efb: test: Mockwallet
Summary

This introduces a minimalistic test wallet, which can be used as a drop in replacement for the Bitcoin Core wallet to create dummy transactions with a given fee rate.

This is a backport of core#19800

It is squashed with the first bugfix commit of core#19922:
https://github.com/bitcoin/bitcoin/pull/19922/commits/fa65a11d0c9a34ff7f4cc4efd53367794e751749

Test Plan

ninja check-functional

Diff Detail

Event Timeline

PiRK requested review of this revision.Sep 24 2021, 19:20
test/functional/test_framework/wallet.py
68 ↗(On Diff #30162)

I found that most transactions are 207 bytes in size, but occasionaly there is one that is 206 bytes.
I don't know if there are other sizes possible. I have not been able to see any other value in a loop of 100 executions of the tests.

Fabien requested changes to this revision.Sep 27 2021, 09:39
Fabien added a subscriber: Fabien.
Fabien added inline comments.
test/functional/test_framework/wallet.py
28 ↗(On Diff #30162)

You're missing a backport here

This revision now requires changes to proceed.Sep 27 2021, 09:39

rebase on D10247, use ADDRESS_P2SH_OP_TRUE instead of signing a regular p2pkh, move SCRIPTSIG_OP_TRUE to address.py

PiRK edited the summary of this revision. (Show Details)

use correct size for fee computation, subtract 1 when calling pad_tx

squash with the bugfix commit https://github.com/bitcoin/bitcoin/pull/19922/commits/fa65a11d0c9a34ff7f4cc4efd53367794e751749

Fabien requested changes to this revision.Oct 6 2021, 14:02
Fabien added inline comments.
test/functional/test_framework/wallet.py
55

If pad_tx ALWAYS overpads by 1 byte, then the fix should trivial.
If pad_tx SOMETIMES overpads by 1 byte, then this will fail occasionally.

What is the situation ?

This revision now requires changes to proceed.Oct 6 2021, 14:02
test/functional/test_framework/wallet.py
55

For this particular transaction size it overpads always by exactly 1 byte. I need to dive deeper into the issue to find out exactly what is happening for larger sizes (>172 if I remember correctly).

rebase on D10276 and get the correct size when padding the tx in MiniWallet.

This revision is now accepted and ready to land.Oct 7 2021, 13:33
This revision was automatically updated to reflect the committed changes.