Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: Lint all files based on latest setting (backport #1171, #1414) #1427

Merged
merged 6 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore
  • Loading branch information
tkxkd0159 committed Jun 19, 2024
commit ecf8e35d6005c7c0a7a96c934f50d23f9b3ac21c
4 changes: 0 additions & 4 deletions client/grpc/ocservice/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ func (s *IntegrationTestSuite) TestLatestValidatorSet_GRPC() {
{"with pagination", &ocservice.GetLatestValidatorSetRequest{Pagination: &qtypes.PageRequest{Offset: 0, Limit: uint64(len(vals))}}, false, ""},
}
for _, tc := range testCases {
tc := tc
s.Run(tc.name, func() {
grpcRes, err := s.queryClient.GetLatestValidatorSet(context.Background(), tc.req)
if tc.expErr {
Expand Down Expand Up @@ -256,7 +255,6 @@ func (s *IntegrationTestSuite) TestLatestValidatorSet_GRPCGateway() {
{"with pagination", fmt.Sprintf("%s/lbm/base/ostracon/v1/validatorsets/latest?pagination.offset=0&pagination.limit=2", vals[0].APIAddress), false, ""},
}
for _, tc := range testCases {
tc := tc
s.Run(tc.name, func() {
res, err := rest.GetRequest(tc.url)
s.Require().NoError(err)
Expand Down Expand Up @@ -289,7 +287,6 @@ func (s *IntegrationTestSuite) TestValidatorSetByHeight_GRPC() {
{"with pagination", &ocservice.GetValidatorSetByHeightRequest{Height: 1, Pagination: &qtypes.PageRequest{Offset: 0, Limit: 1}}, false, ""},
}
for _, tc := range testCases {
tc := tc
s.Run(tc.name, func() {
grpcRes, err := s.queryClient.GetValidatorSetByHeight(context.Background(), tc.req)
if tc.expErr {
Expand Down Expand Up @@ -318,7 +315,6 @@ func (s *IntegrationTestSuite) TestValidatorSetByHeight_GRPCGateway() {
{"with pagination", fmt.Sprintf("%s/lbm/base/ostracon/v1/validatorsets/%d?pagination.offset=0&pagination.limit=2", vals[0].APIAddress, 1), false, ""},
}
for _, tc := range testCases {
tc := tc
s.Run(tc.name, func() {
res, err := rest.GetRequest(tc.url)
s.Require().NoError(err)
Expand Down
2 changes: 1 addition & 1 deletion crypto/keys/secp256k1/secp256k1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func TestGenPrivKeyFromSecret(t *testing.T) {
gotPrivKey := secp256k1.GenPrivKeyFromSecret(tt.secret)
require.NotNil(t, gotPrivKey)
// interpret as a big.Int and make sure it is a valid field element:
fe := new(big.Int).SetBytes(gotPrivKey.Key[:])
fe := new(big.Int).SetBytes(gotPrivKey.Key)
require.True(t, fe.Cmp(N) < 0)
require.True(t, fe.Sign() > 0)
})
Expand Down
6 changes: 3 additions & 3 deletions crypto/ledger/ledger_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (mock LedgerSECP256K1Mock) GetPublicKeySECP256K1(derivationPath []uint32) (
return nil, err
}

_, pubkeyObject := secp256k1.PrivKeyFromBytes(secp256k1.S256(), derivedPriv[:])
_, pubkeyObject := secp256k1.PrivKeyFromBytes(secp256k1.S256(), derivedPriv)

return pubkeyObject.SerializeUncompressed(), nil
}
Expand All @@ -70,7 +70,7 @@ func (mock LedgerSECP256K1Mock) GetAddressPubKeySECP256K1(derivationPath []uint3
}

// re-serialize in the 33-byte compressed format
cmp, err := btcec.ParsePubKey(pk[:], btcec.S256())
cmp, err := btcec.ParsePubKey(pk, btcec.S256())
if err != nil {
return nil, "", fmt.Errorf("error parsing public key: %w", err)
}
Expand All @@ -97,7 +97,7 @@ func (mock LedgerSECP256K1Mock) SignSECP256K1(derivationPath []uint32, message [
return nil, err
}

priv, _ := secp256k1.PrivKeyFromBytes(secp256k1.S256(), derivedPriv[:])
priv, _ := secp256k1.PrivKeyFromBytes(secp256k1.S256(), derivedPriv)

sig, err := priv.Sign(crypto.Sha256(message))
if err != nil {
Expand Down