Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
contract_backend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Odysseus
contract_backend
Commits
d0872ce6
Commit
d0872ce6
authored
Nov 01, 2024
by
贾浩@五瓣科技
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
efd597c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
eth.go
dao/eth.go
+2
-2
monitor.go
monitor_task/monitor.go
+2
-2
No files found.
dao/eth.go
View file @
d0872ce6
...
@@ -42,8 +42,8 @@ func (d *Dao) LoopGasPrice() {
...
@@ -42,8 +42,8 @@ func (d *Dao) LoopGasPrice() {
// EstimateGasRecharge 估算充值金额
// EstimateGasRecharge 估算充值金额
func
(
d
*
Dao
)
EstimateGasRecharge
(
address
common
.
Address
)
(
val
*
big
.
Int
,
err
error
)
{
func
(
d
*
Dao
)
EstimateGasRecharge
(
address
common
.
Address
)
(
val
*
big
.
Int
,
err
error
)
{
_10val
:=
new
(
big
.
Int
)
.
Mul
(
d
.
gasPrice
,
big
.
NewInt
(
1
0
*
500000
))
// 10次 每次50w
_10val
:=
new
(
big
.
Int
)
.
Mul
(
d
.
gasPrice
,
big
.
NewInt
(
1
2
*
500000
))
// 10次 每次50w
_20val
:=
new
(
big
.
Int
)
.
Mul
(
d
.
gasPrice
,
big
.
NewInt
(
50
*
500000
))
// 20次 每次50w
_20val
:=
new
(
big
.
Int
)
.
Mul
(
d
.
gasPrice
,
big
.
NewInt
(
24
*
500000
))
// 20次 每次50w
currentBalance
,
err
:=
d
.
ethClient
.
BalanceAt
(
context
.
Background
(),
address
,
nil
)
currentBalance
,
err
:=
d
.
ethClient
.
BalanceAt
(
context
.
Background
(),
address
,
nil
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
monitor_task/monitor.go
View file @
d0872ce6
...
@@ -68,10 +68,10 @@ func (m *Monitor) ProcessOne(task *model.ExecTask) {
...
@@ -68,10 +68,10 @@ func (m *Monitor) ProcessOne(task *model.ExecTask) {
"app_key"
:
task
.
AppKey
,
"app_key"
:
task
.
AppKey
,
"model_ids"
:
task
.
ModelIdsArray
,
"model_ids"
:
task
.
ModelIdsArray
,
})
.
Info
(
"execute task"
)
})
.
Info
(
"execute task"
)
val10
,
_
:=
big
.
NewInt
(
10
)
.
SetString
(
"10000000000000000000"
,
10
)
val
:=
big
.
NewInt
(
0
)
.
Mul
(
big
.
NewInt
(
1000000000000000000
),
big
.
NewInt
(
int64
(
m
.
conf
.
Chain
.
ModelPrice
)))
// txHash, err := m.d.ExecuteTask(m.privateKey, task.Id, task.UserId, task.AppKey, task.ModelIdsArray, big.NewInt(int64(m.conf.Chain.ModelPrice)))
// txHash, err := m.d.ExecuteTask(m.privateKey, task.Id, task.UserId, task.AppKey, task.ModelIdsArray, big.NewInt(int64(m.conf.Chain.ModelPrice)))
txHash
,
err
:=
m
.
d
.
ExecuteTask
(
m
.
privateKey
,
task
.
Id
,
task
.
UserId
,
task
.
AppKey
,
task
.
ModelIdsArray
,
val
10
)
txHash
,
err
:=
m
.
d
.
ExecuteTask
(
m
.
privateKey
,
task
.
Id
,
task
.
UserId
,
task
.
AppKey
,
task
.
ModelIdsArray
,
val
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
WithFields
(
log
.
Fields
{
log
.
WithFields
(
log
.
Fields
{
"id"
:
task
.
Id
,
"id"
:
task
.
Id
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment