Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
link33
plugin
Commits
999ab02c
Commit
999ab02c
authored
Nov 08, 2021
by
QM
Committed by
vipwzw
Nov 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autonomy propEndBlockPeriod
parent
54d03741
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
0 deletions
+28
-0
boardaction.go
plugin/dapp/autonomy/executor/boardaction.go
+9
-0
changeaction.go
plugin/dapp/autonomy/executor/changeaction.go
+7
-0
projectaction.go
plugin/dapp/autonomy/executor/projectaction.go
+7
-0
ruleaction.go
plugin/dapp/autonomy/executor/ruleaction.go
+5
-0
No files found.
plugin/dapp/autonomy/executor/boardaction.go
View file @
999ab02c
...
@@ -31,6 +31,7 @@ const (
...
@@ -31,6 +31,7 @@ const (
pubApproveRatio
int32
=
66
// 全体持票人赞成率,以%计
pubApproveRatio
int32
=
66
// 全体持票人赞成率,以%计
pubOpposeRatio
int32
=
33
// 全体持票人否决率,以%计
pubOpposeRatio
int32
=
33
// 全体持票人否决率,以%计
startEndBlockPeriod
=
720
// 提案开始结束最小周期
startEndBlockPeriod
=
720
// 提案开始结束最小周期
propEndBlockPeriod
=
1000000
// 提案高度 结束高度最大周期 100W
)
)
type
action
struct
{
type
action
struct
{
...
@@ -110,6 +111,14 @@ func (a *action) propBoard(prob *auty.ProposalBoard) (*types.Receipt, error) {
...
@@ -110,6 +111,14 @@ func (a *action) propBoard(prob *auty.ProposalBoard) (*types.Receipt, error) {
prob
.
EndBlockHeight
,
"height"
,
a
.
height
)
prob
.
EndBlockHeight
,
"height"
,
a
.
height
)
return
nil
,
auty
.
ErrSetBlockHeight
return
nil
,
auty
.
ErrSetBlockHeight
}
}
if
a
.
api
.
GetConfig
()
.
IsDappFork
(
a
.
height
,
auty
.
AutonomyX
,
auty
.
ForkAutonomyDelRule
)
{
if
prob
.
EndBlockHeight
>
a
.
height
+
propEndBlockPeriod
{
alog
.
Error
(
"propBoard height invaild"
,
"EndBlockHeight"
,
prob
.
EndBlockHeight
,
"height"
,
a
.
height
)
return
nil
,
auty
.
ErrSetBlockHeight
}
}
if
len
(
prob
.
Boards
)
==
0
{
if
len
(
prob
.
Boards
)
==
0
{
alog
.
Error
(
"propBoard "
,
"proposal boards number is zero"
,
len
(
prob
.
Boards
))
alog
.
Error
(
"propBoard "
,
"proposal boards number is zero"
,
len
(
prob
.
Boards
))
return
nil
,
auty
.
ErrBoardNumber
return
nil
,
auty
.
ErrBoardNumber
...
...
plugin/dapp/autonomy/executor/changeaction.go
View file @
999ab02c
...
@@ -27,6 +27,13 @@ func (a *action) propChange(prob *auty.ProposalChange) (*types.Receipt, error) {
...
@@ -27,6 +27,13 @@ func (a *action) propChange(prob *auty.ProposalChange) (*types.Receipt, error) {
return
nil
,
auty
.
ErrSetBlockHeight
return
nil
,
auty
.
ErrSetBlockHeight
}
}
if
a
.
api
.
GetConfig
()
.
IsDappFork
(
a
.
height
,
auty
.
AutonomyX
,
auty
.
ForkAutonomyDelRule
)
{
if
prob
.
EndBlockHeight
>
a
.
height
+
propEndBlockPeriod
{
alog
.
Error
(
"propBoard height invaild"
,
"EndBlockHeight"
,
prob
.
EndBlockHeight
,
"height"
,
a
.
height
)
return
nil
,
auty
.
ErrSetBlockHeight
}
}
act
,
err
:=
a
.
getActiveBoard
()
act
,
err
:=
a
.
getActiveBoard
()
if
err
!=
nil
{
if
err
!=
nil
{
alog
.
Error
(
"propChange "
,
"addr"
,
a
.
fromaddr
,
"execaddr"
,
a
.
execaddr
,
"getActiveBoard failed"
,
err
)
alog
.
Error
(
"propChange "
,
"addr"
,
a
.
fromaddr
,
"execaddr"
,
a
.
execaddr
,
"getActiveBoard failed"
,
err
)
...
...
plugin/dapp/autonomy/executor/projectaction.go
View file @
999ab02c
...
@@ -31,6 +31,13 @@ func (a *action) propProject(prob *auty.ProposalProject) (*types.Receipt, error)
...
@@ -31,6 +31,13 @@ func (a *action) propProject(prob *auty.ProposalProject) (*types.Receipt, error)
return
nil
,
auty
.
ErrSetBlockHeight
return
nil
,
auty
.
ErrSetBlockHeight
}
}
if
a
.
api
.
GetConfig
()
.
IsDappFork
(
a
.
height
,
auty
.
AutonomyX
,
auty
.
ForkAutonomyDelRule
)
{
if
prob
.
EndBlockHeight
>
a
.
height
+
propEndBlockPeriod
{
alog
.
Error
(
"propBoard height invaild"
,
"EndBlockHeight"
,
prob
.
EndBlockHeight
,
"height"
,
a
.
height
)
return
nil
,
auty
.
ErrSetBlockHeight
}
}
if
prob
.
Amount
<=
0
{
if
prob
.
Amount
<=
0
{
err
:=
types
.
ErrInvalidParam
err
:=
types
.
ErrInvalidParam
alog
.
Error
(
"propProject amount invaild"
,
"amount"
,
prob
.
Amount
,
"error"
,
err
)
alog
.
Error
(
"propProject amount invaild"
,
"amount"
,
prob
.
Amount
,
"error"
,
err
)
...
...
plugin/dapp/autonomy/executor/ruleaction.go
View file @
999ab02c
...
@@ -80,6 +80,11 @@ func (a *action) propRule(prob *auty.ProposalRule) (*types.Receipt, error) {
...
@@ -80,6 +80,11 @@ func (a *action) propRule(prob *auty.ProposalRule) (*types.Receipt, error) {
alog
.
Error
(
"propRule RuleCfg invaild"
,
"PubAttendRatio"
,
prob
.
RuleCfg
.
PubAttendRatio
,
"PubApproveRatio"
,
prob
.
RuleCfg
.
PubApproveRatio
)
alog
.
Error
(
"propRule RuleCfg invaild"
,
"PubAttendRatio"
,
prob
.
RuleCfg
.
PubAttendRatio
,
"PubApproveRatio"
,
prob
.
RuleCfg
.
PubApproveRatio
)
return
nil
,
types
.
ErrInvalidParam
return
nil
,
types
.
ErrInvalidParam
}
}
if
prob
.
EndBlockHeight
>
a
.
height
+
propEndBlockPeriod
{
alog
.
Error
(
"propBoard height invaild"
,
"EndBlockHeight"
,
prob
.
EndBlockHeight
,
"height"
,
a
.
height
)
return
nil
,
auty
.
ErrSetBlockHeight
}
}
}
if
prob
.
StartBlockHeight
<
a
.
height
||
prob
.
EndBlockHeight
<
a
.
height
||
if
prob
.
StartBlockHeight
<
a
.
height
||
prob
.
EndBlockHeight
<
a
.
height
||
...
...
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