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
6481df56
Commit
6481df56
authored
Aug 12, 2019
by
liuyuhang
Committed by
33cn
Aug 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
del autorollback config
parent
ec81cbf2
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
188 deletions
+18
-188
chain33.para.toml
chain33.para.toml
+0
-1
chain33.toml
chain33.toml
+0
-1
autonomy.go
plugin/dapp/autonomy/executor/autonomy.go
+0
-1
boardaction_test.go
plugin/dapp/autonomy/executor/boardaction_test.go
+0
-4
exec_del_local.go
plugin/dapp/autonomy/executor/exec_del_local.go
+3
-117
exec_local.go
plugin/dapp/autonomy/executor/exec_local.go
+14
-56
projectaction_test.go
plugin/dapp/autonomy/executor/projectaction_test.go
+0
-4
ruleaction_test.go
plugin/dapp/autonomy/executor/ruleaction_test.go
+1
-4
No files found.
chain33.para.toml
View file @
6481df56
...
...
@@ -179,7 +179,6 @@ paraConsensusStopBlocks=30000
[exec.sub.autonomy]
total
=
"16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp"
useBalance
=
false
autoRollback
=
false
#系统中所有的fork,默认用chain33的测试网络的
...
...
chain33.toml
View file @
6481df56
...
...
@@ -226,5 +226,4 @@ paraConsensusStopBlocks=30000
[exec.sub.autonomy]
total
=
"16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp"
useBalance
=
false
autoRollback
=
false
plugin/dapp/autonomy/executor/autonomy.go
View file @
6481df56
...
...
@@ -15,7 +15,6 @@ import (
type
subConfig
struct
{
Total
string
`json:"total"`
UseBalance
bool
`json:"useBalance"`
AutoRollback
bool
`json:"autoRollback"`
}
var
(
...
...
plugin/dapp/autonomy/executor/boardaction_test.go
View file @
6481df56
...
...
@@ -168,10 +168,6 @@ func testPropBoard(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.
kvdb
.
Set
(
kv
.
Key
,
kv
.
Value
)
}
}
// del
set
,
err
=
exec
.
ExecDelLocal
(
pbtx
,
receiptData
,
int
(
1
))
require
.
NoError
(
t
,
err
)
require
.
NotNil
(
t
,
set
)
// 更新tahash
env
.
txHash
=
common
.
ToHex
(
pbtx
.
Hash
())
...
...
plugin/dapp/autonomy/executor/exec_del_local.go
View file @
6481df56
...
...
@@ -6,123 +6,9 @@ package executor
import
(
"github.com/33cn/chain33/types"
auty
"github.com/33cn/plugin/plugin/dapp/autonomy/types"
)
// 提案董事会相关
// ExecDelLocal_PropBoard 创建提案董事会
func
(
a
*
Autonomy
)
ExecDelLocal_PropBoard
(
payload
*
auty
.
ProposalBoard
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoDelLocal
(
tx
,
receiptData
)
}
return
a
.
execDelLocalBoard
(
receiptData
)
}
// ExecDelLocal_RvkPropBoard 撤销提案
func
(
a
*
Autonomy
)
ExecDelLocal_RvkPropBoard
(
payload
*
auty
.
RevokeProposalBoard
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoDelLocal
(
tx
,
receiptData
)
}
return
a
.
execDelLocalBoard
(
receiptData
)
}
// ExecDelLocal_VotePropBoard 投票提案
func
(
a
*
Autonomy
)
ExecDelLocal_VotePropBoard
(
payload
*
auty
.
VoteProposalBoard
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoDelLocal
(
tx
,
receiptData
)
}
return
a
.
execDelLocalBoard
(
receiptData
)
}
// ExecDelLocal_TmintPropBoard 终止提案
func
(
a
*
Autonomy
)
ExecDelLocal_TmintPropBoard
(
payload
*
auty
.
TerminateProposalBoard
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoDelLocal
(
tx
,
receiptData
)
}
return
a
.
execDelLocalBoard
(
receiptData
)
}
// 提案项目相关
// ExecDelLocal_PropProject 创建提案项目
func
(
a
*
Autonomy
)
ExecDelLocal_PropProject
(
payload
*
auty
.
ProposalProject
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoDelLocal
(
tx
,
receiptData
)
}
return
a
.
execDelLocalProject
(
receiptData
)
}
// ExecDelLocal_RvkPropProject 撤销提案
func
(
a
*
Autonomy
)
ExecDelLocal_RvkPropProject
(
payload
*
auty
.
RevokeProposalProject
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoDelLocal
(
tx
,
receiptData
)
}
return
a
.
execDelLocalProject
(
receiptData
)
}
// ExecDelLocal_VotePropProject 投票提案
func
(
a
*
Autonomy
)
ExecDelLocal_VotePropProject
(
payload
*
auty
.
VoteProposalProject
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoDelLocal
(
tx
,
receiptData
)
}
return
a
.
execDelLocalProject
(
receiptData
)
}
// ExecDelLocal_PubVotePropProject 投票提案
func
(
a
*
Autonomy
)
ExecDelLocal_PubVotePropProject
(
payload
*
auty
.
PubVoteProposalProject
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoDelLocal
(
tx
,
receiptData
)
}
return
a
.
execDelLocalProject
(
receiptData
)
}
// ExecDelLocal_TmintPropProject 终止提案
func
(
a
*
Autonomy
)
ExecDelLocal_TmintPropProject
(
payload
*
auty
.
TerminateProposalProject
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoDelLocal
(
tx
,
receiptData
)
}
return
a
.
execDelLocalProject
(
receiptData
)
}
// 提案规则相关
// ExecDelLocal_PropRule 创建提案规则
func
(
a
*
Autonomy
)
ExecDelLocal_PropRule
(
payload
*
auty
.
ProposalRule
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoDelLocal
(
tx
,
receiptData
)
}
return
a
.
execDelLocalRule
(
receiptData
)
}
// ExecDelLocal_RvkPropRule 撤销提案规则
func
(
a
*
Autonomy
)
ExecDelLocal_RvkPropRule
(
payload
*
auty
.
RevokeProposalRule
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoDelLocal
(
tx
,
receiptData
)
}
return
a
.
execDelLocalRule
(
receiptData
)
}
// ExecDelLocal_VotePropRule 投票提案规则
func
(
a
*
Autonomy
)
ExecDelLocal_VotePropRule
(
payload
*
auty
.
VoteProposalRule
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoDelLocal
(
tx
,
receiptData
)
}
return
a
.
execDelLocalRule
(
receiptData
)
}
// ExecDelLocal_TmintPropRule 终止提案规则
func
(
a
*
Autonomy
)
ExecDelLocal_TmintPropRule
(
payload
*
auty
.
TerminateProposalRule
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoDelLocal
(
tx
,
receiptData
)
}
return
a
.
execDelLocalRule
(
receiptData
)
}
// ExecDelLocal_CommentProp 终止提案规则
func
(
a
*
Autonomy
)
ExecDelLocal_CommentProp
(
payload
*
auty
.
Comment
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoDelLocal
(
tx
,
receiptData
)
}
return
a
.
execDelLocalCommentProp
(
receiptData
)
// ExecDelLocal 回退自动删除,重写基类
func
(
a
*
Autonomy
)
ExecDelLocal
(
tx
*
types
.
Transaction
,
receipt
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
return
a
.
execAutoDelLocal
(
tx
,
receipt
)
}
plugin/dapp/autonomy/executor/exec_local.go
View file @
6481df56
...
...
@@ -13,116 +13,74 @@ import (
// ExecLocal_PropBoard 创建提案
func
(
a
*
Autonomy
)
ExecLocal_PropBoard
(
payload
*
auty
.
ProposalBoard
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoLocalBoard
(
tx
,
receiptData
)
}
return
a
.
execLocalBoard
(
receiptData
)
return
a
.
execAutoLocalBoard
(
tx
,
receiptData
)
}
// ExecLocal_RvkPropBoard 撤销提案
func
(
a
*
Autonomy
)
ExecLocal_RvkPropBoard
(
payload
*
auty
.
RevokeProposalBoard
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoLocalBoard
(
tx
,
receiptData
)
}
return
a
.
execLocalBoard
(
receiptData
)
return
a
.
execAutoLocalBoard
(
tx
,
receiptData
)
}
// ExecLocal_VotePropBoard 投票提案
func
(
a
*
Autonomy
)
ExecLocal_VotePropBoard
(
payload
*
auty
.
VoteProposalBoard
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoLocalBoard
(
tx
,
receiptData
)
}
return
a
.
execLocalBoard
(
receiptData
)
return
a
.
execAutoLocalBoard
(
tx
,
receiptData
)
}
// ExecLocal_TmintPropBoard 终止提案
func
(
a
*
Autonomy
)
ExecLocal_TmintPropBoard
(
payload
*
auty
.
TerminateProposalBoard
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoLocalBoard
(
tx
,
receiptData
)
}
return
a
.
execLocalBoard
(
receiptData
)
return
a
.
execAutoLocalBoard
(
tx
,
receiptData
)
}
// 提案项目相关
// ExecLocal_PropProject 创建提案项目
func
(
a
*
Autonomy
)
ExecLocal_PropProject
(
payload
*
auty
.
ProposalProject
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoLocalProject
(
tx
,
receiptData
)
}
return
a
.
execLocalProject
(
receiptData
)
return
a
.
execAutoLocalProject
(
tx
,
receiptData
)
}
// ExecLocal_RvkPropProject 撤销提案项目
func
(
a
*
Autonomy
)
ExecLocal_RvkPropProject
(
payload
*
auty
.
RevokeProposalProject
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoLocalProject
(
tx
,
receiptData
)
}
return
a
.
execLocalProject
(
receiptData
)
return
a
.
execAutoLocalProject
(
tx
,
receiptData
)
}
// ExecLocal_VotePropProject 投票提案项目
func
(
a
*
Autonomy
)
ExecLocal_VotePropProject
(
payload
*
auty
.
VoteProposalProject
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoLocalProject
(
tx
,
receiptData
)
}
return
a
.
execLocalProject
(
receiptData
)
return
a
.
execAutoLocalProject
(
tx
,
receiptData
)
}
// ExecLocal_PubVotePropProject 全体投票提案项目
func
(
a
*
Autonomy
)
ExecLocal_PubVotePropProject
(
payload
*
auty
.
PubVoteProposalProject
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoLocalProject
(
tx
,
receiptData
)
}
return
a
.
execLocalProject
(
receiptData
)
return
a
.
execAutoLocalProject
(
tx
,
receiptData
)
}
// ExecLocal_TmintPropProject 终止提案项目
func
(
a
*
Autonomy
)
ExecLocal_TmintPropProject
(
payload
*
auty
.
TerminateProposalProject
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoLocalProject
(
tx
,
receiptData
)
}
return
a
.
execLocalProject
(
receiptData
)
return
a
.
execAutoLocalProject
(
tx
,
receiptData
)
}
// 提案规则相关
// ExecLocal_PropRule 创建提案规则
func
(
a
*
Autonomy
)
ExecLocal_PropRule
(
payload
*
auty
.
ProposalRule
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoLocalRule
(
tx
,
receiptData
)
}
return
a
.
execLocalRule
(
receiptData
)
return
a
.
execAutoLocalRule
(
tx
,
receiptData
)
}
// ExecLocal_RvkPropRule 撤销提案规则
func
(
a
*
Autonomy
)
ExecLocal_RvkPropRule
(
payload
*
auty
.
RevokeProposalRule
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoLocalRule
(
tx
,
receiptData
)
}
return
a
.
execLocalRule
(
receiptData
)
return
a
.
execAutoLocalRule
(
tx
,
receiptData
)
}
// ExecLocal_VotePropRule 投票提案规则
func
(
a
*
Autonomy
)
ExecLocal_VotePropRule
(
payload
*
auty
.
VoteProposalRule
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoLocalRule
(
tx
,
receiptData
)
}
return
a
.
execLocalRule
(
receiptData
)
return
a
.
execAutoLocalRule
(
tx
,
receiptData
)
}
// ExecLocal_TmintPropRule 终止提案规则
func
(
a
*
Autonomy
)
ExecLocal_TmintPropRule
(
payload
*
auty
.
TerminateProposalRule
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoLocalRule
(
tx
,
receiptData
)
}
return
a
.
execLocalRule
(
receiptData
)
return
a
.
execAutoLocalRule
(
tx
,
receiptData
)
}
// ExecLocal_CommentProp 评论提案
func
(
a
*
Autonomy
)
ExecLocal_CommentProp
(
payload
*
auty
.
Comment
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
cfg
.
AutoRollback
{
return
a
.
execAutoLocalCommentProp
(
tx
,
receiptData
)
}
return
a
.
execLocalCommentProp
(
receiptData
)
return
a
.
execAutoLocalCommentProp
(
tx
,
receiptData
)
}
plugin/dapp/autonomy/executor/projectaction_test.go
View file @
6481df56
...
...
@@ -203,10 +203,6 @@ func testPropProject(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB db
kvdb
.
Set
(
kv
.
Key
,
kv
.
Value
)
}
}
// del
set
,
err
=
exec
.
ExecDelLocal
(
pbtx
,
receiptData
,
int
(
1
))
require
.
NoError
(
t
,
err
)
require
.
NotNil
(
t
,
set
)
// 更新tahash
env
.
txHash
=
common
.
ToHex
(
pbtx
.
Hash
())
...
...
plugin/dapp/autonomy/executor/ruleaction_test.go
View file @
6481df56
...
...
@@ -94,10 +94,7 @@ func testPropRule(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.K
kvdb
.
Set
(
kv
.
Key
,
kv
.
Value
)
}
}
// del
set
,
err
=
exec
.
ExecDelLocal
(
pbtx
,
receiptData
,
int
(
1
))
require
.
NoError
(
t
,
err
)
require
.
NotNil
(
t
,
set
)
// 更新tahash
env
.
txHash
=
common
.
ToHex
(
pbtx
.
Hash
())
env
.
startHeight
=
opt1
.
StartBlockHeight
...
...
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