forked from LBRYCommunity/lbry-sdk
moved lbry up one level
This commit is contained in:
parent
431499f43f
commit
2968f74c6c
316 changed files with 0 additions and 56 deletions
lbry/blob
26
lbry/blob/blob_info.py
Normal file
26
lbry/blob/blob_info.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
import typing
|
||||
|
||||
|
||||
class BlobInfo:
|
||||
__slots__ = [
|
||||
'blob_hash',
|
||||
'blob_num',
|
||||
'length',
|
||||
'iv',
|
||||
]
|
||||
|
||||
def __init__(self, blob_num: int, length: int, iv: str, blob_hash: typing.Optional[str] = None):
|
||||
self.blob_hash = blob_hash
|
||||
self.blob_num = blob_num
|
||||
self.length = length
|
||||
self.iv = iv
|
||||
|
||||
def as_dict(self) -> typing.Dict:
|
||||
d = {
|
||||
'length': self.length,
|
||||
'blob_num': self.blob_num,
|
||||
'iv': self.iv,
|
||||
}
|
||||
if self.blob_hash: # non-terminator blobs have a blob hash
|
||||
d['blob_hash'] = self.blob_hash
|
||||
return d
|
Loading…
Add table
Add a link
Reference in a new issue