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
004e6d2a
Commit
004e6d2a
authored
Feb 05, 2021
by
jiangpeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix go linter
parent
58930eaa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
findlargefile.sh
findlargefile.sh
+1
-1
query_test.go
plugin/dapp/vote/executor/query_test.go
+14
-14
No files found.
findlargefile.sh
View file @
004e6d2a
...
@@ -48,7 +48,7 @@ for y in $objects; do
...
@@ -48,7 +48,7 @@ for y in $objects; do
# find the objects location in the repository tree
# find the objects location in the repository tree
other
=
$(
echo
"
${
allObjects
}
"
|
grep
"
$sha
"
)
other
=
$(
echo
"
${
allObjects
}
"
|
grep
"
$sha
"
)
#lineBreak=`echo -e "\n"`
#lineBreak=`echo -e "\n"`
output
=
"
${
output
}
\n
${
size
}
,
${
compressedSize
}
,
${
other
}
"
output
=
"
${
output
}
\
\
n
${
size
}
,
${
compressedSize
}
,
${
other
}
"
done
done
echo
-e
"
$output
"
| column
-t
-s
', '
echo
-e
"
$output
"
| column
-t
-s
', '
...
...
plugin/dapp/vote/executor/query_test.go
View file @
004e6d2a
...
@@ -30,13 +30,13 @@ func TestVote_Query_GetGroups(t *testing.T) {
...
@@ -30,13 +30,13 @@ func TestVote_Query_GetGroups(t *testing.T) {
exec
:=
mock
.
exec
exec
:=
mock
.
exec
funcName
:=
"GetGroups"
funcName
:=
"GetGroups"
data
,
err
:=
exec
.
Query
(
funcName
,
nil
)
_
,
err
:=
exec
.
Query
(
funcName
,
nil
)
require
.
Equal
(
t
,
types
.
ErrInvalidParam
,
err
)
require
.
Equal
(
t
,
types
.
ErrInvalidParam
,
err
)
data
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
groupIDs
[
3
:
]}))
_
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
groupIDs
[
3
:
]}))
require
.
Equal
(
t
,
errInvalidGroupID
,
err
)
require
.
Equal
(
t
,
errInvalidGroupID
,
err
)
data
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
groupIDs
[
:
3
]}))
_
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
groupIDs
[
:
3
]}))
require
.
Equal
(
t
,
types
.
ErrNotFound
,
err
)
require
.
Equal
(
t
,
types
.
ErrNotFound
,
err
)
data
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
groupIDs
[
:
2
]}))
data
,
err
:
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
groupIDs
[
:
2
]}))
require
.
Equal
(
t
,
nil
,
err
)
require
.
Equal
(
t
,
nil
,
err
)
groups
:=
data
.
(
*
vty
.
GroupInfos
)
groups
:=
data
.
(
*
vty
.
GroupInfos
)
require
.
Equal
(
t
,
2
,
len
(
groups
.
GroupList
))
require
.
Equal
(
t
,
2
,
len
(
groups
.
GroupList
))
...
@@ -64,13 +64,13 @@ func TestVote_Query_GetVotes(t *testing.T) {
...
@@ -64,13 +64,13 @@ func TestVote_Query_GetVotes(t *testing.T) {
exec
:=
mock
.
exec
exec
:=
mock
.
exec
funcName
:=
"GetVotes"
funcName
:=
"GetVotes"
data
,
err
:=
exec
.
Query
(
funcName
,
nil
)
_
,
err
:=
exec
.
Query
(
funcName
,
nil
)
require
.
Equal
(
t
,
types
.
ErrInvalidParam
,
err
)
require
.
Equal
(
t
,
types
.
ErrInvalidParam
,
err
)
data
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
[]
string
{
voteID2
}}))
_
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
[]
string
{
voteID2
}}))
require
.
Equal
(
t
,
types
.
ErrNotFound
,
err
)
require
.
Equal
(
t
,
types
.
ErrNotFound
,
err
)
data
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
[]
string
{
"voteid"
}}))
_
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
[]
string
{
"voteid"
}}))
require
.
Equal
(
t
,
errInvalidVoteID
,
err
)
require
.
Equal
(
t
,
errInvalidVoteID
,
err
)
data
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
[]
string
{
voteID
}}))
data
,
err
:
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
[]
string
{
voteID
}}))
require
.
Equal
(
t
,
nil
,
err
)
require
.
Equal
(
t
,
nil
,
err
)
vote
:=
data
.
(
*
vty
.
ReplyVoteList
)
vote
:=
data
.
(
*
vty
.
ReplyVoteList
)
require
.
Equal
(
t
,
voteID
,
vote
.
VoteList
[
0
]
.
ID
)
require
.
Equal
(
t
,
voteID
,
vote
.
VoteList
[
0
]
.
ID
)
...
@@ -90,13 +90,13 @@ func TestVote_Query_GetMembers(t *testing.T) {
...
@@ -90,13 +90,13 @@ func TestVote_Query_GetMembers(t *testing.T) {
exec
:=
mock
.
exec
exec
:=
mock
.
exec
funcName
:=
"GetMembers"
funcName
:=
"GetMembers"
data
,
err
:=
exec
.
Query
(
funcName
,
nil
)
_
,
err
:=
exec
.
Query
(
funcName
,
nil
)
require
.
Equal
(
t
,
types
.
ErrInvalidParam
,
err
)
require
.
Equal
(
t
,
types
.
ErrInvalidParam
,
err
)
data
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
[]
string
{
testAddrs
[
1
]}}))
_
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
[]
string
{
testAddrs
[
1
]}}))
require
.
Equal
(
t
,
types
.
ErrNotFound
,
err
)
require
.
Equal
(
t
,
types
.
ErrNotFound
,
err
)
data
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
[]
string
{
"addr"
}}))
_
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
[]
string
{
"addr"
}}))
require
.
Equal
(
t
,
types
.
ErrInvalidAddress
,
err
)
require
.
Equal
(
t
,
types
.
ErrInvalidAddress
,
err
)
data
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
[]
string
{
testAddrs
[
0
]}}))
data
,
err
:
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqStrings
{
Items
:
[]
string
{
testAddrs
[
0
]}}))
require
.
Equal
(
t
,
nil
,
err
)
require
.
Equal
(
t
,
nil
,
err
)
members
:=
data
.
(
*
vty
.
MemberInfos
)
members
:=
data
.
(
*
vty
.
MemberInfos
)
require
.
Equal
(
t
,
testAddrs
[
0
],
members
.
MemberList
[
0
]
.
Addr
)
require
.
Equal
(
t
,
testAddrs
[
0
],
members
.
MemberList
[
0
]
.
Addr
)
...
@@ -161,9 +161,9 @@ func TestVote_Query_ListVote(t *testing.T) {
...
@@ -161,9 +161,9 @@ func TestVote_Query_ListVote(t *testing.T) {
exec
:=
mock
.
exec
exec
:=
mock
.
exec
funcName
:=
"ListVote"
funcName
:=
"ListVote"
data
,
err
:=
exec
.
Query
(
funcName
,
nil
)
_
,
err
:=
exec
.
Query
(
funcName
,
nil
)
require
.
Equal
(
t
,
types
.
ErrInvalidParam
,
err
)
require
.
Equal
(
t
,
types
.
ErrInvalidParam
,
err
)
data
,
err
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqListVote
{
GroupID
:
groupID
,
ListReq
:
&
vty
.
ReqListItem
{}}))
data
,
err
:
=
exec
.
Query
(
funcName
,
types
.
Encode
(
&
vty
.
ReqListVote
{
GroupID
:
groupID
,
ListReq
:
&
vty
.
ReqListItem
{}}))
require
.
Nil
(
t
,
err
)
require
.
Nil
(
t
,
err
)
list
:=
data
.
(
*
vty
.
ReplyVoteList
)
list
:=
data
.
(
*
vty
.
ReplyVoteList
)
require
.
Equal
(
t
,
2
,
len
(
list
.
VoteList
))
require
.
Equal
(
t
,
2
,
len
(
list
.
VoteList
))
...
...
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