refactor: remove gogoproto stringer annotations and MarshalYAML functions (#13850)
This commit is contained in:
@@ -76,8 +76,9 @@ type Owner struct {
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Owner) Reset() { *m = Owner{} }
|
||||
func (*Owner) ProtoMessage() {}
|
||||
func (m *Owner) Reset() { *m = Owner{} }
|
||||
func (m *Owner) String() string { return proto.CompactTextString(m) }
|
||||
func (*Owner) ProtoMessage() {}
|
||||
func (*Owner) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_6308261edd8470a9, []int{1}
|
||||
}
|
||||
@@ -165,25 +166,25 @@ func init() {
|
||||
}
|
||||
|
||||
var fileDescriptor_6308261edd8470a9 = []byte{
|
||||
// 277 bytes of a gzipped FileDescriptorProto
|
||||
// 274 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4a, 0xce, 0x2f, 0xce,
|
||||
0xcd, 0x2f, 0xd6, 0x4f, 0x4e, 0x2c, 0x48, 0x4c, 0xca, 0xcc, 0xc9, 0x2c, 0xa9, 0xd4, 0x2f, 0x33,
|
||||
0x4c, 0x4a, 0x2d, 0x49, 0x34, 0x44, 0x12, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x84,
|
||||
0xa8, 0xd5, 0x43, 0x92, 0x80, 0xaa, 0x95, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd2, 0x07,
|
||||
0xb1, 0x20, 0x1a, 0xa4, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x48, 0x49,
|
||||
0x83, 0x8b, 0xcb, 0x19, 0xae, 0x5d, 0x48, 0x84, 0x8b, 0x35, 0x33, 0x2f, 0x25, 0xb5, 0x42, 0x82,
|
||||
0x51, 0x81, 0x51, 0x83, 0x25, 0x08, 0xc2, 0xb1, 0x62, 0x99, 0xb1, 0x40, 0x9e, 0x41, 0xc9, 0x96,
|
||||
0x51, 0x81, 0x51, 0x83, 0x25, 0x08, 0xc2, 0xb1, 0x62, 0x99, 0xb1, 0x40, 0x9e, 0x41, 0xc9, 0x92,
|
||||
0x8b, 0xd5, 0xbf, 0x3c, 0x2f, 0xb5, 0x48, 0x48, 0x8c, 0x8b, 0x2d, 0x37, 0x3f, 0xa5, 0x34, 0x27,
|
||||
0x15, 0xac, 0x8a, 0x33, 0x08, 0xca, 0x13, 0x12, 0xe2, 0x62, 0xc9, 0x4b, 0xcc, 0x4d, 0x95, 0x60,
|
||||
0x02, 0x8b, 0x82, 0xd9, 0x56, 0x1c, 0x1d, 0x0b, 0xe4, 0x19, 0xc0, 0xda, 0xc3, 0xb9, 0x04, 0x10,
|
||||
0x16, 0x81, 0x0d, 0x2a, 0x16, 0x72, 0xe6, 0x62, 0xcb, 0x07, 0xb3, 0x24, 0x18, 0x15, 0x98, 0x35,
|
||||
0xb8, 0x8d, 0x14, 0xf4, 0x70, 0xfa, 0x48, 0x0f, 0xac, 0xc5, 0x89, 0xf3, 0xc4, 0x3d, 0x79, 0x86,
|
||||
0x15, 0xcf, 0x37, 0x68, 0x31, 0x06, 0x41, 0xb5, 0x3a, 0x79, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1,
|
||||
0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70,
|
||||
0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x7e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae,
|
||||
0x3e, 0x2c, 0x58, 0xc1, 0x94, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, 0x72, 0x18, 0x97, 0x54, 0x16,
|
||||
0xa4, 0x16, 0x27, 0xb1, 0x81, 0xc3, 0xc4, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x27, 0x8c, 0xba,
|
||||
0x4e, 0x85, 0x01, 0x00, 0x00,
|
||||
0x02, 0x8b, 0x82, 0xd9, 0x56, 0x2c, 0x1d, 0x20, 0xad, 0xe1, 0x5c, 0x02, 0x08, 0x4b, 0xc0, 0x86,
|
||||
0x14, 0x0b, 0x39, 0x73, 0xb1, 0xe5, 0x83, 0x59, 0x12, 0x8c, 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0x0a,
|
||||
0x7a, 0x38, 0x7d, 0xa3, 0x07, 0xd6, 0xe2, 0xc4, 0x79, 0xe2, 0x9e, 0x3c, 0xc3, 0x8a, 0xe7, 0x1b,
|
||||
0xb4, 0x18, 0x83, 0xa0, 0x5a, 0x9d, 0x3c, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1,
|
||||
0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e,
|
||||
0x21, 0x4a, 0x3f, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x16, 0xa4,
|
||||
0x60, 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0x02, 0x39, 0x7c, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93,
|
||||
0xd8, 0xc0, 0xe1, 0x61, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x65, 0xb9, 0x70, 0x63, 0x81, 0x01,
|
||||
0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Capability) Marshal() (dAtA []byte, err error) {
|
||||
|
||||
@@ -4,8 +4,6 @@ import (
|
||||
"fmt"
|
||||
"sort"
|
||||
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
)
|
||||
|
||||
@@ -31,11 +29,6 @@ func (o Owner) Key() string {
|
||||
return fmt.Sprintf("%s/%s", o.Module, o.Name)
|
||||
}
|
||||
|
||||
func (o Owner) String() string {
|
||||
bz, _ := yaml.Marshal(o)
|
||||
return string(bz)
|
||||
}
|
||||
|
||||
func NewCapabilityOwners() *CapabilityOwners {
|
||||
return &CapabilityOwners{Owners: make([]Owner, 0)}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ func TestCapabilityKey(t *testing.T) {
|
||||
func TestOwner(t *testing.T) {
|
||||
o := types.NewOwner("bank", "send")
|
||||
require.Equal(t, "bank/send", o.Key())
|
||||
require.Equal(t, "module: bank\nname: send\n", o.String())
|
||||
require.Equal(t, "module:\"bank\" name:\"send\" ", o.String())
|
||||
}
|
||||
|
||||
func TestCapabilityOwners_Set(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user