dev@locazia: nice fixes
This commit is contained in:
parent
4c0d6be3b1
commit
d65624faa5
|
|
@ -75,6 +75,16 @@ async def try_authorization(request):
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
activity_meta["args"] = dict(request.args)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
activity_meta["json"] = dict(request.json)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
activity_meta["method"] = request.method
|
activity_meta["method"] = request.method
|
||||||
except:
|
except:
|
||||||
|
|
@ -95,7 +105,7 @@ async def try_authorization(request):
|
||||||
type="API_V1_REQUEST",
|
type="API_V1_REQUEST",
|
||||||
meta=activity_meta,
|
meta=activity_meta,
|
||||||
user_id=user.id,
|
user_id=user.id,
|
||||||
user_ip=request.ip,
|
user_ip=activity_meta.get("ip", "0.0.0.0"),
|
||||||
created=datetime.now()
|
created=datetime.now()
|
||||||
)
|
)
|
||||||
request.ctx.db_session.add(new_user_activity)
|
request.ctx.db_session.add(new_user_activity)
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ async def indexer_loop(memory, platform_found: bool, seqno: int) -> [bool, int]:
|
||||||
make_log("Indexer", f"Last known index: {last_known_index}", level="debug")
|
make_log("Indexer", f"Last known index: {last_known_index}", level="debug")
|
||||||
next_item_index = last_known_index + 1
|
next_item_index = last_known_index + 1
|
||||||
|
|
||||||
resolve_item_result = await toncenter.run_get_method(platform.address.to_string(1, 1, 1), 'get_nft_address_by_index', [['num', hex(next_item_index)[2:]]])
|
resolve_item_result = await toncenter.run_get_method(platform.address.to_string(1, 1, 1), 'get_nft_address_by_index', [['num', (lambda x: (lambda y: (f"0{y}" if len(y) % 2 else y))(hex(x)[2:]))(next_item_index)]])
|
||||||
if resolve_item_result.get('exit_code', -1) != 0:
|
if resolve_item_result.get('exit_code', -1) != 0:
|
||||||
make_log("Indexer", f"Resolve item error: {resolve_item_result}", level="error")
|
make_log("Indexer", f"Resolve item error: {resolve_item_result}", level="error")
|
||||||
return platform_found, seqno
|
return platform_found, seqno
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,7 @@ class ContentId:
|
||||||
+ self.content_hash
|
+ self.content_hash
|
||||||
)
|
)
|
||||||
if not (self.safe_onchain_index is None):
|
if not (self.safe_onchain_index is None):
|
||||||
oi_bin_hex = hex(self.safe_onchain_index)[2:]
|
oi_bin_hex = (lambda x: (lambda y: (f"0{y}" if len(y) % 2 else y))(hex(x)[2:]))(self.safe_onchain_index)
|
||||||
if len(oi_bin_hex) % 2 == 1:
|
|
||||||
oi_bin_hex = '0' + oi_bin_hex
|
|
||||||
|
|
||||||
oi_bin_len = len(oi_bin_hex) // 2
|
oi_bin_len = len(oi_bin_hex) // 2
|
||||||
cid_bin += b'\xb0' + oi_bin_len.to_bytes(1, 'big') + bytes.fromhex(oi_bin_hex)
|
cid_bin += b'\xb0' + oi_bin_len.to_bytes(1, 'big') + bytes.fromhex(oi_bin_hex)
|
||||||
if self.accept_type and include_accept_type:
|
if self.accept_type and include_accept_type:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue