chore(tx): fix staticcheck issues (#15150)

This commit is contained in:
Mark Rushakoff
2023-02-24 15:02:56 +00:00
committed by GitHub
parent b53be683b6
commit 21d479c4ef
4 changed files with 9 additions and 4 deletions
+1
View File
@@ -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)
})
+1 -1
View File
@@ -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)
}
+6 -2
View File
@@ -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
+1 -1
View File
@@ -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