def read_transfer(txhash, data, inputs_array, owners, ownerlist): """ Parses a transfer transaction for meaning. Changes ownership state if valid. Implicit Rules ====> First output is transferred, second is change (in pixelspace) """ coords = p.decompress_coords(data) assert len(coords) == 2 recipient = txhash + ":0" #receiver should always be first output change_recipient = txhash + ":1" #second output should always receive change owners, ownerlist = adjust_ownership(owners, coords, recipient, inputs_array, ownerlist, change_recipient) return owners, ownerlist
def read_content_tx(txhash, tx_data=None): message_data = read_tx(txhash, tx_data) message = message_data[0] print message if not message is None: if len(message) > 0: if message[0] == "C": #is a content tx coords = message.split('/')[1] print "COORDS" print coords coords = p.decompress_coords(coords) q = message.split('/') url = '/'.join(q[2:len(q)]) return coords, url else: return None, None else: return None, None