dev@locazia: ui fixes
This commit is contained in:
1 parent
606ef553bc
commit
b4b7a878f4
2 files changed
+12
-2
No files matched your search
@@ -38,7 +38,7 @@ class ContentId:
|
||||
def safe_onchain_index(self):
|
||||
return self.onchain_index if (not (self.onchain_index is None) and self.onchain_index >= 0) else None
|
||||
|
||||
def serialize_v2(self) -> str:
|
||||
def serialize_v2(self, include_accept_type=False) -> str:
|
||||
cid_bin = (
|
||||
(2).to_bytes(1, 'big') # cid version
|
||||
+ self.content_hash
|
||||
@@ -47,7 +47,7 @@ class ContentId:
|
||||
oi_bin_hex = hex(self.safe_onchain_index)[2:]
|
||||
oi_bin_len = math.ceil(len(oi_bin_hex) / 2)
|
||||
cid_bin += b'\xb0' + oi_bin_len.to_bytes(1, 'big') + bytes.fromhex(oi_bin_hex)
|
||||
if self.accept_type:
|
||||
if self.accept_type and include_accept_type:
|
||||
at_bin_len = len(self.accept_type.encode())
|
||||
at_bin = string_to_bytes_fixed_size(self.accept_type, at_bin_len)
|
||||
cid_bin += (
|
||||
|
||||
Reference in new issue
Block a user