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
761c0efd
Commit
761c0efd
authored
Nov 28, 2018
by
liuyuhang
Committed by
33cn
Nov 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugin makefile中加入了 自动ineffassign检查
parent
b2ebdcd4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
Makefile
Makefile
+5
-1
lotterydb.go
plugin/dapp/lottery/executor/lotterydb.go
+1
-2
ticket.go
plugin/dapp/ticket/wallet/ticket.go
+1
-3
No files found.
Makefile
View file @
761c0efd
...
...
@@ -13,6 +13,7 @@ CHAIN33_PATH=vendor/${CHAIN33}
LDFLAGS
:=
-ldflags
"-w -s"
PKG_LIST_VET
:=
`
go list ./... |
grep
-v
"vendor"
|
grep
-v
plugin/dapp/evm/executor/vm/common/crypto/bn256
`
PKG_LIST
:=
`
go list ./... |
grep
-v
"vendor"
|
grep
-v
"chain33/test"
|
grep
-v
"mocks"
|
grep
-v
"pbft"
`
PKG_LIST_INEFFASSIGN
=
`
go list
-f
{{
.Dir
}}
./... |
grep
-v
"vendor"
`
BUILD_FLAGS
=
-ldflags
"-X github.com/33cn/chain33/common/version.GitCommit=
`
git rev-parse
--short
=
8 HEAD
`
"
MKPATH
=
$
(
abspath
$
(
lastword
$(MAKEFILE_LIST)
))
MKDIR
=
$
(
dir
$(MKPATH)
)
...
...
@@ -73,7 +74,7 @@ updatevendor:
dep
:
dep init
-v
linter
:
vet
##
Use gometalinter check code
,
ignore some unserious warning
linter
:
vet
ineffassign
##
Use gometalinter check code
,
ignore some unserious warning
@
./golinter.sh
"filter"
@
find
.
-name
'*.sh'
-not
-path
"./vendor/*"
| xargs shellcheck
...
...
@@ -81,6 +82,9 @@ linter_test: ## Use gometalinter check code, for local test
@
./golinter.sh
"test"
"
${
p
}
"
@
find
.
-name
'*.sh'
-not
-path
"./vendor/*"
| xargs shellcheck
ineffassign
:
@
ineffassign
-n
${
PKG_LIST_INEFFASSIGN
}
race
:
##
Run data race detector
@
go
test
-race
-short
$(PKG_LIST)
...
...
plugin/dapp/lottery/executor/lotterydb.go
View file @
761c0efd
...
...
@@ -511,7 +511,6 @@ func (action *Action) GetCalculableHash(beg, end int64, randMolNum int64) ([]byt
timeSource
:=
int64
(
0
)
total
:=
int64
(
0
)
//last := []byte("last")
newmodify
:=
""
for
i
:=
beg
;
i
<
end
;
i
+=
randMolNum
{
req
:=
&
types
.
ReqBlocks
{
Start
:
i
,
End
:
i
,
IsDetail
:
false
,
Pid
:
[]
string
{
""
}}
blocks
,
err
:=
action
.
api
.
GetBlocks
(
req
)
...
...
@@ -542,7 +541,7 @@ func (action *Action) GetCalculableHash(beg, end int64, randMolNum int64) ([]byt
ticketIds
+=
ticketAction
.
GetMiner
()
.
GetTicketId
()
}
newmodify
=
fmt
.
Sprintf
(
"%s:%s:%d:%d"
,
string
(
modifies
),
ticketIds
,
total
,
bits
)
newmodify
:
=
fmt
.
Sprintf
(
"%s:%s:%d:%d"
,
string
(
modifies
),
ticketIds
,
total
,
bits
)
modify
:=
common
.
Sha256
([]
byte
(
newmodify
))
return
modify
,
nil
...
...
plugin/dapp/ticket/wallet/ticket.go
View file @
761c0efd
...
...
@@ -552,10 +552,8 @@ func (policy *ticketPolicy) openticket(mineraddr, returnaddr string, priv crypto
ta
:=
&
ty
.
TicketAction
{}
topen
:=
&
ty
.
TicketOpen
{
MinerAddress
:
mineraddr
,
ReturnAddress
:
returnaddr
,
Count
:
count
,
RandSeed
:
types
.
Now
()
.
UnixNano
()}
hashList
:=
make
([][]
byte
,
int
(
count
))
privStr
:=
""
for
i
:=
0
;
i
<
int
(
count
);
i
++
{
privStr
=
fmt
.
Sprintf
(
"%x:%d:%d"
,
priv
.
Bytes
(),
i
,
topen
.
RandSeed
)
privHash
:=
common
.
Sha256
([]
byte
(
privStr
))
privHash
:=
common
.
Sha256
([]
byte
(
fmt
.
Sprintf
(
"%x:%d:%d"
,
priv
.
Bytes
(),
i
,
topen
.
RandSeed
)))
pubHash
:=
common
.
Sha256
(
privHash
)
hashList
[
i
]
=
pubHash
}
...
...
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