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

chore(tx): fix staticcheck issues #15150

Merged
merged 2 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions x/tx/aminojson/json_marshal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func TestAminoJSON_EdgeCases(t *testing.T) {
require.Equal(t, string(legacyBz), string(bz))

goProtoJSON, err := protojson.Marshal(tc.msg)
assert.NilError(t, err)
err = cdc.UnmarshalJSON(bz, msg2)
assert.NilError(t, err, "unmarshal failed: %s vs %s", legacyBz, goProtoJSON)
})
Expand Down
2 changes: 1 addition & 1 deletion x/tx/textual/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func BenchmarkDecimalValueRendererFormat(b *testing.B) {
b.ReportAllocs()

for i := 0; i < b.N; i++ {
for _, value := range intValues {
for _, value := range decimalValues {
if _, err := dvr.Format(ctx, value); err != nil {
b.Fatal(err)
}
Expand Down
8 changes: 6 additions & 2 deletions x/tx/textual/coin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ import (
"cosmossdk.io/x/tx/textual"
)

// Dedicated type for context Values, to avoid conflicts,
// per the (context.Context).WithValue docs.
type mockCoinMetadata string

// mockCoinMetadataKey is used in the mock coin metadata querier.
func mockCoinMetadataKey(denom string) string {
return fmt.Sprintf("%s-%s", "coin-metadata", denom)
func mockCoinMetadataKey(denom string) mockCoinMetadata {
return mockCoinMetadata(fmt.Sprintf("%s-%s", "coin-metadata", denom))
}

// mockCoinMetadataQuerier is a mock querier for coin metadata used for test
Expand Down
2 changes: 1 addition & 1 deletion x/tx/textual/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (mr *messageValueRenderer) Format(ctx context.Context, v protoreflect.Value
return nil, err
}

subscreens := make([]Screen, 0)
var subscreens []Screen
if fd.IsList() {
if r, ok := vr.(RepeatedValueRenderer); ok {
// If the field is a list, and handles its own repeated rendering
Expand Down