コード例 #1
0
 def test_long_message(self):
     amount = b'\x00\x00\x00\x00\x00\x00\x00\x00'
     _, outputs = sanitize_tx_data(UNSPENTS, [(out[0], out[1], 'satoshi')
                                              for out in OUTPUTS],
                                   0,
                                   RETURN_ADDRESS,
                                   message='hello' * 50)
     assert construct_output_block(outputs).count(amount) == 2
コード例 #2
0
ファイル: test_transaction.py プロジェクト: soywu/bitcash
 def test_message(self):
     assert construct_output_block(OUTPUTS + MESSAGES) == hex_to_bytes(OUTPUT_BLOCK_MESSAGES)
コード例 #3
0
ファイル: test_transaction.py プロジェクト: soywu/bitcash
 def test_no_message(self):
     assert construct_output_block(OUTPUTS) == hex_to_bytes(OUTPUT_BLOCK)
コード例 #4
0
 def test_string_pushdata(self):
     # Preferable to raise TypeError if string input with custom_pushdata=True.
     with pytest.raises(TypeError):
         construct_output_block(OUTPUTS + [("hello", 0)],
                                custom_pushdata=True)
コード例 #5
0
 def test_pushdata_message(self):
     BYTES = len(b"hello").to_bytes(1, byteorder="little") + b"hello"
     assert construct_output_block(OUTPUTS + [(BYTES, 0)],
                                   custom_pushdata=True) == hex_to_bytes(
                                       OUTPUT_BLOCK_MESSAGE_PUSHDATA)