Skip to content

Commit

Permalink
chore(tx): fix staticcheck issues (cosmos#15150)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-rushakoff authored Feb 24, 2023
1 parent b53be68 commit 21d479c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
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

0 comments on commit 21d479c

Please sign in to comment.