Page MenuHomePhabricator

test: improve generation of conflicting transactions rpc_gettransactionstatus
ClosedPublic

Authored by PiRK on Sat, Apr 5, 15:41.

Details

Summary

This test previously relied on the assumption that the transactions are padded with random data to create two different conflicting transactions. This is a bit fragile, as it would break if for some reason the transaction were already larger than 100 bytes and pad_tx didn't add random data.
Also I am going to need to make the MiniWallet generate deterministic transactions for assumeutxo testing, as we need to checkpoint a deterministic utxo dump. I plan to achieve this by allowing pad_tx to use non-random data for padding, which is another way to break this test.

So use the target_size parameter to explicitely make the transactions different, even if pad_tx adds non-random data. The tx size is arbitrary. I picked a value slightly larger than a standard P2PK transaction (168 bytes), to reduce the risks of pad_tx being a no-op if for any reason we change the wallet mode in the future to RAW_P2PK.

Depends on D17901

Test Plan

ninja check-functional

Changed pad_tx to add deterministic data rather than random data, and checked that before this diff the test fails and after this diff it passes.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable