refactor!: turn MsgsV2 into ReflectMessages to make it less confusing (#19839)

Co-authored-by: marbar3778 <marbar3778@yahoo.com>
Co-authored-by: sontrinh16 <trinhleson2000@gmail.com>
Co-authored-by: Marko <marko@baricevic.me>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Aaron Craelius
2024-05-16 09:55:08 +00:00
committed by GitHub
co-authored by marbar3778 sontrinh16 Marko coderabbitai[bot]
parent 2c3fd19099
commit 53925ef5fd
18 changed files with 90 additions and 73 deletions
+12 -10
View File
@@ -3,7 +3,7 @@ package codec
import (
"github.com/cosmos/gogoproto/proto"
"google.golang.org/grpc/encoding"
protov2 "google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"github.com/cosmos/cosmos-sdk/codec/types"
)
@@ -24,17 +24,19 @@ type (
InterfaceRegistry() types.InterfaceRegistry
// GetMsgAnySigners returns the signers of the given message encoded in a protobuf Any
// as well as the decoded google.golang.org/protobuf/proto.Message that was used to
// extract the signers so that this can be used in other contexts.
GetMsgAnySigners(msg *types.Any) ([][]byte, protov2.Message, error)
// as well as the decoded protoreflect.Message that was used to extract the
// signers so that this can be used in other context where proto reflection
// is needed.
GetMsgAnySigners(msg *types.Any) ([][]byte, protoreflect.Message, error)
// GetMsgV2Signers returns the signers of the given message.
GetMsgV2Signers(msg protov2.Message) ([][]byte, error)
// GetMsgSigners returns the signers of the given message plus the
// decoded protoreflect.Message that was used to extract the
// signers so that this can be used in other context where proto reflection
// is needed.
GetMsgSigners(msg proto.Message) ([][]byte, protoreflect.Message, error)
// GetMsgV1Signers returns the signers of the given message plus the
// decoded google.golang.org/protobuf/proto.Message that was used to extract the
// signers so that this can be used in other contexts.
GetMsgV1Signers(msg proto.Message) ([][]byte, protov2.Message, error)
// GetReflectMsgSigners returns the signers of the given reflected proto message.
GetReflectMsgSigners(msg protoreflect.Message) ([][]byte, error)
// mustEmbedCodec requires that all implementations of Codec embed an official implementation from the codec
// package. This allows new methods to be added to the Codec interface without breaking backwards compatibility.