Skip to content

Commit

Permalink
fix: test sometimes receives an error string containing unicode (cosm…
Browse files Browse the repository at this point in the history
  • Loading branch information
kocubinski authored Apr 11, 2023
1 parent d46328c commit e342a47
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions x/tx/decode/unknown_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package decode_test

import (
"fmt"
"errors"
"testing"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -456,7 +456,7 @@ func TestRejectUnknownFieldsNested(t *testing.T) {
recv: new(testpb.TestVersion1),
// behavior change from previous implementation: we allow mismatched wire -> proto types,
// but this will still error on ConsumeFieldValue
wantErr: fmt.Errorf(`could not consume field value for tagNum: 8, wireType: "unknown type: 7"; proto: cannot parse reserved wire type`),
wantErr: errors.New("cannot parse reserved wire type"),
},
{
name: "From nested proto message, message index 0",
Expand Down Expand Up @@ -501,7 +501,7 @@ func TestRejectUnknownFieldsNested(t *testing.T) {
desc := tt.recv.ProtoReflect().Descriptor()
gotErr := decode.RejectUnknownFieldsStrict(protoBlob, desc, ProtoResolver)
if tt.wantErr != nil {
require.EqualError(t, gotErr, tt.wantErr.Error())
require.ErrorContains(t, gotErr, tt.wantErr.Error())
} else {
require.NoError(t, gotErr)
}
Expand Down Expand Up @@ -636,8 +636,6 @@ func TestRejectUnknownFieldsFlat(t *testing.T) {

c1 := new(testpb.Customer1)
c1Desc := c1.ProtoReflect().Descriptor()
// err = proto.Unmarshal(blob, c1)
// require.NoError(t, err)
gotErr := decode.RejectUnknownFieldsStrict(blob, c1Desc, ProtoResolver)
if tt.wantErr != nil {
require.EqualError(t, gotErr, tt.wantErr.Error())
Expand Down

0 comments on commit e342a47

Please sign in to comment.