更改:悬赏金额变更需要同步至链上以及关联疑修新增标记是否解决

This commit is contained in:
2023-03-09 18:11:10 +08:00
parent d240797c25
commit 6c71994e33
5 changed files with 19 additions and 3 deletions

View File

@@ -46,8 +46,8 @@ module Api::V1::Issues::Concerns::Checkable
raise ApplicationService::Error, "ParentJournal不存在" unless Journal.find_by_id(parent_id).present?
end
def check_blockchain_token_num(user_id, project_id, blockchain_token_num)
def check_blockchain_token_num(user_id, project_id, blockchain_token_num, now_blockchain_token_num=0)
left_blockchain_token_num = Blockchain::BalanceQueryOneProject.call({"user_id": user_id, "project_id": project_id}) rescue 0
raise ApplicationService::Error, "项目Token不足。" if blockchain_token_num > left_blockchain_token_num
raise ApplicationService::Error, "项目Token不足。" if blockchain_token_num.to_i > (left_blockchain_token_num+now_blockchain_token_num).to_i
end
end