Commit 903932bc authored by 张振华's avatar 张振华

update

parent a811360e
......@@ -612,8 +612,6 @@ func (cs *ConsensusState) InitTopNCandidators(version int64) {
version--
}
return
}
// UpdateTopNCandidators method
......@@ -706,8 +704,6 @@ func (cs *ConsensusState) InitCycleBoundaryInfo(task Task) {
//cs.cycleBoundaryMap[task.cycle] = info
cs.UpdateCBInfo(info)
}
return
}
// UpdateCBInfo method
......@@ -928,8 +924,6 @@ func (cs *ConsensusState) InitCycleVrfInfo(task Task) {
//cs.cycleBoundaryMap[task.cycle] = info
cs.UpdateVrfInfo(info)
}
return
}
// UpdateVrfInfo method
......
......@@ -228,7 +228,7 @@ func checkVrf(cs *ConsensusState) {
}
func checkTopNRegist(cs *ConsensusState) {
if whetherUpdateTopN == false {
if !whetherUpdateTopN {
return
}
......@@ -275,7 +275,7 @@ func checkTopNRegist(cs *ConsensusState) {
}
func checkTopNUpdate(cs *ConsensusState) {
if whetherUpdateTopN == false {
if !whetherUpdateTopN {
return
}
......
......@@ -72,11 +72,7 @@ func TestValidator(t *testing.T) {
}
func match(index int, val *Validator) bool {
if bytes.Equal(val.Address, val1.Address) {
return true
}
return false
return bytes.Equal(val.Address, val1.Address)
}
func TestValidatorSet(t *testing.T) {
......
......@@ -297,9 +297,7 @@ func candidatorQuery(cmd *cobra.Command, args []string) {
case "pubkeys":
keys := strings.Split(pubkeys, ";")
req := &dty.CandidatorQuery{}
for _, key := range keys {
req.Pubkeys = append(req.Pubkeys, key)
}
req.Pubkeys = append(req.Pubkeys, keys...)
params.FuncName = dty.FuncNameQueryCandidatorByPubkeys
params.Payload = types.MustPBToJSON(req)
var res dty.CandidatorReply
......@@ -337,9 +335,7 @@ func voteQuery(cmd *cobra.Command, args []string) {
}
keys := strings.Split(pubkeys, ";")
for _, key := range keys {
req.Pubkeys = append(req.Pubkeys, key)
}
req.Pubkeys = append(req.Pubkeys, keys...)
params.FuncName = dty.FuncNameQueryVote
params.Payload = types.MustPBToJSON(req)
......@@ -548,9 +544,7 @@ func vrfQuery(cmd *cobra.Command, args []string) {
}
keys := strings.Split(pubkeys, ";")
for _, key := range keys {
req.Pubkeys = append(req.Pubkeys, key)
}
req.Pubkeys = append(req.Pubkeys, keys...)
params.FuncName = dty.FuncNameQueryVrfByCycleForPubkeys
params.Payload = types.MustPBToJSON(req)
......
......@@ -190,7 +190,7 @@ func queryVrfByCycleAndPubkeys(kvdb db.KVDB, pubkeys []string, cycle int64) []*d
vrfs = append(vrfs, vrf)
}
if tempPubkeys == nil || len(tempPubkeys) == 0 {
if len(tempPubkeys) == 0 {
return vrfs
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment