diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-01-11 02:08:01 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-01-11 15:28:28 +0100 |
commit | 2f7978682245ada40e7f72c6f28bf2379fdc8ce2 (patch) | |
tree | 910b34219d84d8974bf59c23f13d8a04161cd08f /test/functional/data | |
parent | c561f2f06ed25f08f7776ac41aeb2999ebe79550 (diff) | |
download | bitcoin-2f7978682245ada40e7f72c6f28bf2379fdc8ce2.tar.xz |
test: refactor: add constant for sequence number `SEQUENCE_FINAL`
Diffstat (limited to 'test/functional/data')
-rw-r--r-- | test/functional/data/invalid_txs.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/functional/data/invalid_txs.py b/test/functional/data/invalid_txs.py index 33d6282961..3747b2a98d 100644 --- a/test/functional/data/invalid_txs.py +++ b/test/functional/data/invalid_txs.py @@ -28,6 +28,7 @@ from test_framework.messages import ( CTxIn, CTxOut, MAX_MONEY, + SEQUENCE_FINAL, ) from test_framework.blocktools import create_tx_with_script, MAX_BLOCK_SIGOPS from test_framework.script import ( @@ -77,7 +78,7 @@ class BadTxTemplate: def __init__(self, *, spend_tx=None, spend_block=None): self.spend_tx = spend_block.vtx[0] if spend_block else spend_tx self.spend_avail = sum(o.nValue for o in self.spend_tx.vout) - self.valid_txin = CTxIn(COutPoint(self.spend_tx.sha256, 0), b"", 0xffffffff) + self.valid_txin = CTxIn(COutPoint(self.spend_tx.sha256, 0), b"", SEQUENCE_FINAL) @abc.abstractmethod def get_tx(self, *args, **kwargs): @@ -137,7 +138,7 @@ class BadInputOutpointIndex(BadTxTemplate): bad_idx = num_indices + 100 tx = CTransaction() - tx.vin.append(CTxIn(COutPoint(self.spend_tx.sha256, bad_idx), b"", 0xffffffff)) + tx.vin.append(CTxIn(COutPoint(self.spend_tx.sha256, bad_idx), b"", SEQUENCE_FINAL)) tx.vout.append(CTxOut(0, basic_p2sh)) tx.calc_sha256() return tx @@ -175,7 +176,7 @@ class NonexistentInput(BadTxTemplate): def get_tx(self): tx = CTransaction() - tx.vin.append(CTxIn(COutPoint(self.spend_tx.sha256 + 1, 0), b"", 0xffffffff)) + tx.vin.append(CTxIn(COutPoint(self.spend_tx.sha256 + 1, 0), b"", SEQUENCE_FINAL)) tx.vin.append(self.valid_txin) tx.vout.append(CTxOut(1, basic_p2sh)) tx.calc_sha256() |