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

This commit is contained in:
Mark Rushakoff 2023-02-24 10:02:56 -05:00 committed by GitHub
parent b53be683b6
commit 21d479c4ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 4 deletions

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)
})

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)
}

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

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