Commit 0c345a62 authored by liuyuhang's avatar liuyuhang Committed by vipwzw

modify linter

parent 51335caa
...@@ -117,9 +117,9 @@ type RoundState struct { ...@@ -117,9 +117,9 @@ type RoundState struct {
// RoundStateMessage ... // RoundStateMessage ...
func (rs *RoundState) RoundStateMessage() *tmtypes.NewRoundStepMsg { func (rs *RoundState) RoundStateMessage() *tmtypes.NewRoundStepMsg {
return &tmtypes.NewRoundStepMsg{ return &tmtypes.NewRoundStepMsg{
Height: rs.Height, Height: rs.Height,
Round: int32(rs.Round), Round: int32(rs.Round),
Step: int32(rs.Step), Step: int32(rs.Step),
SecondsSinceStartTime: int32(time.Since(rs.StartTime).Seconds()), SecondsSinceStartTime: int32(time.Since(rs.StartTime).Seconds()),
LastCommitRound: int32(rs.LastCommit.Round()), LastCommitRound: int32(rs.LastCommit.Round()),
} }
......
...@@ -73,9 +73,9 @@ func ParseX509CertificateToSm2(x509Cert *x509.Certificate) *sm2.Certificate { ...@@ -73,9 +73,9 @@ func ParseX509CertificateToSm2(x509Cert *x509.Certificate) *sm2.Certificate {
UnknownExtKeyUsage: x509Cert.UnknownExtKeyUsage, UnknownExtKeyUsage: x509Cert.UnknownExtKeyUsage,
BasicConstraintsValid: x509Cert.BasicConstraintsValid, BasicConstraintsValid: x509Cert.BasicConstraintsValid,
IsCA: x509Cert.IsCA, IsCA: x509Cert.IsCA,
MaxPathLen: x509Cert.MaxPathLen, MaxPathLen: x509Cert.MaxPathLen,
MaxPathLenZero: x509Cert.MaxPathLenZero, MaxPathLenZero: x509Cert.MaxPathLenZero,
SubjectKeyId: x509Cert.SubjectKeyId, SubjectKeyId: x509Cert.SubjectKeyId,
AuthorityKeyId: x509Cert.AuthorityKeyId, AuthorityKeyId: x509Cert.AuthorityKeyId,
...@@ -136,9 +136,9 @@ func ParseSm2CertificateToX509(sm2Cert *sm2.Certificate) *x509.Certificate { ...@@ -136,9 +136,9 @@ func ParseSm2CertificateToX509(sm2Cert *sm2.Certificate) *x509.Certificate {
UnknownExtKeyUsage: sm2Cert.UnknownExtKeyUsage, UnknownExtKeyUsage: sm2Cert.UnknownExtKeyUsage,
BasicConstraintsValid: sm2Cert.BasicConstraintsValid, BasicConstraintsValid: sm2Cert.BasicConstraintsValid,
IsCA: sm2Cert.IsCA, IsCA: sm2Cert.IsCA,
MaxPathLen: sm2Cert.MaxPathLen, MaxPathLen: sm2Cert.MaxPathLen,
MaxPathLenZero: sm2Cert.MaxPathLenZero, MaxPathLenZero: sm2Cert.MaxPathLenZero,
SubjectKeyId: sm2Cert.SubjectKeyId, SubjectKeyId: sm2Cert.SubjectKeyId,
AuthorityKeyId: sm2Cert.AuthorityKeyId, AuthorityKeyId: sm2Cert.AuthorityKeyId,
......
...@@ -129,7 +129,7 @@ func New(cfg *types.Store, sub []byte) queue.Module { ...@@ -129,7 +129,7 @@ func New(cfg *types.Store, sub []byte) queue.Module {
isDelMavlData = true isDelMavlData = true
} }
// 查询是Upgrade是否需保存mavl // 查询是Upgrade是否需保存mavl
isUpgradeCommitMavl = isCommitMavl(bs.GetDB()) isUpgradeCommitMavl = isCommitMavlDB(bs.GetDB())
bs.SetChild(kvms) bs.SetChild(kvms)
return kvms return kvms
...@@ -270,7 +270,7 @@ func (kvmMavls *KVmMavlStore) MemSetUpgrade(datas *types.StoreSet, sync bool) ([ ...@@ -270,7 +270,7 @@ func (kvmMavls *KVmMavlStore) MemSetUpgrade(datas *types.StoreSet, sync bool) ([
var err error var err error
if isUpgradeCommitMavl { if isUpgradeCommitMavl {
hash, err := kvmMavls.MavlStore.MemSet(datas, sync) hash, err = kvmMavls.MavlStore.MemSet(datas, sync)
if err != nil { if err != nil {
return hash, err return hash, err
} }
...@@ -381,7 +381,7 @@ func setDelMavl(state int32) { ...@@ -381,7 +381,7 @@ func setDelMavl(state int32) {
atomic.StoreInt32(&delMavlDataState, state) atomic.StoreInt32(&delMavlDataState, state)
} }
func isCommitMavl(db dbm.DB) bool { func isCommitMavlDB(db dbm.DB) bool {
prefix := []byte(leafNodePrefix) prefix := []byte(leafNodePrefix)
it := db.Iterator(prefix, nil, true) it := db.Iterator(prefix, nil, true)
defer it.Close() defer it.Close()
......
...@@ -720,12 +720,12 @@ func TestIsCommitMavl(t *testing.T) { ...@@ -720,12 +720,12 @@ func TestIsCommitMavl(t *testing.T) {
store := New(storeCfg, nil).(*KVmMavlStore) store := New(storeCfg, nil).(*KVmMavlStore)
assert.NotNil(t, store) assert.NotNil(t, store)
isComm := isCommitMavl(store.GetDB()) isComm := isCommitMavlDB(store.GetDB())
require.Equal(t, false, isComm) require.Equal(t, false, isComm)
store.GetDB().Set([]byte(fmt.Sprintln(leafNodePrefix, "123")), []byte("v1")) store.GetDB().Set([]byte(fmt.Sprintln(leafNodePrefix, "123")), []byte("v1"))
store.GetDB().Set([]byte(fmt.Sprintln(leafNodePrefix, "456")), []byte("v2")) store.GetDB().Set([]byte(fmt.Sprintln(leafNodePrefix, "456")), []byte("v2"))
isComm = isCommitMavl(store.GetDB()) isComm = isCommitMavlDB(store.GetDB())
require.Equal(t, true, isComm) require.Equal(t, true, isComm)
} }
......
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