Commit f8f73509 authored by 陈涛's avatar 陈涛

修改pubkey的bug

parent 1b885c1d
...@@ -31,8 +31,8 @@ async def subscribe( ...@@ -31,8 +31,8 @@ async def subscribe(
): ):
try: try:
int(bind_node.pub_key) int(bind_node.pub_key)
except Exception as e:
raise RequestInvalidParamsError() raise RequestInvalidParamsError()
except Exception as e:
node_detail = await beacon_service.get_validator(index_or_pubkey=bind_node.pub_key) node_detail = await beacon_service.get_validator(index_or_pubkey=bind_node.pub_key)
db_data = BaseNode(**bind_node.dict(), index=node_detail.validator_index) db_data = BaseNode(**bind_node.dict(), index=node_detail.validator_index)
# 限制staking基金才可绑定节点 # 限制staking基金才可绑定节点
...@@ -78,8 +78,8 @@ async def get_node_info( ...@@ -78,8 +78,8 @@ async def get_node_info(
): ):
try: try:
int(pub_key) int(pub_key)
except Exception as e:
raise RequestInvalidParamsError() raise RequestInvalidParamsError()
except Exception as e:
query = {'id': fund_id, 'user_id': user.id, 'fund_type': FundType.staking, f"nodes.{pub_key}": {"$exists": True}} query = {'id': fund_id, 'user_id': user.id, 'fund_type': FundType.staking, f"nodes.{pub_key}": {"$exists": True}}
fund = await fund_collect.find_one(query) fund = await fund_collect.find_one(query)
assert fund, NotFundError('未绑定该节点') assert fund, NotFundError('未绑定该节点')
...@@ -101,8 +101,8 @@ async def get_node_deposit( ...@@ -101,8 +101,8 @@ async def get_node_deposit(
): ):
try: try:
int(pub_key) int(pub_key)
except Exception as e:
raise RequestInvalidParamsError() raise RequestInvalidParamsError()
except Exception as e:
query = {'id': fund_id, 'user_id': user.id, 'fund_type': FundType.staking, f"nodes.{pub_key}": {"$exists": True}} query = {'id': fund_id, 'user_id': user.id, 'fund_type': FundType.staking, f"nodes.{pub_key}": {"$exists": True}}
fund = await fund_collect.find_one(query) fund = await fund_collect.find_one(query)
assert fund, NotFundError('未绑定该节点') assert fund, NotFundError('未绑定该节点')
...@@ -125,8 +125,8 @@ async def get_node_blocks( ...@@ -125,8 +125,8 @@ async def get_node_blocks(
): ):
try: try:
int(pub_key) int(pub_key)
except Exception as e:
raise RequestInvalidParamsError() raise RequestInvalidParamsError()
except Exception as e:
start = (page.page - 1) * page.page_size start = (page.page - 1) * page.page_size
query = {'id': fund_id, 'user_id': user.id, 'fund_type': FundType.staking, f"nodes.{pub_key}": {"$exists": True}} query = {'id': fund_id, 'user_id': user.id, 'fund_type': FundType.staking, f"nodes.{pub_key}": {"$exists": True}}
fund = await fund_collect.find_one(query) fund = await fund_collect.find_one(query)
...@@ -152,8 +152,8 @@ async def get_node_income( ...@@ -152,8 +152,8 @@ async def get_node_income(
): ):
try: try:
int(pub_key) int(pub_key)
except Exception as e:
raise RequestInvalidParamsError() raise RequestInvalidParamsError()
except Exception as e:
query = {'id': fund_id, 'user_id': user.id, 'fund_type': FundType.staking, f"nodes.{pub_key}": {"$exists": True}} query = {'id': fund_id, 'user_id': user.id, 'fund_type': FundType.staking, f"nodes.{pub_key}": {"$exists": True}}
fund = await fund_collect.find_one(query) fund = await fund_collect.find_one(query)
assert fund, NotFundError('未绑定该节点') assert fund, NotFundError('未绑定该节点')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment