Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
validator
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
validator
Commits
86f1a4d4
Commit
86f1a4d4
authored
May 28, 2024
by
贾浩@五瓣科技
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update mock job
parent
070e9d76
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
quest.go
core/quest.go
+22
-0
validator.go
core/validator.go
+1
-0
No files found.
core/quest.go
View file @
86f1a4d4
...
...
@@ -37,6 +37,28 @@ func (v *Validator) LoadPendingProofs(startTimestamp, endTimestamp int64) {
}
}
func
(
v
*
Validator
)
LoadMockProofs
()
{
mockAddresses
:=
[]
common
.
Address
{
common
.
HexToAddress
(
"0x1111111111111111111111111111111111111111"
),
common
.
HexToAddress
(
"0x2222222222222222222222222222222222222222"
),
common
.
HexToAddress
(
"0x3333333333333333333333333333333333333333"
),
common
.
HexToAddress
(
"0x4444444444444444444444444444444444444444"
),
common
.
HexToAddress
(
"0x5555555555555555555555555555555555555555"
),
common
.
HexToAddress
(
"0x6666666666666666666666666666666666666666"
),
common
.
HexToAddress
(
"0x7777777777777777777777777777777777777777"
),
common
.
HexToAddress
(
"0x8888888888888888888888888888888888888888"
),
common
.
HexToAddress
(
"0x9999999999999999999999999999999999999999"
),
}
proof
:=
&
validatorv1
.
ValidatedProof
{
Workload
:
100
,
}
for
_
,
address
:=
range
mockAddresses
{
v
.
AddPendingProof
(
address
,
proof
)
}
}
func
(
v
*
Validator
)
verifyProof
(
dbProof
*
quest
.
ProofModel
)
(
miner
common
.
Address
,
proof
*
validatorv1
.
ValidatedProof
)
{
if
dbProof
.
TaskWorkload
==
0
{
return
...
...
core/validator.go
View file @
86f1a4d4
...
...
@@ -145,6 +145,7 @@ func (v *Validator) ProcessDayJob() {
"yesterday timestamp"
:
v
.
yesterdayTimestamp
(),
})
.
Debug
(
"process day job"
)
v
.
LoadPendingProofs
(
v
.
yesterdayTimestamp
(),
v
.
todayTimestamp
())
v
.
LoadMockProofs
()
v
.
date
=
v
.
yesterdayString
()
dayProof
,
totalWorkload
:=
v
.
Commit
()
mstRoot
,
_
,
err
:=
v
.
CommitMST
(
dayProof
)
...
...
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