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
7d217121
Commit
7d217121
authored
Nov 23, 2021
by
mdj33
Committed by
33cn
Nov 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code refactor to autonomy
parent
0ddcada7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
10 deletions
+9
-10
changeaction.go
plugin/dapp/autonomy/executor/changeaction.go
+4
-4
itemaction.go
plugin/dapp/autonomy/executor/itemaction.go
+2
-2
projectaction.go
plugin/dapp/autonomy/executor/projectaction.go
+2
-2
item.proto
plugin/dapp/autonomy/proto/item.proto
+1
-2
item.pb.go
plugin/dapp/autonomy/types/item.pb.go
+0
-0
No files found.
plugin/dapp/autonomy/executor/changeaction.go
View file @
7d217121
...
@@ -256,8 +256,8 @@ func (a *action) votePropChange(voteProb *auty.VoteProposalChange) (*types.Recei
...
@@ -256,8 +256,8 @@ func (a *action) votePropChange(voteProb *auty.VoteProposalChange) (*types.Recei
}
}
if
cfg
.
IsDappFork
(
a
.
height
,
auty
.
AutonomyX
,
auty
.
ForkAutonomyDelRule
)
{
if
cfg
.
IsDappFork
(
a
.
height
,
auty
.
AutonomyX
,
auty
.
ForkAutonomyDelRule
)
{
if
cur
.
VoteResult
.
TotalVotes
!=
0
&&
if
cur
.
VoteResult
.
TotalVotes
!=
0
&&
cur
.
VoteResult
.
TotalVotes
>
cur
.
VoteResult
.
QuitVotes
&&
float32
(
cur
.
VoteResult
.
ApproveVotes
)
/
float32
(
cur
.
VoteResult
.
TotalVotes
-
cur
.
VoteResult
.
QuitVotes
)
>
float32
(
cur
.
CurRule
.
BoardApproveRatio
)
/
100.0
{
cur
.
VoteResult
.
ApproveVotes
*
100
>
cur
.
CurRule
.
BoardApproveRatio
*
(
cur
.
VoteResult
.
TotalVotes
-
cur
.
VoteResult
.
QuitVotes
)
{
cur
.
VoteResult
.
Pass
=
true
cur
.
VoteResult
.
Pass
=
true
cur
.
PropChange
.
RealEndBlockHeight
=
a
.
height
cur
.
PropChange
.
RealEndBlockHeight
=
a
.
height
}
}
...
@@ -323,8 +323,8 @@ func (a *action) tmintPropChange(tmintProb *auty.TerminateProposalChange) (*type
...
@@ -323,8 +323,8 @@ func (a *action) tmintPropChange(tmintProb *auty.TerminateProposalChange) (*type
cfg
:=
a
.
api
.
GetConfig
()
cfg
:=
a
.
api
.
GetConfig
()
if
cfg
.
IsDappFork
(
a
.
height
,
auty
.
AutonomyX
,
auty
.
ForkAutonomyDelRule
)
{
if
cfg
.
IsDappFork
(
a
.
height
,
auty
.
AutonomyX
,
auty
.
ForkAutonomyDelRule
)
{
if
cur
.
VoteResult
.
TotalVotes
!=
0
&&
if
cur
.
VoteResult
.
TotalVotes
!=
0
&&
cur
.
VoteResult
.
TotalVotes
>
cur
.
VoteResult
.
QuitVotes
&&
float32
(
cur
.
VoteResult
.
ApproveVotes
)
/
float32
(
cur
.
VoteResult
.
TotalVotes
-
cur
.
VoteResult
.
QuitVotes
)
>
float32
(
cur
.
CurRule
.
BoardApproveRatio
)
/
100.0
{
cur
.
VoteResult
.
ApproveVotes
*
100
>
cur
.
CurRule
.
BoardApproveRatio
*
(
cur
.
VoteResult
.
TotalVotes
-
cur
.
VoteResult
.
QuitVotes
)
{
cur
.
VoteResult
.
Pass
=
true
cur
.
VoteResult
.
Pass
=
true
}
else
{
}
else
{
cur
.
VoteResult
.
Pass
=
false
cur
.
VoteResult
.
Pass
=
false
...
...
plugin/dapp/autonomy/executor/itemaction.go
View file @
7d217121
...
@@ -208,7 +208,7 @@ func (a *action) votePropItem(voteProb *auty.VoteProposalItem) (*types.Receipt,
...
@@ -208,7 +208,7 @@ func (a *action) votePropItem(voteProb *auty.VoteProposalItem) (*types.Receipt,
}
}
if
cur
.
BoardVoteRes
.
TotalVotes
!=
0
&&
cur
.
BoardVoteRes
.
TotalVotes
>
cur
.
BoardVoteRes
.
QuitVotes
&&
if
cur
.
BoardVoteRes
.
TotalVotes
!=
0
&&
cur
.
BoardVoteRes
.
TotalVotes
>
cur
.
BoardVoteRes
.
QuitVotes
&&
float32
(
cur
.
BoardVoteRes
.
ApproveVotes
)
/
float32
(
cur
.
BoardVoteRes
.
TotalVotes
-
cur
.
BoardVoteRes
.
QuitVotes
)
>=
float32
(
cur
.
CurRule
.
BoardApproveRatio
)
/
100.0
{
cur
.
BoardVoteRes
.
ApproveVotes
*
100
>=
(
cur
.
BoardVoteRes
.
TotalVotes
-
cur
.
BoardVoteRes
.
QuitVotes
)
*
cur
.
CurRule
.
BoardApproveRatio
{
cur
.
BoardVoteRes
.
Pass
=
true
cur
.
BoardVoteRes
.
Pass
=
true
cur
.
PropItem
.
RealEndBlockHeight
=
a
.
height
cur
.
PropItem
.
RealEndBlockHeight
=
a
.
height
}
}
...
@@ -261,7 +261,7 @@ func (a *action) tmintPropItem(tmintProb *auty.TerminateProposalItem) (*types.Re
...
@@ -261,7 +261,7 @@ func (a *action) tmintPropItem(tmintProb *auty.TerminateProposalItem) (*types.Re
}
}
if
cur
.
BoardVoteRes
.
TotalVotes
!=
0
&&
cur
.
BoardVoteRes
.
TotalVotes
>
cur
.
BoardVoteRes
.
QuitVotes
&&
if
cur
.
BoardVoteRes
.
TotalVotes
!=
0
&&
cur
.
BoardVoteRes
.
TotalVotes
>
cur
.
BoardVoteRes
.
QuitVotes
&&
float32
(
cur
.
BoardVoteRes
.
ApproveVotes
)
/
float32
(
cur
.
BoardVoteRes
.
TotalVotes
-
cur
.
BoardVoteRes
.
QuitVotes
)
>=
float32
(
cur
.
CurRule
.
BoardApproveRatio
)
/
100.0
{
cur
.
BoardVoteRes
.
ApproveVotes
*
100
>=
(
cur
.
BoardVoteRes
.
TotalVotes
-
cur
.
BoardVoteRes
.
QuitVotes
)
*
cur
.
CurRule
.
BoardApproveRatio
{
cur
.
BoardVoteRes
.
Pass
=
true
cur
.
BoardVoteRes
.
Pass
=
true
}
else
{
}
else
{
cur
.
BoardVoteRes
.
Pass
=
false
cur
.
BoardVoteRes
.
Pass
=
false
...
...
plugin/dapp/autonomy/executor/projectaction.go
View file @
7d217121
...
@@ -262,7 +262,7 @@ func (a *action) votePropProject(voteProb *auty.VoteProposalProject) (*types.Rec
...
@@ -262,7 +262,7 @@ func (a *action) votePropProject(voteProb *auty.VoteProposalProject) (*types.Rec
if
a
.
api
.
GetConfig
()
.
IsDappFork
(
a
.
height
,
auty
.
AutonomyX
,
auty
.
ForkAutonomyDelRule
)
{
if
a
.
api
.
GetConfig
()
.
IsDappFork
(
a
.
height
,
auty
.
AutonomyX
,
auty
.
ForkAutonomyDelRule
)
{
if
cur
.
BoardVoteRes
.
TotalVotes
!=
0
&&
cur
.
BoardVoteRes
.
TotalVotes
>
cur
.
BoardVoteRes
.
QuitVotes
&&
if
cur
.
BoardVoteRes
.
TotalVotes
!=
0
&&
cur
.
BoardVoteRes
.
TotalVotes
>
cur
.
BoardVoteRes
.
QuitVotes
&&
float32
(
cur
.
BoardVoteRes
.
ApproveVotes
)
/
float32
(
cur
.
BoardVoteRes
.
TotalVotes
-
cur
.
BoardVoteRes
.
QuitVotes
)
>=
float32
(
cur
.
CurRule
.
BoardApproveRatio
)
/
100.0
{
cur
.
BoardVoteRes
.
ApproveVotes
*
100
>=
(
cur
.
BoardVoteRes
.
TotalVotes
-
cur
.
BoardVoteRes
.
QuitVotes
)
*
cur
.
CurRule
.
BoardApproveRatio
{
cur
.
BoardVoteRes
.
Pass
=
true
cur
.
BoardVoteRes
.
Pass
=
true
cur
.
PropProject
.
RealEndBlockHeight
=
a
.
height
cur
.
PropProject
.
RealEndBlockHeight
=
a
.
height
}
}
...
@@ -464,7 +464,7 @@ func (a *action) tmintPropProject(tmintProb *auty.TerminateProposalProject) (*ty
...
@@ -464,7 +464,7 @@ func (a *action) tmintPropProject(tmintProb *auty.TerminateProposalProject) (*ty
}
}
if
a
.
api
.
GetConfig
()
.
IsDappFork
(
a
.
height
,
auty
.
AutonomyX
,
auty
.
ForkAutonomyDelRule
)
{
if
a
.
api
.
GetConfig
()
.
IsDappFork
(
a
.
height
,
auty
.
AutonomyX
,
auty
.
ForkAutonomyDelRule
)
{
if
cur
.
BoardVoteRes
.
TotalVotes
!=
0
&&
cur
.
BoardVoteRes
.
TotalVotes
>
cur
.
BoardVoteRes
.
QuitVotes
&&
if
cur
.
BoardVoteRes
.
TotalVotes
!=
0
&&
cur
.
BoardVoteRes
.
TotalVotes
>
cur
.
BoardVoteRes
.
QuitVotes
&&
float32
(
cur
.
BoardVoteRes
.
ApproveVotes
)
/
float32
(
cur
.
BoardVoteRes
.
TotalVotes
-
cur
.
BoardVoteRes
.
QuitVotes
)
>=
float32
(
cur
.
CurRule
.
BoardApproveRatio
)
/
100.0
{
cur
.
BoardVoteRes
.
ApproveVotes
*
100
>=
(
cur
.
BoardVoteRes
.
TotalVotes
-
cur
.
BoardVoteRes
.
QuitVotes
)
*
cur
.
CurRule
.
BoardApproveRatio
{
cur
.
BoardVoteRes
.
Pass
=
true
cur
.
BoardVoteRes
.
Pass
=
true
}
else
{
}
else
{
cur
.
BoardVoteRes
.
Pass
=
false
cur
.
BoardVoteRes
.
Pass
=
false
...
...
plugin/dapp/autonomy/proto/item.proto
View file @
7d217121
...
@@ -34,8 +34,7 @@ message ProposalItem {
...
@@ -34,8 +34,7 @@ message ProposalItem {
// 项目相关
// 项目相关
string
itemTxHash
=
4
;
// item tx hash
string
itemTxHash
=
4
;
// item tx hash
string
exec
=
5
;
// 合约执行器
string
description
=
5
;
// 简述
string
description
=
7
;
// 简述
// 投票相关
// 投票相关
int64
startBlockHeight
=
12
;
// 提案开始投票高度
int64
startBlockHeight
=
12
;
// 提案开始投票高度
...
...
plugin/dapp/autonomy/types/item.pb.go
View file @
7d217121
This diff is collapsed.
Click to expand it.
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