Skip to content

Commit

Permalink
Fix encoder unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ilija42 committed Dec 16, 2024
1 parent d795ae4 commit 4103493
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/solana/codec/encoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ func (t *testErrEncodeEntry) Encode(_ interface{}, _ []byte) ([]byte, error) {
return nil, fmt.Errorf("encode error")
}

func (t *testErrEncodeEntry) GetCodecType() commonencodings.TypeCodec {
return commonencodings.Empty{}
func (e *testErrEncodeEntry) GetType() reflect.Type {
return commonencodings.Empty{}.GetType()
}

type testErrEncodeTypeEntry struct {
Expand All @@ -42,7 +42,7 @@ func TestEncoder_Encode_Errors(t *testing.T) {
_, err := e.Encode(tests.Context(t), nil, "non-existent-type")
require.Error(t, err)
require.ErrorIs(t, err, commontypes.ErrInvalidType)
require.Contains(t, err.Error(), "cannot find definition for non-existent-type")
require.Contains(t, err.Error(), "cannot find type non-existent-type")
})

t.Run("error when convert fails because of unexpected type", func(t *testing.T) {
Expand Down

0 comments on commit 4103493

Please sign in to comment.