added protobuf to get and file_list commands

This commit is contained in:
Lex Berezhny 2019-04-21 13:51:10 -04:00
parent 26fec098e4
commit 19f300cc45

View file

@ -98,6 +98,11 @@ class ManagedStream:
def metadata(self) ->typing.Optional[typing.Dict]: def metadata(self) ->typing.Optional[typing.Dict]:
return None if not self.stream_claim_info else self.stream_claim_info.claim.stream.to_dict() return None if not self.stream_claim_info else self.stream_claim_info.claim.stream.to_dict()
@property
def metadata_protobuf(self) -> bytes:
if self.stream_claim_info:
return binascii.hexlify(self.stream_claim_info.claim.to_bytes())
@property @property
def blobs_completed(self) -> int: def blobs_completed(self) -> int:
return sum([1 if self.blob_manager.get_blob(b.blob_hash).get_is_verified() else 0 return sum([1 if self.blob_manager.get_blob(b.blob_hash).get_is_verified() else 0
@ -159,6 +164,7 @@ class ManagedStream:
'nout': self.nout, 'nout': self.nout,
'outpoint': self.outpoint, 'outpoint': self.outpoint,
'metadata': self.metadata, 'metadata': self.metadata,
'protobuf': self.metadata_protobuf,
'channel_claim_id': self.channel_claim_id, 'channel_claim_id': self.channel_claim_id,
'channel_name': self.channel_name, 'channel_name': self.channel_name,
'claim_name': self.claim_name 'claim_name': self.claim_name