-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap ProtoCodec in interface #7637
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7637 +/- ##
=======================================
Coverage 54.15% 54.15%
=======================================
Files 611 611
Lines 38566 38566
=======================================
Hits 20884 20884
Misses 15550 15550
Partials 2132 2132 |
// binary and JSON encoding. | ||
type ProtoCodecMarshaler interface { | ||
Marshaler | ||
InterfaceRegistry() types.InterfaceRegistry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want that - this is used for Amino.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is used for amino?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #7638 for reference. I don't think this change is necessary
@@ -11,13 +11,21 @@ import ( | |||
"github.com/gogo/protobuf/proto" | |||
) | |||
|
|||
// ProtoCodecMarshaler defines and interface for codecs that utilize Protobuf for both | |||
// binary and JSON encoding. | |||
type ProtoCodecMarshaler interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type ProtoCodecMarshaler interface { | |
type ProtoCodecI interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ProtoMarshaler type is already defined in that package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe ProtoMarshalerI
to align with other interface names in the SDK like AccountI
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a terrible name but I understand the reasoning. We should rename the other ProtoMarshaler
separately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually how about ProtoCodecI
. Maybe that's best?
also per @colin-axner's comment, this doesn't touch the getsignbytes thing. This touches the tx encoding for proto and is needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
Can we merge this and include in rc2? edit: looks like that is the case with the backports tag |
I think the rc1 is the next one. |
We did rc1 last week |
* WIP encoding change * Add test that describes issue * WIP debugging * remove extra code * Update codec/proto_codec.go Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Ok cleaned up this PR. Changes are minimal