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
c093f7a4
Commit
c093f7a4
authored
Aug 05, 2019
by
liuyuhang
Committed by
33cn
Aug 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify linter
parent
e9985ab0
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
34 additions
and
37 deletions
+34
-37
round_state.go
plugin/consensus/tendermint/types/round_state.go
+0
-0
proposal_board.go
plugin/dapp/autonomy/commands/proposal_board.go
+2
-2
proposal_project.go
plugin/dapp/autonomy/commands/proposal_project.go
+2
-2
proposal_rule.go
plugin/dapp/autonomy/commands/proposal_rule.go
+3
-3
board.go
plugin/dapp/autonomy/executor/board.go
+4
-6
board_test.go
plugin/dapp/autonomy/executor/board_test.go
+4
-1
boardtable.go
plugin/dapp/autonomy/executor/boardtable.go
+1
-1
kv.go
plugin/dapp/autonomy/executor/kv.go
+0
-18
project.go
plugin/dapp/autonomy/executor/project.go
+4
-0
project_test.go
plugin/dapp/autonomy/executor/project_test.go
+4
-1
projecttable.go
plugin/dapp/autonomy/executor/projecttable.go
+1
-1
rule.go
plugin/dapp/autonomy/executor/rule.go
+4
-0
rule_test.go
plugin/dapp/autonomy/executor/rule_test.go
+4
-1
ruletable.go
plugin/dapp/autonomy/executor/ruletable.go
+1
-1
certutils.go
...rt/authority/tools/cryptogen/generator/utils/certutils.go
+0
-0
No files found.
plugin/consensus/tendermint/types/round_state.go
View file @
c093f7a4
plugin/dapp/autonomy/commands/proposal_board.go
View file @
c093f7a4
...
...
@@ -255,7 +255,7 @@ func ShowProposalBoardCmd() *cobra.Command {
}
func
addShowProposalBoardflags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
Uint32P
(
"type"
,
"
t
"
,
0
,
"type(0:query by hash; 1:list)"
)
cmd
.
Flags
()
.
Uint32P
(
"type"
,
"
y
"
,
0
,
"type(0:query by hash; 1:list)"
)
cmd
.
MarkFlagRequired
(
"type"
)
cmd
.
Flags
()
.
StringP
(
"proposalID"
,
"p"
,
""
,
"proposal ID"
)
...
...
@@ -264,7 +264,7 @@ func addShowProposalBoardflags(cmd *cobra.Command) {
cmd
.
Flags
()
.
StringP
(
"addr"
,
"a"
,
""
,
"address"
)
cmd
.
Flags
()
.
Int32P
(
"count"
,
"c"
,
1
,
"count, default is 1"
)
cmd
.
Flags
()
.
Int32P
(
"direction"
,
"d"
,
-
1
,
"direction, default is reserve"
)
cmd
.
Flags
()
.
Int64P
(
"height"
,
"
h
"
,
-
1
,
"height, default is -1"
)
cmd
.
Flags
()
.
Int64P
(
"height"
,
"
t
"
,
-
1
,
"height, default is -1"
)
cmd
.
Flags
()
.
Int32P
(
"index"
,
"i"
,
-
1
,
"index, default is -1"
)
}
...
...
plugin/dapp/autonomy/commands/proposal_project.go
View file @
c093f7a4
...
...
@@ -282,7 +282,7 @@ func ShowProposalProjectCmd() *cobra.Command {
}
func
addShowProposalProjectflags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
Uint32P
(
"type"
,
"
t
"
,
0
,
"type(0:query by hash; 1:list)"
)
cmd
.
Flags
()
.
Uint32P
(
"type"
,
"
y
"
,
0
,
"type(0:query by hash; 1:list)"
)
cmd
.
MarkFlagRequired
(
"type"
)
cmd
.
Flags
()
.
StringP
(
"proposalID"
,
"p"
,
""
,
"proposal ID"
)
...
...
@@ -291,7 +291,7 @@ func addShowProposalProjectflags(cmd *cobra.Command) {
cmd
.
Flags
()
.
StringP
(
"addr"
,
"a"
,
""
,
"address"
)
cmd
.
Flags
()
.
Int32P
(
"count"
,
"c"
,
1
,
"count, default is 1"
)
cmd
.
Flags
()
.
Int32P
(
"direction"
,
"d"
,
-
1
,
"direction, default is reserve"
)
cmd
.
Flags
()
.
Int64P
(
"height"
,
"
h
"
,
-
1
,
"height, default is -1"
)
cmd
.
Flags
()
.
Int64P
(
"height"
,
"
t
"
,
-
1
,
"height, default is -1"
)
cmd
.
Flags
()
.
Int32P
(
"index"
,
"i"
,
-
1
,
"index, default is -1"
)
}
...
...
plugin/dapp/autonomy/commands/proposal_rule.go
View file @
c093f7a4
...
...
@@ -222,7 +222,7 @@ func ShowProposalRuleCmd() *cobra.Command {
}
func
addShowProposalRuleflags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
Uint32P
(
"type"
,
"
t
"
,
0
,
"type(0:query by hash; 1:list)"
)
cmd
.
Flags
()
.
Uint32P
(
"type"
,
"
y
"
,
0
,
"type(0:query by hash; 1:list)"
)
cmd
.
MarkFlagRequired
(
"type"
)
cmd
.
Flags
()
.
StringP
(
"proposalID"
,
"p"
,
""
,
"proposal ID"
)
...
...
@@ -231,7 +231,7 @@ func addShowProposalRuleflags(cmd *cobra.Command) {
cmd
.
Flags
()
.
StringP
(
"addr"
,
"a"
,
""
,
"address"
)
cmd
.
Flags
()
.
Int32P
(
"count"
,
"c"
,
1
,
"count, default is 1"
)
cmd
.
Flags
()
.
Int32P
(
"direction"
,
"d"
,
-
1
,
"direction, default is reserve"
)
cmd
.
Flags
()
.
Int64P
(
"height"
,
"
h
"
,
-
1
,
"height, default is -1"
)
cmd
.
Flags
()
.
Int64P
(
"height"
,
"
t
"
,
-
1
,
"height, default is -1"
)
cmd
.
Flags
()
.
Int32P
(
"index"
,
"i"
,
-
1
,
"index, default is -1"
)
}
...
...
@@ -373,7 +373,7 @@ func addShowProposalCommentflags(cmd *cobra.Command) {
cmd
.
MarkFlagRequired
(
"proposalID"
)
cmd
.
Flags
()
.
Int32P
(
"count"
,
"c"
,
1
,
"count, default is 1"
)
cmd
.
Flags
()
.
Int32P
(
"direction"
,
"d"
,
-
1
,
"direction, default is reserve"
)
cmd
.
Flags
()
.
Int64P
(
"height"
,
"
h
"
,
-
1
,
"height, default is -1"
)
cmd
.
Flags
()
.
Int64P
(
"height"
,
"
t
"
,
-
1
,
"height, default is -1"
)
cmd
.
Flags
()
.
Int64P
(
"index"
,
"i"
,
-
1
,
"index, default is -1"
)
}
...
...
plugin/dapp/autonomy/executor/board.go
View file @
c093f7a4
...
...
@@ -5,8 +5,6 @@
package
executor
import
(
"fmt"
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
auty
"github.com/33cn/plugin/plugin/dapp/autonomy/types"
...
...
@@ -130,6 +128,10 @@ func (a *Autonomy) listProposalBoard(req *auty.ReqQueryProposalBoard) (types.Mes
cur
.
Height
=
req
.
Height
cur
.
Index
=
req
.
Index
prefix
,
err
:=
cur
.
Get
(
indexName
)
if
err
!=
nil
{
alog
.
Error
(
"Get"
,
"indexName"
,
indexName
,
"err"
,
err
)
return
nil
,
err
}
rows
,
err
:=
query
.
ListIndex
(
indexName
,
prefix
,
primary
,
req
.
Count
,
req
.
Direction
)
if
err
!=
nil
{
...
...
@@ -151,7 +153,3 @@ func (a *Autonomy) listProposalBoard(req *auty.ReqQueryProposalBoard) (types.Mes
}
return
&
rep
,
nil
}
func
genHeightIndexStr
(
index
int64
)
string
{
return
fmt
.
Sprintf
(
"%018d"
,
index
)
}
plugin/dapp/autonomy/executor/board_test.go
View file @
c093f7a4
...
...
@@ -326,7 +326,10 @@ func checkExecLocalBoard(t *testing.T, kvdb db.KVDB, cur *auty.AutonomyProposalB
prop
,
ok
:=
rows
[
0
]
.
Data
.
(
*
auty
.
AutonomyProposalBoard
)
assert
.
Equal
(
t
,
true
,
ok
)
assert
.
Equal
(
t
,
prop
,
cur
)
assert
.
Equal
(
t
,
prop
.
Status
,
cur
.
Status
)
assert
.
Equal
(
t
,
prop
.
Address
,
cur
.
Address
)
assert
.
Equal
(
t
,
prop
.
Height
,
cur
.
Height
)
assert
.
Equal
(
t
,
prop
.
Index
,
cur
.
Index
)
}
...
...
plugin/dapp/autonomy/executor/boardtable.go
View file @
c093f7a4
...
...
@@ -24,7 +24,7 @@ var boardOpt = &table.Option{
Index
:
[]
string
{
"addr"
,
"status"
,
"addr_status"
},
}
//NewTable 新建表
//New
Board
Table 新建表
func
NewBoardTable
(
kvdb
db
.
KV
)
*
table
.
Table
{
rowmeta
:=
NewBoardRow
()
table
,
err
:=
table
.
NewTable
(
rowmeta
,
kvdb
,
boardOpt
)
...
...
plugin/dapp/autonomy/executor/kv.go
View file @
c093f7a4
...
...
@@ -24,7 +24,6 @@ func votesRecord(txHash string) []byte {
var
(
// board
boardPrefix
=
idPrefix
+
"board"
+
"-"
localBoardPrefix
=
localPrefix
+
"board"
+
"-"
boardVotesRecordPrefix
=
boardPrefix
+
"vote"
+
"-"
)
...
...
@@ -40,30 +39,18 @@ func boardVotesRecord(txHash string) []byte {
return
[]
byte
(
fmt
.
Sprintf
(
"%s%s"
,
boardVotesRecordPrefix
,
txHash
))
}
func
calcBoardKey4StatusHeight
(
status
int32
,
heightindex
string
)
[]
byte
{
key
:=
fmt
.
Sprintf
(
localBoardPrefix
+
"%d-"
+
"%s"
,
status
,
heightindex
)
return
[]
byte
(
key
)
}
var
(
// project
projectPrefix
=
idPrefix
+
"project"
+
"-"
localProjectPrefix
=
localPrefix
+
"project"
+
"-"
)
func
propProjectID
(
txHash
string
)
[]
byte
{
return
[]
byte
(
fmt
.
Sprintf
(
"%s%s"
,
projectPrefix
,
txHash
))
}
func
calcProjectKey4StatusHeight
(
status
int32
,
heightindex
string
)
[]
byte
{
key
:=
fmt
.
Sprintf
(
localProjectPrefix
+
"%d-"
+
"%s"
,
status
,
heightindex
)
return
[]
byte
(
key
)
}
var
(
// rule
rulePrefix
=
idPrefix
+
"rule"
+
"-"
localRulePrefix
=
localPrefix
+
"rule"
+
"-"
)
func
activeRuleID
()
[]
byte
{
...
...
@@ -74,11 +61,6 @@ func propRuleID(txHash string) []byte {
return
[]
byte
(
fmt
.
Sprintf
(
"%s%s"
,
rulePrefix
,
txHash
))
}
func
calcRuleKey4StatusHeight
(
status
int32
,
heightindex
string
)
[]
byte
{
key
:=
fmt
.
Sprintf
(
localRulePrefix
+
"%d-"
+
"%s"
,
status
,
heightindex
)
return
[]
byte
(
key
)
}
var
(
// comment
localCommentPrefix
=
localPrefix
+
"cmt"
+
"-"
...
...
plugin/dapp/autonomy/executor/project.go
View file @
c093f7a4
...
...
@@ -128,6 +128,10 @@ func (a *Autonomy) listProposalProject(req *auty.ReqQueryProposalProject) (types
cur
.
Height
=
req
.
Height
cur
.
Index
=
req
.
Index
prefix
,
err
:=
cur
.
Get
(
indexName
)
if
err
!=
nil
{
alog
.
Error
(
"Get"
,
"indexName"
,
indexName
,
"err"
,
err
)
return
nil
,
err
}
rows
,
err
:=
query
.
ListIndex
(
indexName
,
prefix
,
primary
,
req
.
Count
,
req
.
Direction
)
if
err
!=
nil
{
...
...
plugin/dapp/autonomy/executor/project_test.go
View file @
c093f7a4
...
...
@@ -332,6 +332,9 @@ func checkExecLocalProject(t *testing.T, kvdb db.KVDB, cur *auty.AutonomyProposa
prop
,
ok
:=
rows
[
0
]
.
Data
.
(
*
auty
.
AutonomyProposalProject
)
assert
.
Equal
(
t
,
true
,
ok
)
assert
.
Equal
(
t
,
prop
,
cur
)
assert
.
Equal
(
t
,
prop
.
Status
,
cur
.
Status
)
assert
.
Equal
(
t
,
prop
.
Address
,
cur
.
Address
)
assert
.
Equal
(
t
,
prop
.
Height
,
cur
.
Height
)
assert
.
Equal
(
t
,
prop
.
Index
,
cur
.
Index
)
}
plugin/dapp/autonomy/executor/projecttable.go
View file @
c093f7a4
...
...
@@ -24,7 +24,7 @@ var projectOpt = &table.Option{
Index
:
[]
string
{
"addr"
,
"status"
,
"addr_status"
},
}
//NewTable 新建表
//New
Project
Table 新建表
func
NewProjectTable
(
kvdb
db
.
KV
)
*
table
.
Table
{
rowmeta
:=
NewProjectRow
()
table
,
err
:=
table
.
NewTable
(
rowmeta
,
kvdb
,
projectOpt
)
...
...
plugin/dapp/autonomy/executor/rule.go
View file @
c093f7a4
...
...
@@ -127,6 +127,10 @@ func (a *Autonomy) listProposalRule(req *auty.ReqQueryProposalRule) (types.Messa
cur
.
Height
=
req
.
Height
cur
.
Index
=
req
.
Index
prefix
,
err
:=
cur
.
Get
(
indexName
)
if
err
!=
nil
{
alog
.
Error
(
"Get"
,
"indexName"
,
indexName
,
"err"
,
err
)
return
nil
,
err
}
rows
,
err
:=
query
.
ListIndex
(
indexName
,
prefix
,
primary
,
req
.
Count
,
req
.
Direction
)
if
err
!=
nil
{
...
...
plugin/dapp/autonomy/executor/rule_test.go
View file @
c093f7a4
...
...
@@ -192,7 +192,10 @@ func checkExecLocalRule(t *testing.T, kvdb db.KVDB, cur *auty.AutonomyProposalRu
prop
,
ok
:=
rows
[
0
]
.
Data
.
(
*
auty
.
AutonomyProposalRule
)
assert
.
Equal
(
t
,
true
,
ok
)
assert
.
Equal
(
t
,
prop
,
cur
)
assert
.
Equal
(
t
,
prop
.
Status
,
cur
.
Status
)
assert
.
Equal
(
t
,
prop
.
Address
,
cur
.
Address
)
assert
.
Equal
(
t
,
prop
.
Height
,
cur
.
Height
)
assert
.
Equal
(
t
,
prop
.
Index
,
cur
.
Index
)
}
...
...
plugin/dapp/autonomy/executor/ruletable.go
View file @
c093f7a4
...
...
@@ -24,7 +24,7 @@ var ruleOpt = &table.Option{
Index
:
[]
string
{
"addr"
,
"status"
,
"addr_status"
},
}
//NewTable 新建表
//New
Rule
Table 新建表
func
NewRuleTable
(
kvdb
db
.
KV
)
*
table
.
Table
{
rowmeta
:=
NewRuleRow
()
table
,
err
:=
table
.
NewTable
(
rowmeta
,
kvdb
,
ruleOpt
)
...
...
plugin/dapp/cert/authority/tools/cryptogen/generator/utils/certutils.go
View file @
c093f7a4
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