chore: lint v2 (#24118)
This commit is contained in:
+1
-1
@@ -87,7 +87,7 @@ func NewParamsFromPath(path string) (*BIP44Params, error) {
|
||||
fmt.Errorf("fourth and fifth field in path must not be hardened (ie. not contain the suffix ', got %s and %s", spl[3], spl[4])
|
||||
}
|
||||
|
||||
if !(change == 0 || change == 1) {
|
||||
if change != 0 && change != 1 {
|
||||
return nil, fmt.Errorf("change field can only be 0 or 1")
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ func (a *autoCLIKeyringAdapter) List() ([]string, error) {
|
||||
|
||||
// LookupAddressByKeyName returns the address of a key stored in the keyring
|
||||
func (a *autoCLIKeyringAdapter) LookupAddressByKeyName(name string) ([]byte, error) {
|
||||
record, err := a.Keyring.Key(name)
|
||||
record, err := a.Key(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -62,7 +62,7 @@ func (a *autoCLIKeyringAdapter) LookupAddressByKeyName(name string) ([]byte, err
|
||||
}
|
||||
|
||||
func (a *autoCLIKeyringAdapter) GetPubKey(name string) (cryptotypes.PubKey, error) {
|
||||
record, err := a.Keyring.Key(name)
|
||||
record, err := a.Key(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -71,7 +71,7 @@ func (a *autoCLIKeyringAdapter) GetPubKey(name string) (cryptotypes.PubKey, erro
|
||||
}
|
||||
|
||||
func (a *autoCLIKeyringAdapter) Sign(name string, msg []byte, signMode signingv1beta1.SignMode) ([]byte, error) {
|
||||
record, err := a.Keyring.Key(name)
|
||||
record, err := a.Key(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -67,5 +67,5 @@ func (suite *PKSuite) TestMarshal() {
|
||||
pk := new(PubKey)
|
||||
err = pk.Unmarshal(buffer, secp256r1, size)
|
||||
require.NoError(err)
|
||||
require.True(pk.PublicKey.Equal(&suite.pk.PublicKey))
|
||||
require.True(pk.Equal(&suite.pk.PublicKey))
|
||||
}
|
||||
|
||||
@@ -58,12 +58,12 @@ type ecdsaSK struct {
|
||||
|
||||
// Marshal implements customProtobufType.
|
||||
func (sk ecdsaSK) Marshal() ([]byte, error) {
|
||||
return sk.PrivKey.Bytes(), nil
|
||||
return sk.Bytes(), nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements customProtobufType.
|
||||
func (sk ecdsaSK) MarshalJSON() ([]byte, error) {
|
||||
b64 := base64.StdEncoding.EncodeToString(sk.PrivKey.Bytes())
|
||||
b64 := base64.StdEncoding.EncodeToString(sk.Bytes())
|
||||
return []byte("\"" + b64 + "\""), nil
|
||||
}
|
||||
|
||||
|
||||
@@ -67,12 +67,12 @@ type ecdsaPK struct {
|
||||
|
||||
// Marshal implements customProtobufType.
|
||||
func (pk ecdsaPK) Marshal() ([]byte, error) {
|
||||
return pk.PubKey.Bytes(), nil
|
||||
return pk.Bytes(), nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements customProtobufType.
|
||||
func (pk ecdsaPK) MarshalJSON() ([]byte, error) {
|
||||
b64 := base64.StdEncoding.EncodeToString(pk.PubKey.Bytes())
|
||||
b64 := base64.StdEncoding.EncodeToString(pk.Bytes())
|
||||
return []byte("\"" + b64 + "\""), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user