github.com/cosmos/cosmos-sdk@v0.50.10/codec/types/util.go (about)

     1  package types
     2  
     3  import (
     4  	"github.com/cosmos/gogoproto/proto"
     5  	protov2 "google.golang.org/protobuf/proto"
     6  )
     7  
     8  // MsgTypeURL returns the TypeURL of a `sdk.Msg`.
     9  func MsgTypeURL(msg proto.Message) string {
    10  	if m, ok := msg.(protov2.Message); ok {
    11  		return "/" + string(m.ProtoReflect().Descriptor().FullName())
    12  	}
    13  
    14  	return "/" + proto.MessageName(msg)
    15  }