mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
change chain
This commit is contained in:
@@ -13,11 +13,11 @@ class Gitea::Chain::ChainGetService < Gitea::ChainService
|
||||
private
|
||||
|
||||
def request_params
|
||||
Hash.new.merge(data: params["chain_params"])
|
||||
params[:chain_params]
|
||||
end
|
||||
|
||||
def url
|
||||
chain_type = params["type"].to_s
|
||||
chain_type = params[:type].to_s
|
||||
case chain_type
|
||||
when "query"
|
||||
"/repos/amount/query".freeze
|
||||
|
||||
@@ -13,11 +13,11 @@ class Gitea::Chain::ChainPostService < Gitea::ChainService
|
||||
private
|
||||
|
||||
def request_params
|
||||
Hash.new.merge(data: params["chain_params"])
|
||||
Hash.new.merge(data: params[:chain_params])
|
||||
end
|
||||
|
||||
def url
|
||||
chain_type = params["type"].to_s
|
||||
chain_type = params[:type].to_s
|
||||
case chain_type
|
||||
when "create"
|
||||
"/repos/create".freeze
|
||||
|
||||
@@ -18,8 +18,10 @@ class Gitea::ChainService < ApplicationService
|
||||
|
||||
def get(url, params={})
|
||||
conn.get do |req|
|
||||
req.url = "#{request_url}"
|
||||
req.body = params[:data].to_json
|
||||
req.url "#{request_url}"
|
||||
params.each_pair do |key, value|
|
||||
req.params["#{key}"] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class Repositories::CreateService < ApplicationService
|
||||
username: user.try(:login),
|
||||
reponame: @repository.try(:identifier),
|
||||
token_name: @repository.try(:identifier),
|
||||
total_supply: 0
|
||||
total_supply: 1000000
|
||||
}
|
||||
}
|
||||
PostChainJob.perform_later(chain_params) #创建上链操作
|
||||
|
||||
Reference in New Issue
Block a user