mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
[qa] py2: Unfiddle strings into bytes explicitly
This commit is contained in:
@@ -77,9 +77,9 @@ class InvalidBlockRequestTest(ComparisonTestFramework):
|
||||
block2 = create_block(self.tip, create_coinbase(height), self.block_time)
|
||||
self.block_time += 1
|
||||
|
||||
# chr(81) is OP_TRUE
|
||||
tx1 = create_transaction(self.block1.vtx[0], 0, chr(81), 50 * COIN)
|
||||
tx2 = create_transaction(tx1, 0, chr(81), 50 * COIN)
|
||||
# b'0x51' is OP_TRUE
|
||||
tx1 = create_transaction(self.block1.vtx[0], 0, b'\x51', 50 * COIN)
|
||||
tx2 = create_transaction(tx1, 0, b'\x51', 50 * COIN)
|
||||
|
||||
block2.vtx.extend([tx1, tx2])
|
||||
block2.hashMerkleRoot = block2.calc_merkle_root()
|
||||
@@ -95,7 +95,7 @@ class InvalidBlockRequestTest(ComparisonTestFramework):
|
||||
assert(block2_orig.vtx != block2.vtx)
|
||||
|
||||
self.tip = block2.sha256
|
||||
yield TestInstance([[block2, RejectResult(16,'bad-txns-duplicate')], [block2_orig, True]])
|
||||
yield TestInstance([[block2, RejectResult(16, b'bad-txns-duplicate')], [block2_orig, True]])
|
||||
height += 1
|
||||
|
||||
'''
|
||||
@@ -110,7 +110,7 @@ class InvalidBlockRequestTest(ComparisonTestFramework):
|
||||
block3.rehash()
|
||||
block3.solve()
|
||||
|
||||
yield TestInstance([[block3, RejectResult(16,'bad-cb-amount')]])
|
||||
yield TestInstance([[block3, RejectResult(16, b'bad-cb-amount')]])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user