diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-03-03 12:48:49 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-03-03 12:42:52 -0500 |
commit | faae5a9a356d821f0cbdea32030b0ce356351a1d (patch) | |
tree | 6633a446f6277e893012e2fb8371481cf9394361 /test/functional/mempool_accept.py | |
parent | ac5c5d0162a963be6fbaa53261c01705436a65f3 (diff) |
test: Add bad-txns-*-toolarge test cases to invalid_txs
Diffstat (limited to 'test/functional/mempool_accept.py')
-rwxr-xr-x | test/functional/mempool_accept.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/functional/mempool_accept.py b/test/functional/mempool_accept.py index 900cabccda..9ade22a7eb 100755 --- a/test/functional/mempool_accept.py +++ b/test/functional/mempool_accept.py @@ -16,6 +16,7 @@ from test_framework.messages import ( CTransaction, CTxOut, MAX_BLOCK_BASE_SIZE, + MAX_MONEY, ) from test_framework.script import ( hash160, @@ -220,7 +221,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework): # The following two validations prevent overflow of the output amounts (see CVE-2010-5139). self.log.info('A transaction with too large output value') tx.deserialize(BytesIO(hex_str_to_bytes(raw_tx_reference))) - tx.vout[0].nValue = 21000000 * COIN + 1 + tx.vout[0].nValue = MAX_MONEY + 1 self.check_mempool_result( result_expected=[{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'bad-txns-vout-toolarge'}], rawtxs=[tx.serialize().hex()], @@ -229,7 +230,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework): self.log.info('A transaction with too large sum of output values') tx.deserialize(BytesIO(hex_str_to_bytes(raw_tx_reference))) tx.vout = [tx.vout[0]] * 2 - tx.vout[0].nValue = 21000000 * COIN + tx.vout[0].nValue = MAX_MONEY self.check_mempool_result( result_expected=[{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'bad-txns-txouttotal-toolarge'}], rawtxs=[tx.serialize().hex()], |