mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-14 00:58:09 +00:00
[qa] backport: Test for duplicate inputs within a transaction
This commit is contained in:
parent
d1dee20547
commit
9bd08fd465
@ -95,7 +95,18 @@ class InvalidBlockRequestTest(ComparisonTestFramework):
|
|||||||
assert(block2_orig.vtx != block2.vtx)
|
assert(block2_orig.vtx != block2.vtx)
|
||||||
|
|
||||||
self.tip = block2.sha256
|
self.tip = block2.sha256
|
||||||
yield TestInstance([[block2, RejectResult(16, b'bad-txns-duplicate')], [block2_orig, True]])
|
yield TestInstance([[block2, RejectResult(16, b'bad-txns-duplicate')]])
|
||||||
|
|
||||||
|
# Check transactions for duplicate inputs
|
||||||
|
self.log.info("Test duplicate input block.")
|
||||||
|
|
||||||
|
block2_dup = copy.deepcopy(block2_orig)
|
||||||
|
block2_dup.vtx[2].vin.append(block2_dup.vtx[2].vin[0])
|
||||||
|
block2_dup.vtx[2].rehash()
|
||||||
|
block2_dup.hashMerkleRoot = block2_dup.calc_merkle_root()
|
||||||
|
block2_dup.rehash()
|
||||||
|
block2_dup.solve()
|
||||||
|
yield TestInstance([[block2_dup, RejectResult(16, b'bad-txns-inputs-duplicate')], [block2_orig, True]])
|
||||||
height += 1
|
height += 1
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
Loading…
Reference in New Issue
Block a user