Beispiel #1
0
 def add_hash160data(self, rawtx, hexdata, dust_limit=common.DUST_LIMIT):
     """Writes <hexdata> as new Pay-to-PubkeyHash output to <rawtx>."""
     tx = deserialize.unsignedtx(rawtx)
     dust_limit = deserialize.positive_integer(dust_limit)
     hash160data_txout = deserialize.hash160data_txout(hexdata, dust_limit)
     tx = control.add_hash160data_output(tx, hash160data_txout)
     return serialize.tx(tx)
Beispiel #2
0
 def add_hash160data(self, rawtx, hexdata, dust_limit=common.DUST_LIMIT):
     """Writes <hexdata> as new Pay-to-PubkeyHash output to <rawtx>."""
     tx = deserialize.unsignedtx(rawtx)
     dust_limit = deserialize.positive_integer(dust_limit)
     hash160data_txout = deserialize.hash160data_txout(hexdata, dust_limit)
     tx = control.add_hash160data_output(tx, hash160data_txout)
     return serialize.tx(tx)
Beispiel #3
0
    def test_data_size(self):

        # twenty bytes ok
        max_data = 20 * b"aa"
        deserialize.hash160data_txout(max_data)

        # > twenty bytes fails
        def callback():
            over_max_data = 21 * b"aa"
            deserialize.hash160data_txout(over_max_data)
        self.assertRaises(exceptions.InvalidHash160DataSize, callback)

        # < twenty bytes fails
        def callback():
            over_max_data = 19 * b"aa"
            deserialize.hash160data_txout(over_max_data)
        self.assertRaises(exceptions.InvalidHash160DataSize, callback)
Beispiel #4
0
    def test_data_size(self):

        # twenty bytes ok
        max_data = 20 * b"aa"
        deserialize.hash160data_txout(max_data)

        # > twenty bytes fails
        def callback():
            over_max_data = 21 * b"aa"
            deserialize.hash160data_txout(over_max_data)

        self.assertRaises(exceptions.InvalidHash160DataSize, callback)

        # < twenty bytes fails
        def callback():
            over_max_data = 19 * b"aa"
            deserialize.hash160data_txout(over_max_data)

        self.assertRaises(exceptions.InvalidHash160DataSize, callback)
Beispiel #5
0
 def callback():
     over_max_data = 19 * b"aa"
     deserialize.hash160data_txout(over_max_data)
Beispiel #6
0
 def callback():
     over_max_data = 19 * b"aa"
     deserialize.hash160data_txout(over_max_data)