From 93d12fd2e8a6749059d55d7ce58ebcab0de30241 Mon Sep 17 00:00:00 2001 From: ryanchristo <12519942+ryanchristo@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:49:33 -0700 Subject: [PATCH] refactor: consistent module service methods --- admin/api/v1/state.pulsar.go | 91 +-- admin/genesis/genesis_test.go | 2 +- admin/keeper/msg_update_admin.feature | 12 +- admin/keeper/msg_update_admin.go | 8 +- admin/keeper/msg_update_admin_test.go | 4 +- admin/keeper/query_admin.feature | 2 +- admin/keeper/query_admin.go | 2 +- admin/keeper/query_admin_test.go | 2 +- admin/proto/v1/state.proto | 4 +- admin/types/v1/state.pb.go | 44 +- admin/types/v1/state_admin.feature | 2 +- admin/types/v1/state_admin.go | 2 +- validator/api/v1/events.pulsar.go | 220 +++--- validator/api/v1/msg.pulsar.go | 710 +++++++----------- validator/api/v1/msg_grpc.pb.go | 34 +- validator/cmd/tx.go | 2 +- ...dd_validator.go => tx_create_validator.go} | 15 +- validator/cmd/tx_remove_validator.go | 4 +- validator/cmd/tx_update_validator.go | 9 +- validator/genesis/genesis_test.go | 1 + validator/keeper/msg_add_validator.feature | 106 --- validator/keeper/msg_create_validator.feature | 80 ++ ...d_validator.go => msg_create_validator.go} | 25 +- ...r_test.go => msg_create_validator_test.go} | 34 +- validator/keeper/msg_remove_validator.feature | 76 +- validator/keeper/msg_remove_validator.go | 20 +- validator/keeper/msg_remove_validator_test.go | 4 +- validator/module/autocli.go | 12 +- validator/proto/v1/events.proto | 4 +- validator/proto/v1/msg.proto | 28 +- validator/spec/02_msg.md | 2 +- validator/spec/05_events.md | 2 +- validator/types/v1/codec.go | 4 +- validator/types/v1/events.pb.go | 86 +-- validator/types/v1/msg.pb.go | 327 +++----- validator/types/v1/msg_add_validator.feature | 93 --- validator/types/v1/msg_add_validator.go | 45 -- validator/types/v1/msg_add_validator_test.go | 52 -- .../types/v1/msg_create_validator.feature | 63 ++ validator/types/v1/msg_create_validator.go | 41 + .../types/v1/msg_create_validator_test.go | 52 ++ .../types/v1/msg_remove_validator.feature | 16 +- validator/types/v1/msg_remove_validator.go | 6 +- 43 files changed, 998 insertions(+), 1350 deletions(-) rename validator/cmd/{tx_add_validator.go => tx_create_validator.go} (67%) delete mode 100644 validator/keeper/msg_add_validator.feature create mode 100644 validator/keeper/msg_create_validator.feature rename validator/keeper/{msg_add_validator.go => msg_create_validator.go} (59%) rename validator/keeper/{msg_add_validator_test.go => msg_create_validator_test.go} (59%) delete mode 100644 validator/types/v1/msg_add_validator.feature delete mode 100644 validator/types/v1/msg_add_validator.go delete mode 100644 validator/types/v1/msg_add_validator_test.go create mode 100644 validator/types/v1/msg_create_validator.feature create mode 100644 validator/types/v1/msg_create_validator.go create mode 100644 validator/types/v1/msg_create_validator_test.go diff --git a/admin/api/v1/state.pulsar.go b/admin/api/v1/state.pulsar.go index 1904c80..799ea0c 100644 --- a/admin/api/v1/state.pulsar.go +++ b/admin/api/v1/state.pulsar.go @@ -14,14 +14,14 @@ import ( ) var ( - md_Admin protoreflect.MessageDescriptor - fd_Admin_admin protoreflect.FieldDescriptor + md_Admin protoreflect.MessageDescriptor + fd_Admin_address protoreflect.FieldDescriptor ) func init() { file_chora_admin_v1_state_proto_init() md_Admin = File_chora_admin_v1_state_proto.Messages().ByName("Admin") - fd_Admin_admin = md_Admin.Fields().ByName("admin") + fd_Admin_address = md_Admin.Fields().ByName("address") } var _ protoreflect.Message = (*fastReflection_Admin)(nil) @@ -89,9 +89,9 @@ func (x *fastReflection_Admin) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Admin) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Admin) != 0 { - value := protoreflect.ValueOfBytes(x.Admin) - if !f(fd_Admin_admin, value) { + if len(x.Address) != 0 { + value := protoreflect.ValueOfBytes(x.Address) + if !f(fd_Admin_address, value) { return } } @@ -110,8 +110,8 @@ func (x *fastReflection_Admin) Range(f func(protoreflect.FieldDescriptor, protor // a repeated field is populated if it is non-empty. func (x *fastReflection_Admin) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "chora.admin.v1.Admin.admin": - return len(x.Admin) != 0 + case "chora.admin.v1.Admin.address": + return len(x.Address) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.admin.v1.Admin")) @@ -128,8 +128,8 @@ func (x *fastReflection_Admin) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Admin) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "chora.admin.v1.Admin.admin": - x.Admin = nil + case "chora.admin.v1.Admin.address": + x.Address = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.admin.v1.Admin")) @@ -146,8 +146,8 @@ func (x *fastReflection_Admin) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Admin) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "chora.admin.v1.Admin.admin": - value := x.Admin + case "chora.admin.v1.Admin.address": + value := x.Address return protoreflect.ValueOfBytes(value) default: if descriptor.IsExtension() { @@ -169,8 +169,8 @@ func (x *fastReflection_Admin) Get(descriptor protoreflect.FieldDescriptor) prot // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Admin) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "chora.admin.v1.Admin.admin": - x.Admin = value.Bytes() + case "chora.admin.v1.Admin.address": + x.Address = value.Bytes() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.admin.v1.Admin")) @@ -191,8 +191,8 @@ func (x *fastReflection_Admin) Set(fd protoreflect.FieldDescriptor, value protor // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Admin) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.admin.v1.Admin.admin": - panic(fmt.Errorf("field admin of message chora.admin.v1.Admin is not mutable")) + case "chora.admin.v1.Admin.address": + panic(fmt.Errorf("field address of message chora.admin.v1.Admin is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.admin.v1.Admin")) @@ -206,7 +206,7 @@ func (x *fastReflection_Admin) Mutable(fd protoreflect.FieldDescriptor) protoref // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Admin) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.admin.v1.Admin.admin": + case "chora.admin.v1.Admin.address": return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { @@ -277,7 +277,7 @@ func (x *fastReflection_Admin) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Admin) + l = len(x.Address) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -310,10 +310,10 @@ func (x *fastReflection_Admin) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Admin) > 0 { - i -= len(x.Admin) - copy(dAtA[i:], x.Admin) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Admin))) + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) i-- dAtA[i] = 0xa } @@ -368,7 +368,7 @@ func (x *fastReflection_Admin) ProtoMethods() *protoiface.Methods { switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -395,9 +395,9 @@ func (x *fastReflection_Admin) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Admin = append(x.Admin[:0], dAtA[iNdEx:postIndex]...) - if x.Admin == nil { - x.Admin = []byte{} + x.Address = append(x.Address[:0], dAtA[iNdEx:postIndex]...) + if x.Address == nil { + x.Address = []byte{} } iNdEx = postIndex default: @@ -454,8 +454,8 @@ type Admin struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // admin is the address of the admin account. - Admin []byte `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"` + // address is the address of the admin account. + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } func (x *Admin) Reset() { @@ -478,9 +478,9 @@ func (*Admin) Descriptor() ([]byte, []int) { return file_chora_admin_v1_state_proto_rawDescGZIP(), []int{0} } -func (x *Admin) GetAdmin() []byte { +func (x *Admin) GetAddress() []byte { if x != nil { - return x.Admin + return x.Address } return nil } @@ -492,21 +492,22 @@ var file_chora_admin_v1_state_proto_rawDesc = []byte{ 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x27, 0x0a, 0x05, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x14, - 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x61, - 0x64, 0x6d, 0x69, 0x6e, 0x3a, 0x08, 0xfa, 0x9e, 0xd3, 0x8e, 0x03, 0x02, 0x08, 0x01, 0x42, 0xb5, - 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x61, 0x64, 0x6d, - 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2d, 0x69, 0x6f, 0x2f, 0x6d, 0x6f, 0x64, 0x73, 0x2f, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2f, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x0e, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x41, 0x64, 0x6d, - 0x69, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x5c, 0x41, 0x64, - 0x6d, 0x69, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x5c, 0x41, - 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x3a, 0x3a, 0x41, 0x64, 0x6d, - 0x69, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2b, 0x0a, 0x05, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x18, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x08, 0xfa, 0x9e, 0xd3, 0x8e, 0x03, 0x02, + 0x08, 0x01, 0x42, 0xb5, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2d, 0x69, 0x6f, 0x2f, 0x6d, 0x6f, 0x64, + 0x73, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x6f, 0x72, + 0x61, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x0e, 0x43, 0x68, 0x6f, 0x72, 0x61, + 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x43, 0x68, 0x6f, 0x72, + 0x61, 0x5c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x43, 0x68, 0x6f, + 0x72, 0x61, 0x5c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x3a, + 0x3a, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/admin/genesis/genesis_test.go b/admin/genesis/genesis_test.go index 1bda149..b905f5f 100644 --- a/admin/genesis/genesis_test.go +++ b/admin/genesis/genesis_test.go @@ -25,7 +25,7 @@ func TestValidateGenesis(t *testing.T) { { name: "valid", setup: func(ctx context.Context, ss adminv1.StateStore) { - require.NoError(t, ss.AdminTable().Save(ctx, &adminv1.Admin{Admin: []byte("BTZfSbi0JKqguZ/tIAPUIhdAa7Y=")})) + require.NoError(t, ss.AdminTable().Save(ctx, &adminv1.Admin{Address: []byte("BTZfSbi0JKqguZ/tIAPUIhdAa7Y=")})) }, }, } diff --git a/admin/keeper/msg_update_admin.feature b/admin/keeper/msg_update_admin.feature index 655d721..b5115bd 100644 --- a/admin/keeper/msg_update_admin.feature +++ b/admin/keeper/msg_update_admin.feature @@ -1,7 +1,7 @@ Feature: Msg/UpdateAdmin UpdateAdmin is successful when: - - admin is the admin account + - admin is admin account UpdateAdmin has the following outcomes: - message response returned @@ -14,7 +14,7 @@ Feature: Msg/UpdateAdmin Given admin """ { - "admin": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=" + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=" } """ @@ -47,7 +47,7 @@ Feature: Msg/UpdateAdmin Given admin """ { - "admin": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=" + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=" } """ @@ -75,7 +75,7 @@ Feature: Msg/UpdateAdmin Given admin """ { - "admin": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=" + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=" } """ @@ -90,7 +90,7 @@ Feature: Msg/UpdateAdmin Then expect state admin """ { - "admin": "hEyiXxUCaFQmkbuhO9r+QDscjIY=" + "address": "hEyiXxUCaFQmkbuhO9r+QDscjIY=" } """ @@ -102,7 +102,7 @@ Feature: Msg/UpdateAdmin Given admin """ { - "admin": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=" + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=" } """ diff --git a/admin/keeper/msg_update_admin.go b/admin/keeper/msg_update_admin.go index b66034d..a60b969 100644 --- a/admin/keeper/msg_update_admin.go +++ b/admin/keeper/msg_update_admin.go @@ -30,12 +30,12 @@ func (k Keeper) UpdateAdmin(ctx context.Context, req *v1.MsgUpdateAdmin) (*v1.Ms } // get account from account bytes - adminAdmin := sdk.AccAddress(admin.Admin) + stateAdmin := sdk.AccAddress(admin.Address) // verify admin is admin account - if !reqAdmin.Equals(adminAdmin) { + if !reqAdmin.Equals(stateAdmin) { return nil, sdkerrors.ErrUnauthorized.Wrapf( - "admin %s: admin account %s", reqAdmin, adminAdmin, + "admin %s: admin account %s", reqAdmin, stateAdmin, ) } @@ -46,7 +46,7 @@ func (k Keeper) UpdateAdmin(ctx context.Context, req *v1.MsgUpdateAdmin) (*v1.Ms } // set new admin - admin.Admin = newAdmin + admin.Address = newAdmin // update admin in admin table err = k.ss.AdminTable().Save(ctx, admin) diff --git a/admin/keeper/msg_update_admin_test.go b/admin/keeper/msg_update_admin_test.go index 0d0af79..602e5b4 100644 --- a/admin/keeper/msg_update_admin_test.go +++ b/admin/keeper/msg_update_admin_test.go @@ -34,7 +34,7 @@ func (s *msgUpdateAdmin) Admin(a gocuke.DocString) { require.NoError(s.t, err) err = s.k.ss.AdminTable().Save(s.sdkCtx, &adminv1.Admin{ - Admin: admin.Admin, + Address: admin.Address, }) require.NoError(s.t, err) } @@ -71,7 +71,7 @@ func (s *msgUpdateAdmin) ExpectStateAdmin(a gocuke.DocString) { actual, err := s.k.ss.AdminTable().Get(s.sdkCtx) require.NoError(s.t, err) - require.Equal(s.t, expected.Admin, actual.Admin) + require.Equal(s.t, expected.Address, actual.Address) } func (s *msgUpdateAdmin) ExpectEventUpdate(a gocuke.DocString) { diff --git a/admin/keeper/query_admin.feature b/admin/keeper/query_admin.feature index 0898335..d26451e 100644 --- a/admin/keeper/query_admin.feature +++ b/admin/keeper/query_admin.feature @@ -12,7 +12,7 @@ Feature: Query/Admin Given admin """ { - "admin": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=" + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=" } """ diff --git a/admin/keeper/query_admin.go b/admin/keeper/query_admin.go index 25b4595..8a4b0e0 100644 --- a/admin/keeper/query_admin.go +++ b/admin/keeper/query_admin.go @@ -23,7 +23,7 @@ func (k Keeper) Admin(ctx context.Context, req *v1.QueryAdminRequest) (*v1.Query } // get account from account bytes - curator := sdk.AccAddress(admin.Admin) + curator := sdk.AccAddress(admin.Address) // return query response return &v1.QueryAdminResponse{ diff --git a/admin/keeper/query_admin_test.go b/admin/keeper/query_admin_test.go index daa7b5b..6235036 100644 --- a/admin/keeper/query_admin_test.go +++ b/admin/keeper/query_admin_test.go @@ -33,7 +33,7 @@ func (s *queryAdmin) Admin(a gocuke.DocString) { require.NoError(s.t, err) err = s.k.ss.AdminTable().Save(s.sdkCtx, &adminv1.Admin{ - Admin: admin.Admin, + Address: admin.Address, }) require.NoError(s.t, err) } diff --git a/admin/proto/v1/state.proto b/admin/proto/v1/state.proto index 363298b..0cd2411 100644 --- a/admin/proto/v1/state.proto +++ b/admin/proto/v1/state.proto @@ -12,6 +12,6 @@ message Admin { id : 1, }; - // admin is the address of the admin account. - bytes admin = 1; + // address is the address of the admin account. + bytes address = 1; } diff --git a/admin/types/v1/state.pb.go b/admin/types/v1/state.pb.go index a9dc888..d8e386d 100644 --- a/admin/types/v1/state.pb.go +++ b/admin/types/v1/state.pb.go @@ -25,8 +25,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Admin defines the table and properties of the admin. type Admin struct { - // admin is the address of the admin account. - Admin []byte `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"` + // address is the address of the admin account. + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } func (m *Admin) Reset() { *m = Admin{} } @@ -62,9 +62,9 @@ func (m *Admin) XXX_DiscardUnknown() { var xxx_messageInfo_Admin proto.InternalMessageInfo -func (m *Admin) GetAdmin() []byte { +func (m *Admin) GetAddress() []byte { if m != nil { - return m.Admin + return m.Address } return nil } @@ -76,19 +76,19 @@ func init() { func init() { proto.RegisterFile("chora/admin/v1/state.proto", fileDescriptor_36b912da2c155f13) } var fileDescriptor_36b912da2c155f13 = []byte{ - // 179 bytes of a gzipped FileDescriptorProto + // 184 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0xce, 0xc8, 0x2f, 0x4a, 0xd4, 0x4f, 0x4c, 0xc9, 0xcd, 0xcc, 0xd3, 0x2f, 0x33, 0xd4, 0x2f, 0x2e, 0x49, 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x03, 0xcb, 0xe9, 0x81, 0xe5, 0xf4, 0xca, 0x0c, 0xa5, 0xc4, 0x93, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xf5, 0xf3, 0x8b, 0x72, 0x41, 0x4a, 0xf3, 0x8b, - 0x72, 0x21, 0x0a, 0x95, 0xd4, 0xb9, 0x58, 0x1d, 0x41, 0x8a, 0x84, 0x44, 0xb8, 0x58, 0xc1, 0xaa, - 0x25, 0x18, 0x15, 0x18, 0x35, 0x78, 0x82, 0x20, 0x1c, 0x2b, 0x8e, 0x5f, 0xf3, 0x2e, 0xf7, 0x31, - 0x33, 0x71, 0x30, 0x3a, 0x39, 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, - 0x7a, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xd8, 0x5a, 0xdd, 0xcc, - 0x7c, 0xfd, 0xdc, 0xfc, 0x94, 0x62, 0xa8, 0xd3, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0xf5, 0xcb, 0x0c, - 0x93, 0xd8, 0xc0, 0x56, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x47, 0x0a, 0xb7, 0x76, 0xb9, - 0x00, 0x00, 0x00, + 0x72, 0x21, 0x0a, 0x95, 0xb4, 0xb9, 0x58, 0x1d, 0x41, 0x8a, 0x84, 0x24, 0xb8, 0xd8, 0x13, 0x53, + 0x52, 0x8a, 0x52, 0x8b, 0x8b, 0x25, 0x18, 0x15, 0x18, 0x35, 0x78, 0x82, 0x60, 0x5c, 0x2b, 0x8e, + 0x5f, 0xf3, 0x2e, 0xf7, 0x31, 0x33, 0x71, 0x30, 0x3a, 0x39, 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, 0x7a, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, + 0x3e, 0xd8, 0x6a, 0xdd, 0xcc, 0x7c, 0xfd, 0xdc, 0xfc, 0x94, 0x62, 0xa8, 0xf3, 0x4a, 0x2a, 0x0b, + 0x52, 0x8b, 0xf5, 0xcb, 0x0c, 0x93, 0xd8, 0xc0, 0xd6, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x97, 0xf8, 0x93, 0x81, 0xbd, 0x00, 0x00, 0x00, } func (m *Admin) Marshal() (dAtA []byte, err error) { @@ -111,10 +111,10 @@ func (m *Admin) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Admin) > 0 { - i -= len(m.Admin) - copy(dAtA[i:], m.Admin) - i = encodeVarintState(dAtA, i, uint64(len(m.Admin))) + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintState(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } @@ -138,7 +138,7 @@ func (m *Admin) Size() (n int) { } var l int _ = l - l = len(m.Admin) + l = len(m.Address) if l > 0 { n += 1 + l + sovState(uint64(l)) } @@ -182,7 +182,7 @@ func (m *Admin) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -209,9 +209,9 @@ func (m *Admin) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Admin = append(m.Admin[:0], dAtA[iNdEx:postIndex]...) - if m.Admin == nil { - m.Admin = []byte{} + m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) + if m.Address == nil { + m.Address = []byte{} } iNdEx = postIndex default: diff --git a/admin/types/v1/state_admin.feature b/admin/types/v1/state_admin.feature index 58bcbc6..3b423a7 100644 --- a/admin/types/v1/state_admin.feature +++ b/admin/types/v1/state_admin.feature @@ -4,7 +4,7 @@ Feature: Admin Given admin """ { - "admin": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=" + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=" } """ When validate admin diff --git a/admin/types/v1/state_admin.go b/admin/types/v1/state_admin.go index 17696cf..34c6445 100644 --- a/admin/types/v1/state_admin.go +++ b/admin/types/v1/state_admin.go @@ -8,7 +8,7 @@ import ( // Validate validates Admin. func (m *Admin) Validate() error { - if _, err := sdk.AccAddressFromBech32(sdk.AccAddress(m.Admin).String()); err != nil { + if _, err := sdk.AccAddressFromBech32(sdk.AccAddress(m.Address).String()); err != nil { return errors.ErrParse.Wrapf("address: %s", err) } diff --git a/validator/api/v1/events.pulsar.go b/validator/api/v1/events.pulsar.go index 5e1c99d..dda90ff 100644 --- a/validator/api/v1/events.pulsar.go +++ b/validator/api/v1/events.pulsar.go @@ -13,25 +13,25 @@ import ( ) var ( - md_EventAddValidator protoreflect.MessageDescriptor - fd_EventAddValidator_address protoreflect.FieldDescriptor + md_EventCreateValidator protoreflect.MessageDescriptor + fd_EventCreateValidator_address protoreflect.FieldDescriptor ) func init() { file_chora_validator_v1_events_proto_init() - md_EventAddValidator = File_chora_validator_v1_events_proto.Messages().ByName("EventAddValidator") - fd_EventAddValidator_address = md_EventAddValidator.Fields().ByName("address") + md_EventCreateValidator = File_chora_validator_v1_events_proto.Messages().ByName("EventCreateValidator") + fd_EventCreateValidator_address = md_EventCreateValidator.Fields().ByName("address") } -var _ protoreflect.Message = (*fastReflection_EventAddValidator)(nil) +var _ protoreflect.Message = (*fastReflection_EventCreateValidator)(nil) -type fastReflection_EventAddValidator EventAddValidator +type fastReflection_EventCreateValidator EventCreateValidator -func (x *EventAddValidator) ProtoReflect() protoreflect.Message { - return (*fastReflection_EventAddValidator)(x) +func (x *EventCreateValidator) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventCreateValidator)(x) } -func (x *EventAddValidator) slowProtoReflect() protoreflect.Message { +func (x *EventCreateValidator) slowProtoReflect() protoreflect.Message { mi := &file_chora_validator_v1_events_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -43,43 +43,43 @@ func (x *EventAddValidator) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_EventAddValidator_messageType fastReflection_EventAddValidator_messageType -var _ protoreflect.MessageType = fastReflection_EventAddValidator_messageType{} +var _fastReflection_EventCreateValidator_messageType fastReflection_EventCreateValidator_messageType +var _ protoreflect.MessageType = fastReflection_EventCreateValidator_messageType{} -type fastReflection_EventAddValidator_messageType struct{} +type fastReflection_EventCreateValidator_messageType struct{} -func (x fastReflection_EventAddValidator_messageType) Zero() protoreflect.Message { - return (*fastReflection_EventAddValidator)(nil) +func (x fastReflection_EventCreateValidator_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventCreateValidator)(nil) } -func (x fastReflection_EventAddValidator_messageType) New() protoreflect.Message { - return new(fastReflection_EventAddValidator) +func (x fastReflection_EventCreateValidator_messageType) New() protoreflect.Message { + return new(fastReflection_EventCreateValidator) } -func (x fastReflection_EventAddValidator_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_EventAddValidator +func (x fastReflection_EventCreateValidator_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventCreateValidator } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_EventAddValidator) Descriptor() protoreflect.MessageDescriptor { - return md_EventAddValidator +func (x *fastReflection_EventCreateValidator) Descriptor() protoreflect.MessageDescriptor { + return md_EventCreateValidator } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_EventAddValidator) Type() protoreflect.MessageType { - return _fastReflection_EventAddValidator_messageType +func (x *fastReflection_EventCreateValidator) Type() protoreflect.MessageType { + return _fastReflection_EventCreateValidator_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_EventAddValidator) New() protoreflect.Message { - return new(fastReflection_EventAddValidator) +func (x *fastReflection_EventCreateValidator) New() protoreflect.Message { + return new(fastReflection_EventCreateValidator) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_EventAddValidator) Interface() protoreflect.ProtoMessage { - return (*EventAddValidator)(x) +func (x *fastReflection_EventCreateValidator) Interface() protoreflect.ProtoMessage { + return (*EventCreateValidator)(x) } // Range iterates over every populated field in an undefined order, @@ -87,10 +87,10 @@ func (x *fastReflection_EventAddValidator) Interface() protoreflect.ProtoMessage // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_EventAddValidator) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_EventCreateValidator) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Address != "" { value := protoreflect.ValueOfString(x.Address) - if !f(fd_EventAddValidator_address, value) { + if !f(fd_EventCreateValidator_address, value) { return } } @@ -107,15 +107,15 @@ func (x *fastReflection_EventAddValidator) Range(f func(protoreflect.FieldDescri // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_EventAddValidator) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_EventCreateValidator) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "chora.validator.v1.EventAddValidator.address": + case "chora.validator.v1.EventCreateValidator.address": return x.Address != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.EventAddValidator")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.EventCreateValidator")) } - panic(fmt.Errorf("message chora.validator.v1.EventAddValidator does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.validator.v1.EventCreateValidator does not contain field %s", fd.FullName())) } } @@ -125,15 +125,15 @@ func (x *fastReflection_EventAddValidator) Has(fd protoreflect.FieldDescriptor) // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventAddValidator) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_EventCreateValidator) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "chora.validator.v1.EventAddValidator.address": + case "chora.validator.v1.EventCreateValidator.address": x.Address = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.EventAddValidator")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.EventCreateValidator")) } - panic(fmt.Errorf("message chora.validator.v1.EventAddValidator does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.validator.v1.EventCreateValidator does not contain field %s", fd.FullName())) } } @@ -143,16 +143,16 @@ func (x *fastReflection_EventAddValidator) Clear(fd protoreflect.FieldDescriptor // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_EventAddValidator) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventCreateValidator) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "chora.validator.v1.EventAddValidator.address": + case "chora.validator.v1.EventCreateValidator.address": value := x.Address return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.EventAddValidator")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.EventCreateValidator")) } - panic(fmt.Errorf("message chora.validator.v1.EventAddValidator does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message chora.validator.v1.EventCreateValidator does not contain field %s", descriptor.FullName())) } } @@ -166,15 +166,15 @@ func (x *fastReflection_EventAddValidator) Get(descriptor protoreflect.FieldDesc // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventAddValidator) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_EventCreateValidator) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "chora.validator.v1.EventAddValidator.address": + case "chora.validator.v1.EventCreateValidator.address": x.Address = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.EventAddValidator")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.EventCreateValidator")) } - panic(fmt.Errorf("message chora.validator.v1.EventAddValidator does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.validator.v1.EventCreateValidator does not contain field %s", fd.FullName())) } } @@ -188,40 +188,40 @@ func (x *fastReflection_EventAddValidator) Set(fd protoreflect.FieldDescriptor, // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventAddValidator) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventCreateValidator) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.validator.v1.EventAddValidator.address": - panic(fmt.Errorf("field address of message chora.validator.v1.EventAddValidator is not mutable")) + case "chora.validator.v1.EventCreateValidator.address": + panic(fmt.Errorf("field address of message chora.validator.v1.EventCreateValidator is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.EventAddValidator")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.EventCreateValidator")) } - panic(fmt.Errorf("message chora.validator.v1.EventAddValidator does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.validator.v1.EventCreateValidator does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_EventAddValidator) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventCreateValidator) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.validator.v1.EventAddValidator.address": + case "chora.validator.v1.EventCreateValidator.address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.EventAddValidator")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.EventCreateValidator")) } - panic(fmt.Errorf("message chora.validator.v1.EventAddValidator does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.validator.v1.EventCreateValidator does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_EventAddValidator) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_EventCreateValidator) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in chora.validator.v1.EventAddValidator", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in chora.validator.v1.EventCreateValidator", d.FullName())) } panic("unreachable") } @@ -229,7 +229,7 @@ func (x *fastReflection_EventAddValidator) WhichOneof(d protoreflect.OneofDescri // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_EventAddValidator) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_EventCreateValidator) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -240,7 +240,7 @@ func (x *fastReflection_EventAddValidator) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventAddValidator) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_EventCreateValidator) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -252,7 +252,7 @@ func (x *fastReflection_EventAddValidator) SetUnknown(fields protoreflect.RawFie // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_EventAddValidator) IsValid() bool { +func (x *fastReflection_EventCreateValidator) IsValid() bool { return x != nil } @@ -262,9 +262,9 @@ func (x *fastReflection_EventAddValidator) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_EventAddValidator) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_EventCreateValidator) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*EventAddValidator) + x := input.Message.Interface().(*EventCreateValidator) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -290,7 +290,7 @@ func (x *fastReflection_EventAddValidator) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*EventAddValidator) + x := input.Message.Interface().(*EventCreateValidator) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -327,7 +327,7 @@ func (x *fastReflection_EventAddValidator) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*EventAddValidator) + x := input.Message.Interface().(*EventCreateValidator) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -359,10 +359,10 @@ func (x *fastReflection_EventAddValidator) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventAddValidator: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventCreateValidator: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventAddValidator: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventCreateValidator: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2157,8 +2157,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// EventAddValidator is an event emitted when a validator is added. -type EventAddValidator struct { +// EventCreateValidator is an event emitted when a validator is created. +type EventCreateValidator struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2167,8 +2167,8 @@ type EventAddValidator struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (x *EventAddValidator) Reset() { - *x = EventAddValidator{} +func (x *EventCreateValidator) Reset() { + *x = EventCreateValidator{} if protoimpl.UnsafeEnabled { mi := &file_chora_validator_v1_events_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2176,18 +2176,18 @@ func (x *EventAddValidator) Reset() { } } -func (x *EventAddValidator) String() string { +func (x *EventCreateValidator) String() string { return protoimpl.X.MessageStringOf(x) } -func (*EventAddValidator) ProtoMessage() {} +func (*EventCreateValidator) ProtoMessage() {} -// Deprecated: Use EventAddValidator.ProtoReflect.Descriptor instead. -func (*EventAddValidator) Descriptor() ([]byte, []int) { +// Deprecated: Use EventCreateValidator.ProtoReflect.Descriptor instead. +func (*EventCreateValidator) Descriptor() ([]byte, []int) { return file_chora_validator_v1_events_proto_rawDescGZIP(), []int{0} } -func (x *EventAddValidator) GetAddress() string { +func (x *EventCreateValidator) GetAddress() string { if x != nil { return x.Address } @@ -2359,41 +2359,41 @@ var file_chora_validator_v1_events_proto_rawDesc = []byte{ 0x0a, 0x1f, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x22, 0x2d, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x64, - 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x22, 0x2c, 0x0a, 0x10, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x69, 0x73, - 0x73, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x22, 0x30, 0x0a, 0x14, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x22, 0x78, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, - 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x31, 0x0a, 0x15, 0x6d, - 0x69, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x77, 0x69, - 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6d, 0x69, 0x6e, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x65, 0x72, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x22, 0x30, - 0x0a, 0x14, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x42, 0xd6, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2d, 0x69, 0x6f, 0x2f, - 0x6d, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x76, - 0x31, 0xa2, 0x02, 0x03, 0x43, 0x56, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x43, - 0x68, 0x6f, 0x72, 0x61, 0x5c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5c, 0x56, - 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x5c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x3a, 0x3a, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x22, 0x30, 0x0a, 0x14, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x2c, 0x0a, 0x10, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x4d, 0x69, 0x73, 0x73, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x30, 0x0a, 0x14, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x78, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x30, 0x0a, 0x14, + 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x77, 0x69, + 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x73, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x31, + 0x0a, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x72, + 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6d, + 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x65, 0x72, 0x57, 0x69, 0x6e, 0x64, 0x6f, + 0x77, 0x22, 0x30, 0x0a, 0x14, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x42, 0xd6, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x6f, 0x72, + 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0b, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2d, + 0x69, 0x6f, 0x2f, 0x6d, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x56, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x68, 0x6f, + 0x72, 0x61, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x12, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x5c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x5c, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x3a, 0x3a, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2410,7 +2410,7 @@ func file_chora_validator_v1_events_proto_rawDescGZIP() []byte { var file_chora_validator_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_chora_validator_v1_events_proto_goTypes = []interface{}{ - (*EventAddValidator)(nil), // 0: chora.validator.v1.EventAddValidator + (*EventCreateValidator)(nil), // 0: chora.validator.v1.EventCreateValidator (*EventMissedBlock)(nil), // 1: chora.validator.v1.EventMissedBlock (*EventRemoveValidator)(nil), // 2: chora.validator.v1.EventRemoveValidator (*EventUpdatePolicy)(nil), // 3: chora.validator.v1.EventUpdatePolicy @@ -2431,7 +2431,7 @@ func file_chora_validator_v1_events_proto_init() { } if !protoimpl.UnsafeEnabled { file_chora_validator_v1_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EventAddValidator); i { + switch v := v.(*EventCreateValidator); i { case 0: return &v.state case 1: diff --git a/validator/api/v1/msg.pulsar.go b/validator/api/v1/msg.pulsar.go index d96abbb..7455826 100644 --- a/validator/api/v1/msg.pulsar.go +++ b/validator/api/v1/msg.pulsar.go @@ -14,31 +14,27 @@ import ( ) var ( - md_MsgAddValidator protoreflect.MessageDescriptor - fd_MsgAddValidator_admin protoreflect.FieldDescriptor - fd_MsgAddValidator_address protoreflect.FieldDescriptor - fd_MsgAddValidator_operator protoreflect.FieldDescriptor - fd_MsgAddValidator_metadata protoreflect.FieldDescriptor + md_MsgCreateValidator protoreflect.MessageDescriptor + fd_MsgCreateValidator_operator protoreflect.FieldDescriptor + fd_MsgCreateValidator_metadata protoreflect.FieldDescriptor ) func init() { file_chora_validator_v1_msg_proto_init() - md_MsgAddValidator = File_chora_validator_v1_msg_proto.Messages().ByName("MsgAddValidator") - fd_MsgAddValidator_admin = md_MsgAddValidator.Fields().ByName("admin") - fd_MsgAddValidator_address = md_MsgAddValidator.Fields().ByName("address") - fd_MsgAddValidator_operator = md_MsgAddValidator.Fields().ByName("operator") - fd_MsgAddValidator_metadata = md_MsgAddValidator.Fields().ByName("metadata") + md_MsgCreateValidator = File_chora_validator_v1_msg_proto.Messages().ByName("MsgCreateValidator") + fd_MsgCreateValidator_operator = md_MsgCreateValidator.Fields().ByName("operator") + fd_MsgCreateValidator_metadata = md_MsgCreateValidator.Fields().ByName("metadata") } -var _ protoreflect.Message = (*fastReflection_MsgAddValidator)(nil) +var _ protoreflect.Message = (*fastReflection_MsgCreateValidator)(nil) -type fastReflection_MsgAddValidator MsgAddValidator +type fastReflection_MsgCreateValidator MsgCreateValidator -func (x *MsgAddValidator) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgAddValidator)(x) +func (x *MsgCreateValidator) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateValidator)(x) } -func (x *MsgAddValidator) slowProtoReflect() protoreflect.Message { +func (x *MsgCreateValidator) slowProtoReflect() protoreflect.Message { mi := &file_chora_validator_v1_msg_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -50,43 +46,43 @@ func (x *MsgAddValidator) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgAddValidator_messageType fastReflection_MsgAddValidator_messageType -var _ protoreflect.MessageType = fastReflection_MsgAddValidator_messageType{} +var _fastReflection_MsgCreateValidator_messageType fastReflection_MsgCreateValidator_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateValidator_messageType{} -type fastReflection_MsgAddValidator_messageType struct{} +type fastReflection_MsgCreateValidator_messageType struct{} -func (x fastReflection_MsgAddValidator_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgAddValidator)(nil) +func (x fastReflection_MsgCreateValidator_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateValidator)(nil) } -func (x fastReflection_MsgAddValidator_messageType) New() protoreflect.Message { - return new(fastReflection_MsgAddValidator) +func (x fastReflection_MsgCreateValidator_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateValidator) } -func (x fastReflection_MsgAddValidator_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgAddValidator +func (x fastReflection_MsgCreateValidator_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateValidator } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgAddValidator) Descriptor() protoreflect.MessageDescriptor { - return md_MsgAddValidator +func (x *fastReflection_MsgCreateValidator) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateValidator } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgAddValidator) Type() protoreflect.MessageType { - return _fastReflection_MsgAddValidator_messageType +func (x *fastReflection_MsgCreateValidator) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateValidator_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgAddValidator) New() protoreflect.Message { - return new(fastReflection_MsgAddValidator) +func (x *fastReflection_MsgCreateValidator) New() protoreflect.Message { + return new(fastReflection_MsgCreateValidator) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgAddValidator) Interface() protoreflect.ProtoMessage { - return (*MsgAddValidator)(x) +func (x *fastReflection_MsgCreateValidator) Interface() protoreflect.ProtoMessage { + return (*MsgCreateValidator)(x) } // Range iterates over every populated field in an undefined order, @@ -94,28 +90,16 @@ func (x *fastReflection_MsgAddValidator) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgAddValidator) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Admin != "" { - value := protoreflect.ValueOfString(x.Admin) - if !f(fd_MsgAddValidator_admin, value) { - return - } - } - if x.Address != "" { - value := protoreflect.ValueOfString(x.Address) - if !f(fd_MsgAddValidator_address, value) { - return - } - } +func (x *fastReflection_MsgCreateValidator) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Operator != "" { value := protoreflect.ValueOfString(x.Operator) - if !f(fd_MsgAddValidator_operator, value) { + if !f(fd_MsgCreateValidator_operator, value) { return } } if x.Metadata != "" { value := protoreflect.ValueOfString(x.Metadata) - if !f(fd_MsgAddValidator_metadata, value) { + if !f(fd_MsgCreateValidator_metadata, value) { return } } @@ -132,21 +116,17 @@ func (x *fastReflection_MsgAddValidator) Range(f func(protoreflect.FieldDescript // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgAddValidator) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgCreateValidator) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "chora.validator.v1.MsgAddValidator.admin": - return x.Admin != "" - case "chora.validator.v1.MsgAddValidator.address": - return x.Address != "" - case "chora.validator.v1.MsgAddValidator.operator": + case "chora.validator.v1.MsgCreateValidator.operator": return x.Operator != "" - case "chora.validator.v1.MsgAddValidator.metadata": + case "chora.validator.v1.MsgCreateValidator.metadata": return x.Metadata != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgAddValidator")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgCreateValidator")) } - panic(fmt.Errorf("message chora.validator.v1.MsgAddValidator does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.validator.v1.MsgCreateValidator does not contain field %s", fd.FullName())) } } @@ -156,21 +136,17 @@ func (x *fastReflection_MsgAddValidator) Has(fd protoreflect.FieldDescriptor) bo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddValidator) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgCreateValidator) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "chora.validator.v1.MsgAddValidator.admin": - x.Admin = "" - case "chora.validator.v1.MsgAddValidator.address": - x.Address = "" - case "chora.validator.v1.MsgAddValidator.operator": + case "chora.validator.v1.MsgCreateValidator.operator": x.Operator = "" - case "chora.validator.v1.MsgAddValidator.metadata": + case "chora.validator.v1.MsgCreateValidator.metadata": x.Metadata = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgAddValidator")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgCreateValidator")) } - panic(fmt.Errorf("message chora.validator.v1.MsgAddValidator does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.validator.v1.MsgCreateValidator does not contain field %s", fd.FullName())) } } @@ -180,25 +156,19 @@ func (x *fastReflection_MsgAddValidator) Clear(fd protoreflect.FieldDescriptor) // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgAddValidator) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateValidator) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "chora.validator.v1.MsgAddValidator.admin": - value := x.Admin - return protoreflect.ValueOfString(value) - case "chora.validator.v1.MsgAddValidator.address": - value := x.Address - return protoreflect.ValueOfString(value) - case "chora.validator.v1.MsgAddValidator.operator": + case "chora.validator.v1.MsgCreateValidator.operator": value := x.Operator return protoreflect.ValueOfString(value) - case "chora.validator.v1.MsgAddValidator.metadata": + case "chora.validator.v1.MsgCreateValidator.metadata": value := x.Metadata return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgAddValidator")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgCreateValidator")) } - panic(fmt.Errorf("message chora.validator.v1.MsgAddValidator does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message chora.validator.v1.MsgCreateValidator does not contain field %s", descriptor.FullName())) } } @@ -212,21 +182,17 @@ func (x *fastReflection_MsgAddValidator) Get(descriptor protoreflect.FieldDescri // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddValidator) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgCreateValidator) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "chora.validator.v1.MsgAddValidator.admin": - x.Admin = value.Interface().(string) - case "chora.validator.v1.MsgAddValidator.address": - x.Address = value.Interface().(string) - case "chora.validator.v1.MsgAddValidator.operator": + case "chora.validator.v1.MsgCreateValidator.operator": x.Operator = value.Interface().(string) - case "chora.validator.v1.MsgAddValidator.metadata": + case "chora.validator.v1.MsgCreateValidator.metadata": x.Metadata = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgAddValidator")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgCreateValidator")) } - panic(fmt.Errorf("message chora.validator.v1.MsgAddValidator does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.validator.v1.MsgCreateValidator does not contain field %s", fd.FullName())) } } @@ -240,52 +206,44 @@ func (x *fastReflection_MsgAddValidator) Set(fd protoreflect.FieldDescriptor, va // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddValidator) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateValidator) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.validator.v1.MsgAddValidator.admin": - panic(fmt.Errorf("field admin of message chora.validator.v1.MsgAddValidator is not mutable")) - case "chora.validator.v1.MsgAddValidator.address": - panic(fmt.Errorf("field address of message chora.validator.v1.MsgAddValidator is not mutable")) - case "chora.validator.v1.MsgAddValidator.operator": - panic(fmt.Errorf("field operator of message chora.validator.v1.MsgAddValidator is not mutable")) - case "chora.validator.v1.MsgAddValidator.metadata": - panic(fmt.Errorf("field metadata of message chora.validator.v1.MsgAddValidator is not mutable")) + case "chora.validator.v1.MsgCreateValidator.operator": + panic(fmt.Errorf("field operator of message chora.validator.v1.MsgCreateValidator is not mutable")) + case "chora.validator.v1.MsgCreateValidator.metadata": + panic(fmt.Errorf("field metadata of message chora.validator.v1.MsgCreateValidator is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgAddValidator")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgCreateValidator")) } - panic(fmt.Errorf("message chora.validator.v1.MsgAddValidator does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.validator.v1.MsgCreateValidator does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgAddValidator) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateValidator) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.validator.v1.MsgAddValidator.admin": - return protoreflect.ValueOfString("") - case "chora.validator.v1.MsgAddValidator.address": + case "chora.validator.v1.MsgCreateValidator.operator": return protoreflect.ValueOfString("") - case "chora.validator.v1.MsgAddValidator.operator": - return protoreflect.ValueOfString("") - case "chora.validator.v1.MsgAddValidator.metadata": + case "chora.validator.v1.MsgCreateValidator.metadata": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgAddValidator")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgCreateValidator")) } - panic(fmt.Errorf("message chora.validator.v1.MsgAddValidator does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.validator.v1.MsgCreateValidator does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgAddValidator) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgCreateValidator) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in chora.validator.v1.MsgAddValidator", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in chora.validator.v1.MsgCreateValidator", d.FullName())) } panic("unreachable") } @@ -293,7 +251,7 @@ func (x *fastReflection_MsgAddValidator) WhichOneof(d protoreflect.OneofDescript // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgAddValidator) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgCreateValidator) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -304,7 +262,7 @@ func (x *fastReflection_MsgAddValidator) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddValidator) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgCreateValidator) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -316,7 +274,7 @@ func (x *fastReflection_MsgAddValidator) SetUnknown(fields protoreflect.RawField // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgAddValidator) IsValid() bool { +func (x *fastReflection_MsgCreateValidator) IsValid() bool { return x != nil } @@ -326,9 +284,9 @@ func (x *fastReflection_MsgAddValidator) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgAddValidator) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgCreateValidator) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgAddValidator) + x := input.Message.Interface().(*MsgCreateValidator) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -340,14 +298,6 @@ func (x *fastReflection_MsgAddValidator) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Admin) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Address) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } l = len(x.Operator) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -366,7 +316,7 @@ func (x *fastReflection_MsgAddValidator) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgAddValidator) + x := input.Message.Interface().(*MsgCreateValidator) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -390,27 +340,13 @@ func (x *fastReflection_MsgAddValidator) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.Metadata) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Metadata))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x12 } if len(x.Operator) > 0 { i -= len(x.Operator) copy(dAtA[i:], x.Operator) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Operator))) i-- - dAtA[i] = 0x1a - } - if len(x.Address) > 0 { - i -= len(x.Address) - copy(dAtA[i:], x.Address) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) - i-- - dAtA[i] = 0x12 - } - if len(x.Admin) > 0 { - i -= len(x.Admin) - copy(dAtA[i:], x.Admin) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Admin))) - i-- dAtA[i] = 0xa } if input.Buf != nil { @@ -424,7 +360,7 @@ func (x *fastReflection_MsgAddValidator) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgAddValidator) + x := input.Message.Interface().(*MsgCreateValidator) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -456,77 +392,13 @@ func (x *fastReflection_MsgAddValidator) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAddValidator: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateValidator: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAddValidator: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateValidator: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Admin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) } @@ -558,7 +430,7 @@ func (x *fastReflection_MsgAddValidator) ProtoMethods() *protoiface.Methods { } x.Operator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 2: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } @@ -626,25 +498,25 @@ func (x *fastReflection_MsgAddValidator) ProtoMethods() *protoiface.Methods { } var ( - md_MsgAddValidatorResponse protoreflect.MessageDescriptor - fd_MsgAddValidatorResponse_address protoreflect.FieldDescriptor + md_MsgCreateValidatorResponse protoreflect.MessageDescriptor + fd_MsgCreateValidatorResponse_address protoreflect.FieldDescriptor ) func init() { file_chora_validator_v1_msg_proto_init() - md_MsgAddValidatorResponse = File_chora_validator_v1_msg_proto.Messages().ByName("MsgAddValidatorResponse") - fd_MsgAddValidatorResponse_address = md_MsgAddValidatorResponse.Fields().ByName("address") + md_MsgCreateValidatorResponse = File_chora_validator_v1_msg_proto.Messages().ByName("MsgCreateValidatorResponse") + fd_MsgCreateValidatorResponse_address = md_MsgCreateValidatorResponse.Fields().ByName("address") } -var _ protoreflect.Message = (*fastReflection_MsgAddValidatorResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MsgCreateValidatorResponse)(nil) -type fastReflection_MsgAddValidatorResponse MsgAddValidatorResponse +type fastReflection_MsgCreateValidatorResponse MsgCreateValidatorResponse -func (x *MsgAddValidatorResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgAddValidatorResponse)(x) +func (x *MsgCreateValidatorResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateValidatorResponse)(x) } -func (x *MsgAddValidatorResponse) slowProtoReflect() protoreflect.Message { +func (x *MsgCreateValidatorResponse) slowProtoReflect() protoreflect.Message { mi := &file_chora_validator_v1_msg_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -656,43 +528,43 @@ func (x *MsgAddValidatorResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgAddValidatorResponse_messageType fastReflection_MsgAddValidatorResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgAddValidatorResponse_messageType{} +var _fastReflection_MsgCreateValidatorResponse_messageType fastReflection_MsgCreateValidatorResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateValidatorResponse_messageType{} -type fastReflection_MsgAddValidatorResponse_messageType struct{} +type fastReflection_MsgCreateValidatorResponse_messageType struct{} -func (x fastReflection_MsgAddValidatorResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgAddValidatorResponse)(nil) +func (x fastReflection_MsgCreateValidatorResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateValidatorResponse)(nil) } -func (x fastReflection_MsgAddValidatorResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgAddValidatorResponse) +func (x fastReflection_MsgCreateValidatorResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateValidatorResponse) } -func (x fastReflection_MsgAddValidatorResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgAddValidatorResponse +func (x fastReflection_MsgCreateValidatorResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateValidatorResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgAddValidatorResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgAddValidatorResponse +func (x *fastReflection_MsgCreateValidatorResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateValidatorResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgAddValidatorResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgAddValidatorResponse_messageType +func (x *fastReflection_MsgCreateValidatorResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateValidatorResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgAddValidatorResponse) New() protoreflect.Message { - return new(fastReflection_MsgAddValidatorResponse) +func (x *fastReflection_MsgCreateValidatorResponse) New() protoreflect.Message { + return new(fastReflection_MsgCreateValidatorResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgAddValidatorResponse) Interface() protoreflect.ProtoMessage { - return (*MsgAddValidatorResponse)(x) +func (x *fastReflection_MsgCreateValidatorResponse) Interface() protoreflect.ProtoMessage { + return (*MsgCreateValidatorResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -700,10 +572,10 @@ func (x *fastReflection_MsgAddValidatorResponse) Interface() protoreflect.ProtoM // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgAddValidatorResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MsgCreateValidatorResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Address != "" { value := protoreflect.ValueOfString(x.Address) - if !f(fd_MsgAddValidatorResponse_address, value) { + if !f(fd_MsgCreateValidatorResponse_address, value) { return } } @@ -720,15 +592,15 @@ func (x *fastReflection_MsgAddValidatorResponse) Range(f func(protoreflect.Field // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgAddValidatorResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgCreateValidatorResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "chora.validator.v1.MsgAddValidatorResponse.address": + case "chora.validator.v1.MsgCreateValidatorResponse.address": return x.Address != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgAddValidatorResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgCreateValidatorResponse")) } - panic(fmt.Errorf("message chora.validator.v1.MsgAddValidatorResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.validator.v1.MsgCreateValidatorResponse does not contain field %s", fd.FullName())) } } @@ -738,15 +610,15 @@ func (x *fastReflection_MsgAddValidatorResponse) Has(fd protoreflect.FieldDescri // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddValidatorResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgCreateValidatorResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "chora.validator.v1.MsgAddValidatorResponse.address": + case "chora.validator.v1.MsgCreateValidatorResponse.address": x.Address = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgAddValidatorResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgCreateValidatorResponse")) } - panic(fmt.Errorf("message chora.validator.v1.MsgAddValidatorResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.validator.v1.MsgCreateValidatorResponse does not contain field %s", fd.FullName())) } } @@ -756,16 +628,16 @@ func (x *fastReflection_MsgAddValidatorResponse) Clear(fd protoreflect.FieldDesc // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgAddValidatorResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateValidatorResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "chora.validator.v1.MsgAddValidatorResponse.address": + case "chora.validator.v1.MsgCreateValidatorResponse.address": value := x.Address return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgAddValidatorResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgCreateValidatorResponse")) } - panic(fmt.Errorf("message chora.validator.v1.MsgAddValidatorResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message chora.validator.v1.MsgCreateValidatorResponse does not contain field %s", descriptor.FullName())) } } @@ -779,15 +651,15 @@ func (x *fastReflection_MsgAddValidatorResponse) Get(descriptor protoreflect.Fie // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddValidatorResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgCreateValidatorResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "chora.validator.v1.MsgAddValidatorResponse.address": + case "chora.validator.v1.MsgCreateValidatorResponse.address": x.Address = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgAddValidatorResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgCreateValidatorResponse")) } - panic(fmt.Errorf("message chora.validator.v1.MsgAddValidatorResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.validator.v1.MsgCreateValidatorResponse does not contain field %s", fd.FullName())) } } @@ -801,40 +673,40 @@ func (x *fastReflection_MsgAddValidatorResponse) Set(fd protoreflect.FieldDescri // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddValidatorResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateValidatorResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.validator.v1.MsgAddValidatorResponse.address": - panic(fmt.Errorf("field address of message chora.validator.v1.MsgAddValidatorResponse is not mutable")) + case "chora.validator.v1.MsgCreateValidatorResponse.address": + panic(fmt.Errorf("field address of message chora.validator.v1.MsgCreateValidatorResponse is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgAddValidatorResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgCreateValidatorResponse")) } - panic(fmt.Errorf("message chora.validator.v1.MsgAddValidatorResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.validator.v1.MsgCreateValidatorResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgAddValidatorResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateValidatorResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.validator.v1.MsgAddValidatorResponse.address": + case "chora.validator.v1.MsgCreateValidatorResponse.address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgAddValidatorResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.validator.v1.MsgCreateValidatorResponse")) } - panic(fmt.Errorf("message chora.validator.v1.MsgAddValidatorResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.validator.v1.MsgCreateValidatorResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgAddValidatorResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgCreateValidatorResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in chora.validator.v1.MsgAddValidatorResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in chora.validator.v1.MsgCreateValidatorResponse", d.FullName())) } panic("unreachable") } @@ -842,7 +714,7 @@ func (x *fastReflection_MsgAddValidatorResponse) WhichOneof(d protoreflect.Oneof // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgAddValidatorResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgCreateValidatorResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -853,7 +725,7 @@ func (x *fastReflection_MsgAddValidatorResponse) GetUnknown() protoreflect.RawFi // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgAddValidatorResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgCreateValidatorResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -865,7 +737,7 @@ func (x *fastReflection_MsgAddValidatorResponse) SetUnknown(fields protoreflect. // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgAddValidatorResponse) IsValid() bool { +func (x *fastReflection_MsgCreateValidatorResponse) IsValid() bool { return x != nil } @@ -875,9 +747,9 @@ func (x *fastReflection_MsgAddValidatorResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgAddValidatorResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgCreateValidatorResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgAddValidatorResponse) + x := input.Message.Interface().(*MsgCreateValidatorResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -903,7 +775,7 @@ func (x *fastReflection_MsgAddValidatorResponse) ProtoMethods() *protoiface.Meth } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgAddValidatorResponse) + x := input.Message.Interface().(*MsgCreateValidatorResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -940,7 +812,7 @@ func (x *fastReflection_MsgAddValidatorResponse) ProtoMethods() *protoiface.Meth }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgAddValidatorResponse) + x := input.Message.Interface().(*MsgCreateValidatorResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -972,10 +844,10 @@ func (x *fastReflection_MsgAddValidatorResponse) ProtoMethods() *protoiface.Meth fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAddValidatorResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateValidatorResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAddValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1046,15 +918,15 @@ func (x *fastReflection_MsgAddValidatorResponse) ProtoMethods() *protoiface.Meth } var ( - md_MsgRemoveValidator protoreflect.MessageDescriptor - fd_MsgRemoveValidator_admin protoreflect.FieldDescriptor - fd_MsgRemoveValidator_address protoreflect.FieldDescriptor + md_MsgRemoveValidator protoreflect.MessageDescriptor + fd_MsgRemoveValidator_operator protoreflect.FieldDescriptor + fd_MsgRemoveValidator_address protoreflect.FieldDescriptor ) func init() { file_chora_validator_v1_msg_proto_init() md_MsgRemoveValidator = File_chora_validator_v1_msg_proto.Messages().ByName("MsgRemoveValidator") - fd_MsgRemoveValidator_admin = md_MsgRemoveValidator.Fields().ByName("admin") + fd_MsgRemoveValidator_operator = md_MsgRemoveValidator.Fields().ByName("operator") fd_MsgRemoveValidator_address = md_MsgRemoveValidator.Fields().ByName("address") } @@ -1123,9 +995,9 @@ func (x *fastReflection_MsgRemoveValidator) Interface() protoreflect.ProtoMessag // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgRemoveValidator) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Admin != "" { - value := protoreflect.ValueOfString(x.Admin) - if !f(fd_MsgRemoveValidator_admin, value) { + if x.Operator != "" { + value := protoreflect.ValueOfString(x.Operator) + if !f(fd_MsgRemoveValidator_operator, value) { return } } @@ -1150,8 +1022,8 @@ func (x *fastReflection_MsgRemoveValidator) Range(f func(protoreflect.FieldDescr // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgRemoveValidator) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "chora.validator.v1.MsgRemoveValidator.admin": - return x.Admin != "" + case "chora.validator.v1.MsgRemoveValidator.operator": + return x.Operator != "" case "chora.validator.v1.MsgRemoveValidator.address": return x.Address != "" default: @@ -1170,8 +1042,8 @@ func (x *fastReflection_MsgRemoveValidator) Has(fd protoreflect.FieldDescriptor) // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgRemoveValidator) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "chora.validator.v1.MsgRemoveValidator.admin": - x.Admin = "" + case "chora.validator.v1.MsgRemoveValidator.operator": + x.Operator = "" case "chora.validator.v1.MsgRemoveValidator.address": x.Address = "" default: @@ -1190,8 +1062,8 @@ func (x *fastReflection_MsgRemoveValidator) Clear(fd protoreflect.FieldDescripto // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgRemoveValidator) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "chora.validator.v1.MsgRemoveValidator.admin": - value := x.Admin + case "chora.validator.v1.MsgRemoveValidator.operator": + value := x.Operator return protoreflect.ValueOfString(value) case "chora.validator.v1.MsgRemoveValidator.address": value := x.Address @@ -1216,8 +1088,8 @@ func (x *fastReflection_MsgRemoveValidator) Get(descriptor protoreflect.FieldDes // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgRemoveValidator) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "chora.validator.v1.MsgRemoveValidator.admin": - x.Admin = value.Interface().(string) + case "chora.validator.v1.MsgRemoveValidator.operator": + x.Operator = value.Interface().(string) case "chora.validator.v1.MsgRemoveValidator.address": x.Address = value.Interface().(string) default: @@ -1240,8 +1112,8 @@ func (x *fastReflection_MsgRemoveValidator) Set(fd protoreflect.FieldDescriptor, // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgRemoveValidator) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.validator.v1.MsgRemoveValidator.admin": - panic(fmt.Errorf("field admin of message chora.validator.v1.MsgRemoveValidator is not mutable")) + case "chora.validator.v1.MsgRemoveValidator.operator": + panic(fmt.Errorf("field operator of message chora.validator.v1.MsgRemoveValidator is not mutable")) case "chora.validator.v1.MsgRemoveValidator.address": panic(fmt.Errorf("field address of message chora.validator.v1.MsgRemoveValidator is not mutable")) default: @@ -1257,7 +1129,7 @@ func (x *fastReflection_MsgRemoveValidator) Mutable(fd protoreflect.FieldDescrip // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgRemoveValidator) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.validator.v1.MsgRemoveValidator.admin": + case "chora.validator.v1.MsgRemoveValidator.operator": return protoreflect.ValueOfString("") case "chora.validator.v1.MsgRemoveValidator.address": return protoreflect.ValueOfString("") @@ -1330,7 +1202,7 @@ func (x *fastReflection_MsgRemoveValidator) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Admin) + l = len(x.Operator) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1374,10 +1246,10 @@ func (x *fastReflection_MsgRemoveValidator) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x12 } - if len(x.Admin) > 0 { - i -= len(x.Admin) - copy(dAtA[i:], x.Admin) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Admin))) + if len(x.Operator) > 0 { + i -= len(x.Operator) + copy(dAtA[i:], x.Operator) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Operator))) i-- dAtA[i] = 0xa } @@ -1432,7 +1304,7 @@ func (x *fastReflection_MsgRemoveValidator) ProtoMethods() *protoiface.Methods { switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1460,7 +1332,7 @@ func (x *fastReflection_MsgRemoveValidator) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Admin = string(dAtA[iNdEx:postIndex]) + x.Operator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -3898,24 +3770,20 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// MsgAddValidator is the Msg/AddValidator request type. -type MsgAddValidator struct { +// MsgCreateValidator is the Msg/CreateValidator request type. +type MsgCreateValidator struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // admin is the address of the admin. - Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"` - // address is the address of the validator. - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // operator is the address of the operator. - Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator,omitempty"` + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` // metadata is the metadata of the validator. - Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` } -func (x *MsgAddValidator) Reset() { - *x = MsgAddValidator{} +func (x *MsgCreateValidator) Reset() { + *x = MsgCreateValidator{} if protoimpl.UnsafeEnabled { mi := &file_chora_validator_v1_msg_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3923,47 +3791,33 @@ func (x *MsgAddValidator) Reset() { } } -func (x *MsgAddValidator) String() string { +func (x *MsgCreateValidator) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgAddValidator) ProtoMessage() {} +func (*MsgCreateValidator) ProtoMessage() {} -// Deprecated: Use MsgAddValidator.ProtoReflect.Descriptor instead. -func (*MsgAddValidator) Descriptor() ([]byte, []int) { +// Deprecated: Use MsgCreateValidator.ProtoReflect.Descriptor instead. +func (*MsgCreateValidator) Descriptor() ([]byte, []int) { return file_chora_validator_v1_msg_proto_rawDescGZIP(), []int{0} } -func (x *MsgAddValidator) GetAdmin() string { - if x != nil { - return x.Admin - } - return "" -} - -func (x *MsgAddValidator) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *MsgAddValidator) GetOperator() string { +func (x *MsgCreateValidator) GetOperator() string { if x != nil { return x.Operator } return "" } -func (x *MsgAddValidator) GetMetadata() string { +func (x *MsgCreateValidator) GetMetadata() string { if x != nil { return x.Metadata } return "" } -// MsgAddValidatorResponse is the Msg/AddValidator response type. -type MsgAddValidatorResponse struct { +// MsgCreateValidatorResponse is the Msg/CreateValidator response type. +type MsgCreateValidatorResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -3972,8 +3826,8 @@ type MsgAddValidatorResponse struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (x *MsgAddValidatorResponse) Reset() { - *x = MsgAddValidatorResponse{} +func (x *MsgCreateValidatorResponse) Reset() { + *x = MsgCreateValidatorResponse{} if protoimpl.UnsafeEnabled { mi := &file_chora_validator_v1_msg_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3981,18 +3835,18 @@ func (x *MsgAddValidatorResponse) Reset() { } } -func (x *MsgAddValidatorResponse) String() string { +func (x *MsgCreateValidatorResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgAddValidatorResponse) ProtoMessage() {} +func (*MsgCreateValidatorResponse) ProtoMessage() {} -// Deprecated: Use MsgAddValidatorResponse.ProtoReflect.Descriptor instead. -func (*MsgAddValidatorResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use MsgCreateValidatorResponse.ProtoReflect.Descriptor instead. +func (*MsgCreateValidatorResponse) Descriptor() ([]byte, []int) { return file_chora_validator_v1_msg_proto_rawDescGZIP(), []int{1} } -func (x *MsgAddValidatorResponse) GetAddress() string { +func (x *MsgCreateValidatorResponse) GetAddress() string { if x != nil { return x.Address } @@ -4005,8 +3859,8 @@ type MsgRemoveValidator struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // admin is the address of the admin. - Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"` + // operator is the address of the operator. + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` // address is the address of the validator. Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` } @@ -4031,9 +3885,9 @@ func (*MsgRemoveValidator) Descriptor() ([]byte, []int) { return file_chora_validator_v1_msg_proto_rawDescGZIP(), []int{2} } -func (x *MsgRemoveValidator) GetAdmin() string { +func (x *MsgRemoveValidator) GetOperator() string { if x != nil { - return x.Admin + return x.Operator } return "" } @@ -4286,97 +4140,95 @@ var file_chora_validator_v1_msg_proto_rawDesc = []byte{ 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, - 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x01, 0x0a, 0x0f, - 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, - 0x14, 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x22, 0x33, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x50, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x52, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, - 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, - 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x0a, - 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x22, 0x36, 0x0a, 0x1a, 0x4d, 0x73, - 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x22, 0x98, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x30, 0x0a, 0x14, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x77, 0x69, - 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x31, - 0x0a, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x72, - 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6d, - 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x65, 0x72, 0x57, 0x69, 0x6e, 0x64, 0x6f, - 0x77, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x22, 0x7e, 0x0a, - 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x31, 0x0a, 0x15, 0x6d, 0x69, - 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x77, 0x69, 0x6e, - 0x64, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6d, 0x69, 0x6e, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x64, 0x50, 0x65, 0x72, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x22, 0x7c, 0x0a, - 0x12, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x58, 0x0a, 0x12, 0x4d, + 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1a, 0x0a, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x22, 0x36, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x59, 0x0a, + 0x12, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x65, 0x77, - 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x6e, 0x65, 0x77, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x0d, 0x82, 0xe7, - 0xb0, 0x2a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x36, 0x0a, 0x1a, 0x4d, + 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x0d, 0x82, 0xe7, 0xb0, 0x2a, 0x08, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x36, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x22, 0x98, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x77, 0x69, 0x6e, 0x64, + 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x31, 0x0a, 0x15, + 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x77, + 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6d, 0x69, 0x6e, + 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x65, 0x72, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3a, + 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x22, 0x7e, 0x0a, 0x17, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x73, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x31, 0x0a, 0x15, 0x6d, 0x69, 0x6e, 0x5f, + 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, + 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6d, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x50, 0x65, 0x72, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x22, 0x7c, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x32, 0x9f, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x0c, 0x41, - 0x64, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x23, 0x2e, 0x63, 0x68, - 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x1a, 0x2b, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, - 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x12, 0x26, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x1a, 0x2e, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, - 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x23, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, - 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x1a, 0x2b, 0x2e, - 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, 0x0f, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x26, 0x2e, - 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x1a, 0x2e, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xd3, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, - 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, - 0x42, 0x08, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2d, 0x69, - 0x6f, 0x2f, 0x6d, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x56, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x68, 0x6f, 0x72, - 0x61, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, - 0x12, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x5c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x5c, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x3a, 0x3a, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x5f, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, + 0x65, 0x77, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x0d, 0x82, 0xe7, 0xb0, 0x2a, + 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x36, 0x0a, 0x1a, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x32, 0xa8, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x69, 0x0a, 0x0f, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x26, 0x2e, 0x63, + 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x1a, 0x2e, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x26, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x1a, + 0x2e, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x60, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, + 0x23, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x1a, 0x2b, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x69, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x12, 0x26, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x1a, 0x2e, 0x2e, 0x63, + 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xd3, 0x01, 0x0a, + 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2d, 0x69, 0x6f, 0x2f, 0x6d, 0x6f, 0x64, 0x73, 0x2f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x6f, 0x72, + 0x61, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x56, 0x58, + 0xaa, 0x02, 0x12, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x5c, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x68, 0x6f, + 0x72, 0x61, 0x5c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x68, + 0x6f, 0x72, 0x61, 0x3a, 0x3a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4393,8 +4245,8 @@ func file_chora_validator_v1_msg_proto_rawDescGZIP() []byte { var file_chora_validator_v1_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_chora_validator_v1_msg_proto_goTypes = []interface{}{ - (*MsgAddValidator)(nil), // 0: chora.validator.v1.MsgAddValidator - (*MsgAddValidatorResponse)(nil), // 1: chora.validator.v1.MsgAddValidatorResponse + (*MsgCreateValidator)(nil), // 0: chora.validator.v1.MsgCreateValidator + (*MsgCreateValidatorResponse)(nil), // 1: chora.validator.v1.MsgCreateValidatorResponse (*MsgRemoveValidator)(nil), // 2: chora.validator.v1.MsgRemoveValidator (*MsgRemoveValidatorResponse)(nil), // 3: chora.validator.v1.MsgRemoveValidatorResponse (*MsgUpdatePolicy)(nil), // 4: chora.validator.v1.MsgUpdatePolicy @@ -4403,11 +4255,11 @@ var file_chora_validator_v1_msg_proto_goTypes = []interface{}{ (*MsgUpdateValidatorResponse)(nil), // 7: chora.validator.v1.MsgUpdateValidatorResponse } var file_chora_validator_v1_msg_proto_depIdxs = []int32{ - 0, // 0: chora.validator.v1.Msg.AddValidator:input_type -> chora.validator.v1.MsgAddValidator + 0, // 0: chora.validator.v1.Msg.CreateValidator:input_type -> chora.validator.v1.MsgCreateValidator 2, // 1: chora.validator.v1.Msg.RemoveValidator:input_type -> chora.validator.v1.MsgRemoveValidator 4, // 2: chora.validator.v1.Msg.UpdatePolicy:input_type -> chora.validator.v1.MsgUpdatePolicy 6, // 3: chora.validator.v1.Msg.UpdateValidator:input_type -> chora.validator.v1.MsgUpdateValidator - 1, // 4: chora.validator.v1.Msg.AddValidator:output_type -> chora.validator.v1.MsgAddValidatorResponse + 1, // 4: chora.validator.v1.Msg.CreateValidator:output_type -> chora.validator.v1.MsgCreateValidatorResponse 3, // 5: chora.validator.v1.Msg.RemoveValidator:output_type -> chora.validator.v1.MsgRemoveValidatorResponse 5, // 6: chora.validator.v1.Msg.UpdatePolicy:output_type -> chora.validator.v1.MsgUpdatePolicyResponse 7, // 7: chora.validator.v1.Msg.UpdateValidator:output_type -> chora.validator.v1.MsgUpdateValidatorResponse @@ -4425,7 +4277,7 @@ func file_chora_validator_v1_msg_proto_init() { } if !protoimpl.UnsafeEnabled { file_chora_validator_v1_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgAddValidator); i { + switch v := v.(*MsgCreateValidator); i { case 0: return &v.state case 1: @@ -4437,7 +4289,7 @@ func file_chora_validator_v1_msg_proto_init() { } } file_chora_validator_v1_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgAddValidatorResponse); i { + switch v := v.(*MsgCreateValidatorResponse); i { case 0: return &v.state case 1: diff --git a/validator/api/v1/msg_grpc.pb.go b/validator/api/v1/msg_grpc.pb.go index 4e0c97e..fc67159 100644 --- a/validator/api/v1/msg_grpc.pb.go +++ b/validator/api/v1/msg_grpc.pb.go @@ -19,7 +19,7 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - Msg_AddValidator_FullMethodName = "/chora.validator.v1.Msg/AddValidator" + Msg_CreateValidator_FullMethodName = "/chora.validator.v1.Msg/CreateValidator" Msg_RemoveValidator_FullMethodName = "/chora.validator.v1.Msg/RemoveValidator" Msg_UpdatePolicy_FullMethodName = "/chora.validator.v1.Msg/UpdatePolicy" Msg_UpdateValidator_FullMethodName = "/chora.validator.v1.Msg/UpdateValidator" @@ -31,8 +31,8 @@ const ( // // Msg is the Msg service. type MsgClient interface { - // AddValidator adds a validator (restricted to admin). - AddValidator(ctx context.Context, in *MsgAddValidator, opts ...grpc.CallOption) (*MsgAddValidatorResponse, error) + // CreateValidator adds a validator (restricted to admin). + CreateValidator(ctx context.Context, in *MsgCreateValidator, opts ...grpc.CallOption) (*MsgCreateValidatorResponse, error) // RemoveValidator removes a validator (restricted to admin). RemoveValidator(ctx context.Context, in *MsgRemoveValidator, opts ...grpc.CallOption) (*MsgRemoveValidatorResponse, error) // UpdatePolicy updates the policy (restricted to admin). @@ -49,10 +49,10 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { return &msgClient{cc} } -func (c *msgClient) AddValidator(ctx context.Context, in *MsgAddValidator, opts ...grpc.CallOption) (*MsgAddValidatorResponse, error) { +func (c *msgClient) CreateValidator(ctx context.Context, in *MsgCreateValidator, opts ...grpc.CallOption) (*MsgCreateValidatorResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgAddValidatorResponse) - err := c.cc.Invoke(ctx, Msg_AddValidator_FullMethodName, in, out, cOpts...) + out := new(MsgCreateValidatorResponse) + err := c.cc.Invoke(ctx, Msg_CreateValidator_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -95,8 +95,8 @@ func (c *msgClient) UpdateValidator(ctx context.Context, in *MsgUpdateValidator, // // Msg is the Msg service. type MsgServer interface { - // AddValidator adds a validator (restricted to admin). - AddValidator(context.Context, *MsgAddValidator) (*MsgAddValidatorResponse, error) + // CreateValidator adds a validator (restricted to admin). + CreateValidator(context.Context, *MsgCreateValidator) (*MsgCreateValidatorResponse, error) // RemoveValidator removes a validator (restricted to admin). RemoveValidator(context.Context, *MsgRemoveValidator) (*MsgRemoveValidatorResponse, error) // UpdatePolicy updates the policy (restricted to admin). @@ -113,8 +113,8 @@ type MsgServer interface { // pointer dereference when methods are called. type UnimplementedMsgServer struct{} -func (UnimplementedMsgServer) AddValidator(context.Context, *MsgAddValidator) (*MsgAddValidatorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddValidator not implemented") +func (UnimplementedMsgServer) CreateValidator(context.Context, *MsgCreateValidator) (*MsgCreateValidatorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateValidator not implemented") } func (UnimplementedMsgServer) RemoveValidator(context.Context, *MsgRemoveValidator) (*MsgRemoveValidatorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveValidator not implemented") @@ -146,20 +146,20 @@ func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { s.RegisterService(&Msg_ServiceDesc, srv) } -func _Msg_AddValidator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAddValidator) +func _Msg_CreateValidator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateValidator) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).AddValidator(ctx, in) + return srv.(MsgServer).CreateValidator(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Msg_AddValidator_FullMethodName, + FullMethod: Msg_CreateValidator_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AddValidator(ctx, req.(*MsgAddValidator)) + return srv.(MsgServer).CreateValidator(ctx, req.(*MsgCreateValidator)) } return interceptor(ctx, in, info, handler) } @@ -226,8 +226,8 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "AddValidator", - Handler: _Msg_AddValidator_Handler, + MethodName: "CreateValidator", + Handler: _Msg_CreateValidator_Handler, }, { MethodName: "RemoveValidator", diff --git a/validator/cmd/tx.go b/validator/cmd/tx.go index d2c4297..6e463cf 100644 --- a/validator/cmd/tx.go +++ b/validator/cmd/tx.go @@ -19,7 +19,7 @@ func TxCmd() *cobra.Command { } cmd.AddCommand( - TxAddValidatorCmd(), + TxCreateValidatorCmd(), TxRemoveValidatorCmd(), TxUpdateValidatorCmd(), ) diff --git a/validator/cmd/tx_add_validator.go b/validator/cmd/tx_create_validator.go similarity index 67% rename from validator/cmd/tx_add_validator.go rename to validator/cmd/tx_create_validator.go index 091b7e3..e40c513 100644 --- a/validator/cmd/tx_add_validator.go +++ b/validator/cmd/tx_create_validator.go @@ -10,23 +10,22 @@ import ( v1 "github.com/chora-io/mods/validator/types/v1" ) -// TxAddValidatorCmd creates and returns the tx add command. -func TxAddValidatorCmd() *cobra.Command { +// TxCreateValidatorCmd creates and returns the tx create-validator command. +func TxCreateValidatorCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "add-validator [address] [metadata]", + Use: "create-validator [metadata]", Short: "submit transaction to create validator", Long: "submit transaction to create validator", - Args: cobra.ExactArgs(2), + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } - msg := v1.MsgAddValidator{ - Admin: clientCtx.GetFromAddress().String(), - Address: args[0], - Metadata: args[1], + msg := v1.MsgCreateValidator{ + Operator: clientCtx.GetFromAddress().String(), + Metadata: args[0], } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) diff --git a/validator/cmd/tx_remove_validator.go b/validator/cmd/tx_remove_validator.go index 9062ba4..ede9294 100644 --- a/validator/cmd/tx_remove_validator.go +++ b/validator/cmd/tx_remove_validator.go @@ -24,8 +24,8 @@ func TxRemoveValidatorCmd() *cobra.Command { } msg := v1.MsgRemoveValidator{ - Admin: clientCtx.GetFromAddress().String(), - Address: args[0], + Operator: clientCtx.GetFromAddress().String(), + Address: args[0], } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) diff --git a/validator/cmd/tx_update_validator.go b/validator/cmd/tx_update_validator.go index 547b0c0..2c1a51f 100644 --- a/validator/cmd/tx_update_validator.go +++ b/validator/cmd/tx_update_validator.go @@ -13,10 +13,10 @@ import ( // TxUpdateValidatorCmd creates and returns the tx update command. func TxUpdateValidatorCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "update-validator [new-metadata]", + Use: "update-validator [address] [new-metadata]", Short: "submit transaction to update validator metadata", Long: "submit transaction to update validator metadata", - Args: cobra.ExactArgs(1), + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -24,8 +24,9 @@ func TxUpdateValidatorCmd() *cobra.Command { } msg := v1.MsgUpdateValidator{ - Address: clientCtx.GetFromAddress().String(), - NewMetadata: args[0], + Operator: clientCtx.GetFromAddress().String(), + Address: args[0], + NewMetadata: args[1], } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) diff --git a/validator/genesis/genesis_test.go b/validator/genesis/genesis_test.go index 82257c2..d75d4dd 100644 --- a/validator/genesis/genesis_test.go +++ b/validator/genesis/genesis_test.go @@ -26,6 +26,7 @@ func TestValidateGenesis(t *testing.T) { name: "valid", setup: func(ctx context.Context, ss validatorv1.StateStore) { require.NoError(t, ss.ValidatorTable().Insert(ctx, &validatorv1.Validator{ + Operator: "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", Address: "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", Metadata: "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf", })) diff --git a/validator/keeper/msg_add_validator.feature b/validator/keeper/msg_add_validator.feature deleted file mode 100644 index bcb3088..0000000 --- a/validator/keeper/msg_add_validator.feature +++ /dev/null @@ -1,106 +0,0 @@ -Feature: Msg/AddValidator - - Msg/AddValidator is successful when: - - admin is the admin address - - Msg/AddValidator has the following outcomes: - - Validator is added to state - - EventAddValidator is emitted - - MsgAddValidatorResponse is returned - - Rule: The admin must be the admin address - - Background: - Given admin "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - - Scenario: admin is admin address - When msg add validator - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", - "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" - } - """ - Then expect no error - - Scenario: admin is not admin address - When msg add validator - """ - { - "admin": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", - "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" - } - """ - Then expect the error - """ - admin: expected chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38: received chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup: unauthorized - """ - - Rule: Validator is added to state - - Background: - Given admin "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - - Scenario: state validator added - When msg add validator - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", - "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" - } - """ - Then expect state validator - """ - { - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", - "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" - } - """ - - # No failing scenario - state is never updated when message fails - - Rule: EventAddValidator is emitted - - Scenario: event add emitted - When msg add validator - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", - "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" - } - """ - Then expect event add - """ - { - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" - } - """ - - # No failing scenario - event is never emitted when message fails - - Rule: MsgAddValidatorResponse is returned - - Background: - Given admin "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - - Scenario: message response returned - When msg add validator - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", - "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" - } - """ - Then expect response - """ - { - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" - } - """ - - # No failing scenario - response is never returned when message fails diff --git a/validator/keeper/msg_create_validator.feature b/validator/keeper/msg_create_validator.feature new file mode 100644 index 0000000..a01b001 --- /dev/null +++ b/validator/keeper/msg_create_validator.feature @@ -0,0 +1,80 @@ +Feature: Msg/CreateValidator + + Msg/CreateValidator is successful when: + - always (an error is never returned) + + Msg/CreateValidator has the following outcomes: + - Validator is added to state + - EventCreateValidator is emitted + - MsgCreateValidatorResponse is returned + + Rule: The operator must be the validator operator + + Scenario: never error + When msg create validator + """ + { + "operator": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + Then expect no error + + Rule: Validator is added to state + + Scenario: state validator added + When msg create validator + """ + { + "operator": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + Then expect state validator + """ + { + "operator": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + + # No failing scenario - state is never updated when message fails + + Rule: EventCreateValidator is emitted + + Scenario: event add emitted + When msg create validator + """ + { + "operator": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + Then expect event add + """ + { + "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" + } + """ + + # No failing scenario - event is never emitted when message fails + + Rule: MsgCreateValidatorResponse is returned + + Scenario: message response returned + When msg create validator + """ + { + "operator": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + Then expect response + """ + { + "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" + } + """ + + # No failing scenario - response is never returned when message fails diff --git a/validator/keeper/msg_add_validator.go b/validator/keeper/msg_create_validator.go similarity index 59% rename from validator/keeper/msg_add_validator.go rename to validator/keeper/msg_create_validator.go index 2995ca3..284f7fd 100644 --- a/validator/keeper/msg_add_validator.go +++ b/validator/keeper/msg_create_validator.go @@ -10,20 +10,23 @@ import ( v1 "github.com/chora-io/mods/validator/types/v1" ) -// AddValidator implements Msg/AddValidator. -func (k Keeper) AddValidator(ctx context.Context, req *v1.MsgAddValidator) (*v1.MsgAddValidatorResponse, error) { +// CreateValidator implements Msg/CreateValidator. +func (k Keeper) CreateValidator(ctx context.Context, req *v1.MsgCreateValidator) (*v1.MsgCreateValidatorResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) - adminAddress := k.admin.String() - if adminAddress != req.Admin { + operator := k.admin.String() + if operator != req.Operator { return nil, sdkerrors.ErrUnauthorized.Wrapf( - "admin: expected %s: received %s", adminAddress, req.Admin, + "operator: expected %s: received %s", operator, req.Operator, ) } + // TODO: generate validator address + validator := req.Operator + // insert validator into validator table err := k.ss.ValidatorTable().Insert(ctx, &validatorv1.Validator{ - Address: req.Address, + Address: validator, Metadata: req.Metadata, }) if err != nil { @@ -32,21 +35,21 @@ func (k Keeper) AddValidator(ctx context.Context, req *v1.MsgAddValidator) (*v1. // insert validator into validator signing info table err = k.ss.ValidatorSigningInfoTable().Insert(ctx, &validatorv1.ValidatorSigningInfo{ - Address: req.Address, + Address: validator, }) if err != nil { return nil, err // internal error } // emit event - if err = sdkCtx.EventManager().EmitTypedEvent(&v1.EventAddValidator{ - Address: req.Address, + if err = sdkCtx.EventManager().EmitTypedEvent(&v1.EventCreateValidator{ + Address: validator, }); err != nil { return nil, err // internal error } // return response - return &v1.MsgAddValidatorResponse{ - Address: req.Address, + return &v1.MsgCreateValidatorResponse{ + Address: validator, }, nil } diff --git a/validator/keeper/msg_add_validator_test.go b/validator/keeper/msg_create_validator_test.go similarity index 59% rename from validator/keeper/msg_add_validator_test.go rename to validator/keeper/msg_create_validator_test.go index 96c5c93..575efbc 100644 --- a/validator/keeper/msg_add_validator_test.go +++ b/validator/keeper/msg_create_validator_test.go @@ -12,51 +12,51 @@ import ( "github.com/chora-io/mods/validator/utils" ) -type msgAddValidator struct { +type msgCreateValidator struct { *baseSuite - res *v1.MsgAddValidatorResponse + res *v1.MsgCreateValidatorResponse err error } -func TestMsgAddValidator(t *testing.T) { - gocuke.NewRunner(t, &msgAddValidator{}). - Path("./msg_add_validator.feature"). +func TestMsgCreateValidator(t *testing.T) { + gocuke.NewRunner(t, &msgCreateValidator{}). + Path("./msg_create_validator.feature"). Run() } -func (s *msgAddValidator) Before(t gocuke.TestingT) { +func (s *msgCreateValidator) Before(t gocuke.TestingT) { s.baseSuite = setupBase(t) } -func (s *msgAddValidator) Admin(a string) { +func (s *msgCreateValidator) Admin(a string) { require.Equal(s.t, s.admin.String(), a) } -func (s *msgAddValidator) MsgAddValidator(a gocuke.DocString) { - var msg v1.MsgAddValidator +func (s *msgCreateValidator) MsgCreateValidator(a gocuke.DocString) { + var msg v1.MsgCreateValidator err := jsonpb.UnmarshalString(a.Content, &msg) require.NoError(s.t, err) - s.res, s.err = s.k.AddValidator(s.sdkCtx, &msg) + s.res, s.err = s.k.CreateValidator(s.sdkCtx, &msg) } -func (s *msgAddValidator) ExpectNoError() { +func (s *msgCreateValidator) ExpectNoError() { require.NoError(s.t, s.err) } -func (s *msgAddValidator) ExpectTheError(a gocuke.DocString) { +func (s *msgCreateValidator) ExpectTheError(a gocuke.DocString) { require.EqualError(s.t, s.err, a.Content) } -func (s *msgAddValidator) ExpectResponse(a gocuke.DocString) { - var expected v1.MsgAddValidatorResponse +func (s *msgCreateValidator) ExpectResponse(a gocuke.DocString) { + var expected v1.MsgCreateValidatorResponse err := jsonpb.UnmarshalString(a.Content, &expected) require.NoError(s.t, err) require.Equal(s.t, &expected, s.res) } -func (s *msgAddValidator) ExpectStateValidator(a gocuke.DocString) { +func (s *msgCreateValidator) ExpectStateValidator(a gocuke.DocString) { var expected validatorv1.Validator err := jsonpb.UnmarshalString(a.Content, &expected) require.NoError(s.t, err) @@ -68,8 +68,8 @@ func (s *msgAddValidator) ExpectStateValidator(a gocuke.DocString) { require.Equal(s.t, expected.Metadata, actual.Metadata) } -func (s *msgAddValidator) ExpectEventAdd(a gocuke.DocString) { - var expected v1.EventAddValidator +func (s *msgCreateValidator) ExpectEventAdd(a gocuke.DocString) { + var expected v1.EventCreateValidator err := jsonpb.UnmarshalString(a.Content, &expected) require.NoError(s.t, err) diff --git a/validator/keeper/msg_remove_validator.feature b/validator/keeper/msg_remove_validator.feature index 78b9b22..89bfe16 100644 --- a/validator/keeper/msg_remove_validator.feature +++ b/validator/keeper/msg_remove_validator.feature @@ -1,7 +1,6 @@ Feature: Msg/RemoveValidator RemoveValidator is successful when: - - admin is the admin address - validator with address exists RemoveValidator has the following outcomes: @@ -10,56 +9,13 @@ Feature: Msg/RemoveValidator - EventRemoveValidator is emitted - MsgRemoveValidatorResponse is returned - Rule: The admin must be the admin address - - Background: - Given admin "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - And validator - """ - { - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", - "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" - } - """ - And validator signing info - """ - { - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", - "missed_blocks": [], - "missed_blocks_count": 0 - } - """ - - Scenario: admin is admin address - When msg remove validator - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" - } - """ - Then expect no error - - Scenario: admin is not admin address - When msg remove validator - """ - { - "admin": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" - } - """ - Then expect the error - """ - admin: expected chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38: received chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup: unauthorized - """ - Rule: The validator must exist Background: - Given admin "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - And validator + Given validator """ { + "operator": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" } @@ -77,7 +33,7 @@ Feature: Msg/RemoveValidator When msg remove validator """ { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "operator": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" } """ @@ -87,7 +43,7 @@ Feature: Msg/RemoveValidator When msg remove validator """ { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "operator": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" } """ @@ -99,10 +55,10 @@ Feature: Msg/RemoveValidator Rule: Validator is removed from state Background: - Given admin "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - And validator + Given validator """ { + "operator": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" } @@ -120,7 +76,7 @@ Feature: Msg/RemoveValidator When msg remove validator """ { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "operator": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" } """ @@ -131,10 +87,10 @@ Feature: Msg/RemoveValidator Rule: ValidatorSigningInfo is removed from state Background: - Given admin "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - And validator + Given validator """ { + "operator": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" } @@ -152,7 +108,7 @@ Feature: Msg/RemoveValidator When msg remove validator """ { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "operator": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" } """ @@ -163,10 +119,10 @@ Feature: Msg/RemoveValidator Rule: EventRemoveValidator emitted Background: - Given admin "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - And validator + Given validator """ { + "operator": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" } @@ -184,7 +140,7 @@ Feature: Msg/RemoveValidator When msg remove validator """ { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "operator": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" } """ @@ -200,10 +156,10 @@ Feature: Msg/RemoveValidator Rule: MsgRemoveValidatorResponse is returned Background: - Given admin "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - And validator + Given validator """ { + "operator": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" } @@ -221,7 +177,7 @@ Feature: Msg/RemoveValidator When msg remove validator """ { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "operator": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" } """ diff --git a/validator/keeper/msg_remove_validator.go b/validator/keeper/msg_remove_validator.go index b54f759..19fb5cc 100644 --- a/validator/keeper/msg_remove_validator.go +++ b/validator/keeper/msg_remove_validator.go @@ -14,13 +14,6 @@ import ( func (k Keeper) RemoveValidator(ctx context.Context, req *v1.MsgRemoveValidator) (*v1.MsgRemoveValidatorResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) - adminAddress := k.admin.String() - if adminAddress != req.Admin { - return nil, sdkerrors.ErrUnauthorized.Wrapf( - "admin: expected %s: received %s", adminAddress, req.Admin, - ) - } - // get validator from validator table validator, err := k.ss.ValidatorTable().Get(ctx, req.Address) if err != nil { @@ -32,6 +25,19 @@ func (k Keeper) RemoveValidator(ctx context.Context, req *v1.MsgRemoveValidator) return nil, err // internal error } + // get account from account bytes + reqOperator := sdk.AccAddress(req.Operator) + + // get account from account bytes + valOperator := sdk.AccAddress(validator.Operator) + + // verify admin is agent admin + if !reqOperator.Equals(valOperator) { + return nil, sdkerrors.ErrUnauthorized.Wrapf( + "operator %s: validator operator %s", req.Operator, validator.Operator, + ) + } + // get signing info from validator signing info table signingInfo, err := k.ss.ValidatorSigningInfoTable().Get(ctx, req.Address) if err != nil { diff --git a/validator/keeper/msg_remove_validator_test.go b/validator/keeper/msg_remove_validator_test.go index fa2b8bf..a03aa38 100644 --- a/validator/keeper/msg_remove_validator_test.go +++ b/validator/keeper/msg_remove_validator_test.go @@ -38,7 +38,9 @@ func (s *msgRemoveValidator) Validator(a gocuke.DocString) { require.NoError(s.t, err) err = s.k.ss.ValidatorTable().Insert(s.sdkCtx, &validatorv1.Validator{ - Address: validator.Address, + Operator: validator.Operator, + Address: validator.Address, + Metadata: validator.Metadata, }) require.NoError(s.t, err) } diff --git a/validator/module/autocli.go b/validator/module/autocli.go index 4430dc8..2840d94 100644 --- a/validator/module/autocli.go +++ b/validator/module/autocli.go @@ -37,11 +37,10 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { EnhanceCustomCommand: false, // use custom commands until v0.51 RpcCommandOptions: []*autocliv1.RpcCommandOptions{ //{ - // RpcMethod: "AddValidator", - // Use: "add-validator [address] [metadata]", + // RpcMethod: "CreateValidator", + // Use: "create-validator [metadata]", // Short: "submit transaction to create validator", // PositionalArgs: []*autocliv1.PositionalArgDescriptor{ - // {ProtoField: "address"}, // {ProtoField: "metadata"}, // }, //}, @@ -55,21 +54,20 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { //}, { RpcMethod: "UpdatePolicy", - Use: "update-policy [admin] [signed-blocks-window] [min-signed-per-window]", + Use: "update-policy [signed-blocks-window] [min-signed-per-window]", Short: "submit transaction to update a validator", PositionalArgs: []*autocliv1.PositionalArgDescriptor{ - {ProtoField: "admin"}, {ProtoField: "signed_blocks_window"}, {ProtoField: "min_signed_per_window"}, }, }, //{ // RpcMethod: "UpdateValidator", - // Use: "update-validator [address] [metadata]", + // Use: "update-validator [address] [new-metadata]", // Short: "submit transaction to update validator", // PositionalArgs: []*autocliv1.PositionalArgDescriptor{ // {ProtoField: "address"}, - // {ProtoField: "metadata"}, + // {ProtoField: "new_metadata"}, // }, //}, }, diff --git a/validator/proto/v1/events.proto b/validator/proto/v1/events.proto index e7e4dfe..068fdd9 100644 --- a/validator/proto/v1/events.proto +++ b/validator/proto/v1/events.proto @@ -4,8 +4,8 @@ package chora.validator.v1; option go_package = "github.com/chora-io/mods/validator/types/v1"; -// EventAddValidator is an event emitted when a validator is added. -message EventAddValidator { +// EventCreateValidator is an event emitted when a validator is created. +message EventCreateValidator { // address is the address of the validator. string address = 1; diff --git a/validator/proto/v1/msg.proto b/validator/proto/v1/msg.proto index b8d33fc..e9eb9c6 100644 --- a/validator/proto/v1/msg.proto +++ b/validator/proto/v1/msg.proto @@ -9,8 +9,8 @@ option go_package = "github.com/chora-io/mods/validator/types/v1"; // Msg is the Msg service. service Msg { - // AddValidator adds a validator (restricted to admin). - rpc AddValidator(MsgAddValidator) returns (MsgAddValidatorResponse); + // CreateValidator adds a validator (restricted to admin). + rpc CreateValidator(MsgCreateValidator) returns (MsgCreateValidatorResponse); // RemoveValidator removes a validator (restricted to admin). rpc RemoveValidator(MsgRemoveValidator) returns (MsgRemoveValidatorResponse); @@ -22,25 +22,19 @@ service Msg { rpc UpdateValidator(MsgUpdateValidator) returns (MsgUpdateValidatorResponse); } -// MsgAddValidator is the Msg/AddValidator request type. -message MsgAddValidator { +// MsgCreateValidator is the Msg/CreateValidator request type. +message MsgCreateValidator { option (cosmos.msg.v1.signer) = "admin"; - // admin is the address of the admin. - string admin = 1; - - // address is the address of the validator. - string address = 2; - // operator is the address of the operator. - string operator = 3; + string operator = 1; // metadata is the metadata of the validator. - string metadata = 4; + string metadata = 2; } -// MsgAddValidatorResponse is the Msg/AddValidator response type. -message MsgAddValidatorResponse { +// MsgCreateValidatorResponse is the Msg/CreateValidator response type. +message MsgCreateValidatorResponse { // address is the address of the validator. string address = 1; @@ -48,10 +42,10 @@ message MsgAddValidatorResponse { // MsgRemoveValidator is the Msg/RemoveValidator request type. message MsgRemoveValidator { - option (cosmos.msg.v1.signer) = "admin"; + option (cosmos.msg.v1.signer) = "operator"; - // admin is the address of the admin. - string admin = 1; + // operator is the address of the operator. + string operator = 1; // address is the address of the validator. string address = 2; diff --git a/validator/spec/02_msg.md b/validator/spec/02_msg.md index bd61ddf..b133a4f 100644 --- a/validator/spec/02_msg.md +++ b/validator/spec/02_msg.md @@ -8,7 +8,7 @@ The messages are defined in proto files available to view on [Buf Schema Registr -- [AddValidator](https://buf.build/chora/validator/docs/main:chora.validator.v1#chora.validator.v1.Msg.AddValidator) +- [CreateValidator](https://buf.build/chora/validator/docs/main:chora.validator.v1#chora.validator.v1.Msg.CreateValidator) - [RemoveValidator](https://buf.build/chora/validator/docs/main:chora.validator.v1#chora.validator.v1.Msg.RemoveValidator) - [UpdatePolicy](https://buf.build/chora/validator/docs/main:chora.validator.v1#chora.validator.v1.Msg.UpdatePolicy) - [UpdateValidator](https://buf.build/chora/validator/docs/main:chora.validator.v1#chora.validator.v1.Msg.UpdateValidator) diff --git a/validator/spec/05_events.md b/validator/spec/05_events.md index 1e3a9b2..5c4bca4 100644 --- a/validator/spec/05_events.md +++ b/validator/spec/05_events.md @@ -8,7 +8,7 @@ The events are defined in the proto files available to view on [Buf Schema Regis -- [EventAddValidator](https://buf.build/chora/validator/docs/main:chora.validator.v1#chora.validator.v1.EventAddValidator) +- [EventCreateValidator](https://buf.build/chora/validator/docs/main:chora.validator.v1#chora.validator.v1.EventCreateValidator) - [EventRemoveValidator](https://buf.build/chora/validator/docs/main:chora.validator.v1#chora.validator.v1.EventRemoveValidator) - [EventUpdatePolicy](https://buf.build/chora/validator/docs/main:chora.validator.v1#chora.validator.v1.EventUpdatePolicy) - [EventUpdateValidator](https://buf.build/chora/validator/docs/main:chora.validator.v1#chora.validator.v1.EventUpdateValidator) diff --git a/validator/types/v1/codec.go b/validator/types/v1/codec.go index 049fcdb..57d0660 100644 --- a/validator/types/v1/codec.go +++ b/validator/types/v1/codec.go @@ -11,7 +11,7 @@ import ( func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), - &MsgAddValidator{}, + &MsgCreateValidator{}, &MsgRemoveValidator{}, &MsgUpdatePolicy{}, &MsgUpdateValidator{}, @@ -22,7 +22,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { // RegisterLegacyAminoCodec registers legacy amino codec. func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgAddValidator{}, "validator/MsgAddValidator", nil) + cdc.RegisterConcrete(&MsgCreateValidator{}, "validator/MsgCreateValidator", nil) cdc.RegisterConcrete(&MsgRemoveValidator{}, "validator/MsgRemoveValidator", nil) cdc.RegisterConcrete(&MsgUpdatePolicy{}, "validator/MsgUpdatePolicy", nil) cdc.RegisterConcrete(&MsgUpdateValidator{}, "validator/MsgUpdateValidator", nil) diff --git a/validator/types/v1/events.pb.go b/validator/types/v1/events.pb.go index 1cdece3..932360a 100644 --- a/validator/types/v1/events.pb.go +++ b/validator/types/v1/events.pb.go @@ -22,24 +22,24 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// EventAddValidator is an event emitted when a validator is added. -type EventAddValidator struct { +// EventCreateValidator is an event emitted when a validator is created. +type EventCreateValidator struct { // address is the address of the validator. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (m *EventAddValidator) Reset() { *m = EventAddValidator{} } -func (m *EventAddValidator) String() string { return proto.CompactTextString(m) } -func (*EventAddValidator) ProtoMessage() {} -func (*EventAddValidator) Descriptor() ([]byte, []int) { +func (m *EventCreateValidator) Reset() { *m = EventCreateValidator{} } +func (m *EventCreateValidator) String() string { return proto.CompactTextString(m) } +func (*EventCreateValidator) ProtoMessage() {} +func (*EventCreateValidator) Descriptor() ([]byte, []int) { return fileDescriptor_7944b2035d0f825b, []int{0} } -func (m *EventAddValidator) XXX_Unmarshal(b []byte) error { +func (m *EventCreateValidator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *EventAddValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EventCreateValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_EventAddValidator.Marshal(b, m, deterministic) + return xxx_messageInfo_EventCreateValidator.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -49,19 +49,19 @@ func (m *EventAddValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *EventAddValidator) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventAddValidator.Merge(m, src) +func (m *EventCreateValidator) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventCreateValidator.Merge(m, src) } -func (m *EventAddValidator) XXX_Size() int { +func (m *EventCreateValidator) XXX_Size() int { return m.Size() } -func (m *EventAddValidator) XXX_DiscardUnknown() { - xxx_messageInfo_EventAddValidator.DiscardUnknown(m) +func (m *EventCreateValidator) XXX_DiscardUnknown() { + xxx_messageInfo_EventCreateValidator.DiscardUnknown(m) } -var xxx_messageInfo_EventAddValidator proto.InternalMessageInfo +var xxx_messageInfo_EventCreateValidator proto.InternalMessageInfo -func (m *EventAddValidator) GetAddress() string { +func (m *EventCreateValidator) GetAddress() string { if m != nil { return m.Address } @@ -264,7 +264,7 @@ func (m *EventUpdateValidator) GetAddress() string { } func init() { - proto.RegisterType((*EventAddValidator)(nil), "chora.validator.v1.EventAddValidator") + proto.RegisterType((*EventCreateValidator)(nil), "chora.validator.v1.EventCreateValidator") proto.RegisterType((*EventMissedBlock)(nil), "chora.validator.v1.EventMissedBlock") proto.RegisterType((*EventRemoveValidator)(nil), "chora.validator.v1.EventRemoveValidator") proto.RegisterType((*EventUpdatePolicy)(nil), "chora.validator.v1.EventUpdatePolicy") @@ -274,28 +274,28 @@ func init() { func init() { proto.RegisterFile("chora/validator/v1/events.proto", fileDescriptor_7944b2035d0f825b) } var fileDescriptor_7944b2035d0f825b = []byte{ - // 282 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x41, 0x4b, 0xf3, 0x30, - 0x18, 0xc7, 0xdb, 0xf7, 0x05, 0xc5, 0x9c, 0x34, 0x4c, 0xd8, 0x29, 0xca, 0x4e, 0x82, 0xae, 0x59, - 0xf1, 0x13, 0x38, 0xd8, 0x51, 0x18, 0x15, 0x15, 0xbc, 0x94, 0xb6, 0x79, 0xd8, 0x82, 0x6d, 0x9e, - 0x92, 0xc4, 0xcc, 0x7d, 0x0b, 0x3f, 0x96, 0xc7, 0x1d, 0x3d, 0x4a, 0xfb, 0x45, 0x64, 0xe9, 0x3a, - 0x3c, 0xc9, 0x8e, 0xc9, 0xff, 0xf7, 0xcb, 0xf3, 0x27, 0x0f, 0xb9, 0x28, 0x96, 0xa8, 0x33, 0xee, - 0xb2, 0x52, 0x8a, 0xcc, 0xa2, 0xe6, 0x2e, 0xe6, 0xe0, 0x40, 0x59, 0x13, 0xd5, 0x1a, 0x2d, 0x52, - 0xea, 0x81, 0x68, 0x0f, 0x44, 0x2e, 0x1e, 0x8d, 0xc9, 0xd9, 0x6c, 0xcb, 0xdc, 0x09, 0xf1, 0xd4, - 0xdf, 0xd3, 0x21, 0x39, 0xce, 0x84, 0xd0, 0x60, 0xcc, 0x30, 0xbc, 0x0c, 0xaf, 0x4e, 0x92, 0xfe, - 0x38, 0xba, 0x21, 0xa7, 0x1e, 0xbf, 0x97, 0xc6, 0x80, 0x98, 0x96, 0x58, 0xbc, 0xfe, 0x41, 0x4f, - 0xc8, 0xc0, 0xd3, 0x09, 0x54, 0xe8, 0xe0, 0x90, 0xf7, 0xdf, 0x77, 0x75, 0x1e, 0x6b, 0x91, 0x59, - 0x98, 0x63, 0x29, 0x8b, 0x35, 0x9d, 0x90, 0x81, 0x91, 0x0b, 0x05, 0x22, 0xcd, 0xb7, 0x03, 0x4d, - 0xba, 0x92, 0x4a, 0xe0, 0xca, 0xbb, 0xff, 0x13, 0xda, 0x65, 0xbe, 0x8b, 0x79, 0xf6, 0x09, 0x8d, - 0xc9, 0x79, 0x25, 0x55, 0xba, 0xb3, 0x6a, 0xd0, 0xbd, 0xf2, 0xaf, 0x53, 0x2a, 0xa9, 0x1e, 0x7c, - 0x36, 0x07, 0xdd, 0x29, 0xfb, 0xae, 0xdd, 0xe4, 0x03, 0xba, 0x4e, 0x67, 0x9f, 0x0d, 0x0b, 0x37, - 0x0d, 0x0b, 0xbf, 0x1b, 0x16, 0x7e, 0xb4, 0x2c, 0xd8, 0xb4, 0x2c, 0xf8, 0x6a, 0x59, 0xf0, 0x72, - 0xbd, 0x90, 0x76, 0xf9, 0x96, 0x47, 0x05, 0x56, 0xdc, 0xff, 0xf9, 0x58, 0x22, 0xaf, 0x50, 0x98, - 0x5f, 0xcb, 0xb1, 0xeb, 0x1a, 0x0c, 0x77, 0x71, 0x7e, 0xe4, 0x97, 0x73, 0xfb, 0x13, 0x00, 0x00, - 0xff, 0xff, 0x97, 0x45, 0x94, 0x2a, 0xbf, 0x01, 0x00, 0x00, + // 280 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x41, 0x4b, 0xc3, 0x30, + 0x14, 0xc7, 0x5b, 0x05, 0xc5, 0x9c, 0x34, 0x4c, 0xd8, 0x29, 0xca, 0x4e, 0x82, 0xda, 0xac, 0xf8, + 0x0d, 0x26, 0x3b, 0x0a, 0xa3, 0xa2, 0x82, 0x97, 0x92, 0x36, 0x8f, 0x2d, 0xd8, 0xf6, 0x95, 0x24, + 0x66, 0xee, 0x5b, 0xf8, 0xb1, 0x3c, 0xee, 0xe8, 0x51, 0xda, 0x2f, 0x22, 0x4b, 0xed, 0xf0, 0x34, + 0x76, 0x0c, 0xff, 0xdf, 0xef, 0xbd, 0x3f, 0x79, 0xe4, 0x22, 0x5f, 0xa0, 0x16, 0xdc, 0x89, 0x42, + 0x49, 0x61, 0x51, 0x73, 0x17, 0x73, 0x70, 0x50, 0x59, 0x13, 0xd5, 0x1a, 0x2d, 0x52, 0xea, 0x81, + 0x68, 0x0b, 0x44, 0x2e, 0x1e, 0x8d, 0xc9, 0x60, 0xba, 0x61, 0xee, 0x35, 0x08, 0x0b, 0xcf, 0x7d, + 0x44, 0x87, 0xe4, 0x58, 0x48, 0xa9, 0xc1, 0x98, 0x61, 0x78, 0x19, 0x5e, 0x9d, 0x24, 0xfd, 0x73, + 0x74, 0x43, 0x4e, 0xbd, 0xf1, 0xa0, 0x8c, 0x01, 0x39, 0x29, 0x30, 0x7f, 0xdb, 0x41, 0xf7, 0xf3, + 0x13, 0x28, 0xd1, 0xed, 0x35, 0xff, 0x83, 0x9c, 0x79, 0xe3, 0xa9, 0x96, 0xc2, 0xc2, 0x0c, 0x0b, + 0x95, 0xaf, 0xe8, 0x98, 0x0c, 0x8c, 0x9a, 0x57, 0x20, 0xd3, 0x6c, 0xb3, 0xd0, 0xa4, 0x4b, 0x55, + 0x49, 0x5c, 0x7a, 0xf7, 0x30, 0xa1, 0x5d, 0xe6, 0xbb, 0x98, 0x17, 0x9f, 0xd0, 0x98, 0x9c, 0x97, + 0xaa, 0x4a, 0xff, 0xac, 0x1a, 0x74, 0xaf, 0x1c, 0x74, 0x4a, 0xa9, 0xaa, 0x47, 0x9f, 0xcd, 0x40, + 0x77, 0xca, 0xb6, 0x6b, 0xb7, 0x79, 0x8f, 0xae, 0x93, 0xe9, 0x57, 0xc3, 0xc2, 0x75, 0xc3, 0xc2, + 0x9f, 0x86, 0x85, 0x9f, 0x2d, 0x0b, 0xd6, 0x2d, 0x0b, 0xbe, 0x5b, 0x16, 0xbc, 0x5e, 0xcf, 0x95, + 0x5d, 0xbc, 0x67, 0x51, 0x8e, 0x25, 0xf7, 0xdf, 0x7e, 0xab, 0x90, 0x97, 0x28, 0xcd, 0xbf, 0xfb, + 0xd8, 0x55, 0x0d, 0x86, 0xbb, 0x38, 0x3b, 0xf2, 0xf7, 0xb9, 0xfb, 0x0d, 0x00, 0x00, 0xff, 0xff, + 0x91, 0x08, 0xa0, 0x95, 0xc2, 0x01, 0x00, 0x00, } -func (m *EventAddValidator) Marshal() (dAtA []byte, err error) { +func (m *EventCreateValidator) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -305,12 +305,12 @@ func (m *EventAddValidator) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *EventAddValidator) MarshalTo(dAtA []byte) (int, error) { +func (m *EventCreateValidator) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *EventAddValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EventCreateValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -459,7 +459,7 @@ func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *EventAddValidator) Size() (n int) { +func (m *EventCreateValidator) Size() (n int) { if m == nil { return 0 } @@ -532,7 +532,7 @@ func sovEvents(x uint64) (n int) { func sozEvents(x uint64) (n int) { return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *EventAddValidator) Unmarshal(dAtA []byte) error { +func (m *EventCreateValidator) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -555,10 +555,10 @@ func (m *EventAddValidator) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: EventAddValidator: wiretype end group for non-group") + return fmt.Errorf("proto: EventCreateValidator: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: EventAddValidator: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EventCreateValidator: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/validator/types/v1/msg.pb.go b/validator/types/v1/msg.pb.go index d8250eb..39ad079 100644 --- a/validator/types/v1/msg.pb.go +++ b/validator/types/v1/msg.pb.go @@ -28,30 +28,26 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// MsgAddValidator is the Msg/AddValidator request type. -type MsgAddValidator struct { - // admin is the address of the admin. - Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"` - // address is the address of the validator. - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +// MsgCreateValidator is the Msg/CreateValidator request type. +type MsgCreateValidator struct { // operator is the address of the operator. - Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator,omitempty"` + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` // metadata is the metadata of the validator. - Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` } -func (m *MsgAddValidator) Reset() { *m = MsgAddValidator{} } -func (m *MsgAddValidator) String() string { return proto.CompactTextString(m) } -func (*MsgAddValidator) ProtoMessage() {} -func (*MsgAddValidator) Descriptor() ([]byte, []int) { +func (m *MsgCreateValidator) Reset() { *m = MsgCreateValidator{} } +func (m *MsgCreateValidator) String() string { return proto.CompactTextString(m) } +func (*MsgCreateValidator) ProtoMessage() {} +func (*MsgCreateValidator) Descriptor() ([]byte, []int) { return fileDescriptor_8adf79de14971b1d, []int{0} } -func (m *MsgAddValidator) XXX_Unmarshal(b []byte) error { +func (m *MsgCreateValidator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgAddValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgCreateValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgAddValidator.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgCreateValidator.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -61,64 +57,50 @@ func (m *MsgAddValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *MsgAddValidator) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAddValidator.Merge(m, src) +func (m *MsgCreateValidator) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateValidator.Merge(m, src) } -func (m *MsgAddValidator) XXX_Size() int { +func (m *MsgCreateValidator) XXX_Size() int { return m.Size() } -func (m *MsgAddValidator) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAddValidator.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgAddValidator proto.InternalMessageInfo - -func (m *MsgAddValidator) GetAdmin() string { - if m != nil { - return m.Admin - } - return "" +func (m *MsgCreateValidator) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateValidator.DiscardUnknown(m) } -func (m *MsgAddValidator) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} +var xxx_messageInfo_MsgCreateValidator proto.InternalMessageInfo -func (m *MsgAddValidator) GetOperator() string { +func (m *MsgCreateValidator) GetOperator() string { if m != nil { return m.Operator } return "" } -func (m *MsgAddValidator) GetMetadata() string { +func (m *MsgCreateValidator) GetMetadata() string { if m != nil { return m.Metadata } return "" } -// MsgAddValidatorResponse is the Msg/AddValidator response type. -type MsgAddValidatorResponse struct { +// MsgCreateValidatorResponse is the Msg/CreateValidator response type. +type MsgCreateValidatorResponse struct { // address is the address of the validator. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (m *MsgAddValidatorResponse) Reset() { *m = MsgAddValidatorResponse{} } -func (m *MsgAddValidatorResponse) String() string { return proto.CompactTextString(m) } -func (*MsgAddValidatorResponse) ProtoMessage() {} -func (*MsgAddValidatorResponse) Descriptor() ([]byte, []int) { +func (m *MsgCreateValidatorResponse) Reset() { *m = MsgCreateValidatorResponse{} } +func (m *MsgCreateValidatorResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateValidatorResponse) ProtoMessage() {} +func (*MsgCreateValidatorResponse) Descriptor() ([]byte, []int) { return fileDescriptor_8adf79de14971b1d, []int{1} } -func (m *MsgAddValidatorResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgCreateValidatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgAddValidatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgCreateValidatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgAddValidatorResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgCreateValidatorResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -128,19 +110,19 @@ func (m *MsgAddValidatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *MsgAddValidatorResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAddValidatorResponse.Merge(m, src) +func (m *MsgCreateValidatorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateValidatorResponse.Merge(m, src) } -func (m *MsgAddValidatorResponse) XXX_Size() int { +func (m *MsgCreateValidatorResponse) XXX_Size() int { return m.Size() } -func (m *MsgAddValidatorResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAddValidatorResponse.DiscardUnknown(m) +func (m *MsgCreateValidatorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateValidatorResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgAddValidatorResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgCreateValidatorResponse proto.InternalMessageInfo -func (m *MsgAddValidatorResponse) GetAddress() string { +func (m *MsgCreateValidatorResponse) GetAddress() string { if m != nil { return m.Address } @@ -149,8 +131,8 @@ func (m *MsgAddValidatorResponse) GetAddress() string { // MsgRemoveValidator is the Msg/RemoveValidator request type. type MsgRemoveValidator struct { - // admin is the address of the admin. - Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"` + // operator is the address of the operator. + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` // address is the address of the validator. Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` } @@ -188,9 +170,9 @@ func (m *MsgRemoveValidator) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRemoveValidator proto.InternalMessageInfo -func (m *MsgRemoveValidator) GetAdmin() string { +func (m *MsgRemoveValidator) GetOperator() string { if m != nil { - return m.Admin + return m.Operator } return "" } @@ -482,8 +464,8 @@ func (m *MsgUpdateValidatorResponse) GetAddress() string { } func init() { - proto.RegisterType((*MsgAddValidator)(nil), "chora.validator.v1.MsgAddValidator") - proto.RegisterType((*MsgAddValidatorResponse)(nil), "chora.validator.v1.MsgAddValidatorResponse") + proto.RegisterType((*MsgCreateValidator)(nil), "chora.validator.v1.MsgCreateValidator") + proto.RegisterType((*MsgCreateValidatorResponse)(nil), "chora.validator.v1.MsgCreateValidatorResponse") proto.RegisterType((*MsgRemoveValidator)(nil), "chora.validator.v1.MsgRemoveValidator") proto.RegisterType((*MsgRemoveValidatorResponse)(nil), "chora.validator.v1.MsgRemoveValidatorResponse") proto.RegisterType((*MsgUpdatePolicy)(nil), "chora.validator.v1.MsgUpdatePolicy") @@ -495,38 +477,37 @@ func init() { func init() { proto.RegisterFile("chora/validator/v1/msg.proto", fileDescriptor_8adf79de14971b1d) } var fileDescriptor_8adf79de14971b1d = []byte{ - // 494 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcf, 0x6b, 0xd4, 0x40, - 0x14, 0xde, 0x69, 0xfc, 0xf9, 0x5c, 0x59, 0x18, 0x2a, 0x0d, 0x41, 0x82, 0xae, 0x50, 0xc4, 0x62, - 0xe2, 0x5a, 0xf0, 0xe0, 0xcd, 0x82, 0xc7, 0x85, 0x65, 0x45, 0x05, 0x2f, 0xdb, 0xd9, 0xcc, 0x90, - 0x0e, 0xee, 0x64, 0x42, 0x26, 0x66, 0x29, 0x88, 0x07, 0xc1, 0xbb, 0x47, 0x6f, 0xfe, 0x0b, 0xfe, - 0x19, 0x1e, 0x7b, 0xf4, 0x28, 0xbb, 0x07, 0xff, 0x0d, 0xc9, 0x4c, 0x13, 0x93, 0xd4, 0xb1, 0x6b, - 0x8f, 0x2f, 0xdf, 0xf7, 0xbd, 0xf7, 0xbd, 0xbc, 0x2f, 0x81, 0xdb, 0xd1, 0x91, 0xcc, 0x48, 0x58, - 0x90, 0x05, 0xa7, 0x24, 0x97, 0x59, 0x58, 0x8c, 0x42, 0xa1, 0xe2, 0x20, 0xcd, 0x64, 0x2e, 0x31, - 0xd6, 0x68, 0x50, 0xa3, 0x41, 0x31, 0xf2, 0x76, 0x22, 0xa9, 0x84, 0x54, 0x25, 0xab, 0x45, 0x1e, - 0x7e, 0x42, 0x30, 0x18, 0xab, 0xf8, 0x19, 0xa5, 0xaf, 0x2a, 0x3e, 0xde, 0x86, 0xcb, 0x84, 0x0a, - 0x9e, 0xb8, 0xe8, 0x0e, 0xba, 0x7f, 0x7d, 0x6a, 0x0a, 0xec, 0xc2, 0x55, 0x42, 0x69, 0xc6, 0x94, - 0x72, 0xb7, 0xf4, 0xf3, 0xaa, 0xc4, 0x1e, 0x5c, 0x93, 0x29, 0xcb, 0x4a, 0xad, 0xeb, 0x68, 0xa8, - 0xae, 0x4b, 0x4c, 0xb0, 0x9c, 0x50, 0x92, 0x13, 0xf7, 0x92, 0xc1, 0xaa, 0xfa, 0x29, 0x7c, 0xfc, - 0xf5, 0xed, 0x81, 0xe9, 0x3e, 0xdc, 0x87, 0x9d, 0x8e, 0x8d, 0x29, 0x53, 0xa9, 0x4c, 0x14, 0x6b, - 0x0e, 0x46, 0xad, 0xc1, 0xc3, 0x09, 0xe0, 0xb1, 0x8a, 0xa7, 0x4c, 0xc8, 0x82, 0x5d, 0xd8, 0x7e, - 0xcb, 0xc6, 0x13, 0xf0, 0xce, 0x76, 0xdc, 0xc0, 0xc9, 0x17, 0xf3, 0x1a, 0x5f, 0xa6, 0x94, 0xe4, - 0x6c, 0x22, 0x17, 0x3c, 0x3a, 0xb6, 0xf8, 0x78, 0x04, 0xdb, 0x8a, 0xc7, 0x09, 0xa3, 0xb3, 0xf9, - 0x42, 0x46, 0x6f, 0xd5, 0x6c, 0xc9, 0x13, 0x2a, 0x97, 0xda, 0x94, 0x33, 0xc5, 0x06, 0x3b, 0xd0, - 0xd0, 0x6b, 0x8d, 0xe0, 0x11, 0xdc, 0x12, 0x3c, 0x99, 0x9d, 0xaa, 0x52, 0x96, 0x55, 0x12, 0xc7, - 0x48, 0x04, 0x4f, 0x5e, 0x68, 0x6c, 0xc2, 0x32, 0x23, 0x69, 0xad, 0xf4, 0x41, 0xbf, 0xd9, 0xa6, - 0xb3, 0x7a, 0x1f, 0x9b, 0x17, 0xf4, 0xff, 0x5e, 0xb6, 0x6c, 0x5e, 0x86, 0xef, 0xf5, 0x91, 0xcc, - 0xfc, 0x3f, 0x47, 0x6a, 0x66, 0x06, 0x75, 0x32, 0x63, 0x4f, 0xda, 0x5d, 0xe8, 0x27, 0x6c, 0x39, - 0xab, 0x13, 0x65, 0xd2, 0x76, 0x23, 0x61, 0xcb, 0x71, 0x15, 0xaa, 0x9b, 0xe5, 0xea, 0x75, 0xaf, - 0xd3, 0x83, 0x76, 0xa6, 0x9f, 0x7f, 0xd0, 0xc7, 0x5f, 0x1d, 0x70, 0xc6, 0x2a, 0xc6, 0x87, 0xd0, - 0x6f, 0x7d, 0x1b, 0xf7, 0x82, 0xb3, 0x5f, 0x57, 0xd0, 0x49, 0xae, 0xb7, 0xb7, 0x01, 0xa9, 0xf6, - 0xc0, 0x61, 0xd0, 0x4d, 0xf0, 0xae, 0x45, 0xdf, 0xe1, 0x79, 0xc1, 0x66, 0xbc, 0x7a, 0xd4, 0x21, - 0xf4, 0x5b, 0x09, 0xb5, 0x2d, 0xd3, 0x24, 0x59, 0x97, 0xf9, 0x6b, 0xa2, 0x38, 0x0c, 0xba, 0x97, - 0xde, 0xfd, 0xa7, 0xfe, 0xfc, 0x65, 0x2c, 0xb7, 0x3b, 0x78, 0xfe, 0x7d, 0xe5, 0xa3, 0x93, 0x95, - 0x8f, 0x7e, 0xae, 0x7c, 0xf4, 0x79, 0xed, 0xf7, 0x4e, 0xd6, 0x7e, 0xef, 0xc7, 0xda, 0xef, 0xbd, - 0xd9, 0x8b, 0x79, 0x7e, 0xf4, 0x6e, 0x1e, 0x44, 0x52, 0x84, 0xba, 0xe7, 0x43, 0x2e, 0x43, 0x21, - 0xa9, 0x6a, 0xfc, 0x31, 0xf3, 0xe3, 0x94, 0xa9, 0xb0, 0x18, 0xcd, 0xaf, 0xe8, 0xff, 0xe0, 0xfe, - 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5b, 0x15, 0x6f, 0x69, 0x54, 0x05, 0x00, 0x00, + // 479 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcb, 0x8a, 0x13, 0x41, + 0x14, 0x4d, 0xa7, 0xf1, 0x75, 0x1d, 0x09, 0x14, 0x23, 0x13, 0x1a, 0x69, 0x34, 0xc2, 0x20, 0x0e, + 0x76, 0x1b, 0x05, 0x17, 0xb3, 0x1c, 0x71, 0x19, 0x18, 0x22, 0x3e, 0x37, 0xb1, 0xd2, 0x55, 0xf4, + 0x14, 0xa6, 0xaa, 0x9a, 0xaa, 0xb2, 0xc3, 0x80, 0xb8, 0xf0, 0x0b, 0x5c, 0xfa, 0x09, 0x2e, 0xfd, + 0x0c, 0x97, 0xb3, 0x74, 0x29, 0xc9, 0xc2, 0xdf, 0x90, 0x54, 0x3f, 0xe8, 0xee, 0xd8, 0x4e, 0xcb, + 0xec, 0x72, 0x39, 0xe7, 0xdc, 0x7b, 0x6e, 0xee, 0xe9, 0x82, 0x5b, 0xd1, 0x89, 0x54, 0x38, 0x4c, + 0xf1, 0x82, 0x11, 0x6c, 0xa4, 0x0a, 0xd3, 0x71, 0xc8, 0x75, 0x1c, 0x24, 0x4a, 0x1a, 0x89, 0x90, + 0x45, 0x83, 0x12, 0x0d, 0xd2, 0xb1, 0xb7, 0x17, 0x49, 0xcd, 0xa5, 0xde, 0xb0, 0x6a, 0xe4, 0xd1, + 0x6b, 0x40, 0x13, 0x1d, 0x3f, 0x55, 0x14, 0x1b, 0xfa, 0xb2, 0x50, 0x20, 0x0f, 0xae, 0xca, 0x84, + 0xaa, 0xcd, 0xef, 0xa1, 0x73, 0xdb, 0xb9, 0x77, 0x6d, 0x5a, 0xd6, 0x1b, 0x8c, 0x53, 0x83, 0x09, + 0x36, 0x78, 0xd8, 0xcf, 0xb0, 0xa2, 0x3e, 0x84, 0xcf, 0xbf, 0xbf, 0xdf, 0xbf, 0x84, 0x09, 0x67, + 0x62, 0xf4, 0x04, 0xbc, 0xed, 0xce, 0x53, 0xaa, 0x13, 0x29, 0x34, 0x45, 0x43, 0xb8, 0x82, 0x09, + 0x51, 0x54, 0xeb, 0x7c, 0x40, 0x51, 0x8e, 0xde, 0x58, 0x47, 0x53, 0xca, 0x65, 0xda, 0xd1, 0x51, + 0xa5, 0x57, 0xbf, 0xd6, 0xeb, 0xf0, 0xc6, 0xc6, 0x4f, 0x49, 0xcc, 0x2d, 0x35, 0x5a, 0x77, 0xb0, + 0xf4, 0xd5, 0x81, 0xc1, 0x44, 0xc7, 0x2f, 0x12, 0x82, 0x0d, 0x3d, 0x96, 0x0b, 0x16, 0x9d, 0xa2, + 0x5d, 0xc8, 0xf6, 0xcc, 0xb9, 0x59, 0x81, 0x1e, 0xc2, 0xae, 0x66, 0xb1, 0xa0, 0x64, 0x36, 0x5f, + 0xc8, 0xe8, 0xbd, 0x9e, 0x2d, 0x99, 0x20, 0x72, 0x69, 0x7d, 0xb9, 0x53, 0x94, 0x61, 0x47, 0x16, + 0x7a, 0x65, 0x11, 0x34, 0x86, 0x9b, 0x9c, 0x89, 0x59, 0xae, 0x4a, 0xa8, 0x2a, 0x24, 0x6e, 0x26, + 0xe1, 0x4c, 0x3c, 0xb7, 0xd8, 0x31, 0x55, 0x99, 0xa4, 0xf6, 0x2f, 0x7f, 0x82, 0xbd, 0x86, 0xb3, + 0x72, 0x9f, 0x36, 0x2f, 0xce, 0xff, 0x7b, 0xe9, 0xb7, 0x79, 0x19, 0x7d, 0xb4, 0xd7, 0xca, 0xe6, + 0x5f, 0xf0, 0x5a, 0xe8, 0x0e, 0xec, 0x08, 0xba, 0x9c, 0x95, 0xe9, 0x72, 0x2d, 0x7c, 0x5d, 0xd0, + 0xe5, 0xa4, 0x08, 0xd8, 0x5f, 0x0f, 0xda, 0x98, 0x7e, 0xfe, 0x41, 0x1f, 0x7d, 0x73, 0xc1, 0x9d, + 0xe8, 0x18, 0x31, 0x18, 0x34, 0xa3, 0xbf, 0x1f, 0x6c, 0x7f, 0x3e, 0xc1, 0x76, 0x90, 0xbd, 0xa0, + 0x1b, 0xaf, 0x34, 0xc3, 0x60, 0xd0, 0xcc, 0x74, 0xdb, 0xa8, 0x06, 0xaf, 0x75, 0x54, 0x5b, 0x90, + 0xdf, 0xc1, 0x4e, 0x2d, 0xaa, 0x77, 0x5b, 0xf4, 0x55, 0x92, 0x77, 0xd0, 0x81, 0x54, 0x5d, 0xa6, + 0x79, 0xf2, 0xfd, 0x7f, 0xea, 0xcf, 0x5f, 0xa6, 0xe5, 0x88, 0x47, 0xcf, 0x7e, 0xac, 0x7c, 0xe7, + 0x6c, 0xe5, 0x3b, 0xbf, 0x56, 0xbe, 0xf3, 0x65, 0xed, 0xf7, 0xce, 0xd6, 0x7e, 0xef, 0xe7, 0xda, + 0xef, 0xbd, 0x3d, 0x88, 0x99, 0x39, 0xf9, 0x30, 0x0f, 0x22, 0xc9, 0x43, 0xdb, 0xf3, 0x01, 0x93, + 0x21, 0x97, 0x44, 0x57, 0x1e, 0x46, 0x73, 0x9a, 0x50, 0x1d, 0xa6, 0xe3, 0xf9, 0x65, 0xfb, 0xdc, + 0x3d, 0xfe, 0x13, 0x00, 0x00, 0xff, 0xff, 0x1c, 0xe7, 0xfc, 0x87, 0x3b, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -541,8 +522,8 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // AddValidator adds a validator (restricted to admin). - AddValidator(ctx context.Context, in *MsgAddValidator, opts ...grpc.CallOption) (*MsgAddValidatorResponse, error) + // CreateValidator adds a validator (restricted to admin). + CreateValidator(ctx context.Context, in *MsgCreateValidator, opts ...grpc.CallOption) (*MsgCreateValidatorResponse, error) // RemoveValidator removes a validator (restricted to admin). RemoveValidator(ctx context.Context, in *MsgRemoveValidator, opts ...grpc.CallOption) (*MsgRemoveValidatorResponse, error) // UpdatePolicy updates the policy (restricted to admin). @@ -559,9 +540,9 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } -func (c *msgClient) AddValidator(ctx context.Context, in *MsgAddValidator, opts ...grpc.CallOption) (*MsgAddValidatorResponse, error) { - out := new(MsgAddValidatorResponse) - err := c.cc.Invoke(ctx, "/chora.validator.v1.Msg/AddValidator", in, out, opts...) +func (c *msgClient) CreateValidator(ctx context.Context, in *MsgCreateValidator, opts ...grpc.CallOption) (*MsgCreateValidatorResponse, error) { + out := new(MsgCreateValidatorResponse) + err := c.cc.Invoke(ctx, "/chora.validator.v1.Msg/CreateValidator", in, out, opts...) if err != nil { return nil, err } @@ -597,8 +578,8 @@ func (c *msgClient) UpdateValidator(ctx context.Context, in *MsgUpdateValidator, // MsgServer is the server API for Msg service. type MsgServer interface { - // AddValidator adds a validator (restricted to admin). - AddValidator(context.Context, *MsgAddValidator) (*MsgAddValidatorResponse, error) + // CreateValidator adds a validator (restricted to admin). + CreateValidator(context.Context, *MsgCreateValidator) (*MsgCreateValidatorResponse, error) // RemoveValidator removes a validator (restricted to admin). RemoveValidator(context.Context, *MsgRemoveValidator) (*MsgRemoveValidatorResponse, error) // UpdatePolicy updates the policy (restricted to admin). @@ -611,8 +592,8 @@ type MsgServer interface { type UnimplementedMsgServer struct { } -func (*UnimplementedMsgServer) AddValidator(ctx context.Context, req *MsgAddValidator) (*MsgAddValidatorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddValidator not implemented") +func (*UnimplementedMsgServer) CreateValidator(ctx context.Context, req *MsgCreateValidator) (*MsgCreateValidatorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateValidator not implemented") } func (*UnimplementedMsgServer) RemoveValidator(ctx context.Context, req *MsgRemoveValidator) (*MsgRemoveValidatorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveValidator not implemented") @@ -628,20 +609,20 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } -func _Msg_AddValidator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAddValidator) +func _Msg_CreateValidator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateValidator) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).AddValidator(ctx, in) + return srv.(MsgServer).CreateValidator(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/chora.validator.v1.Msg/AddValidator", + FullMethod: "/chora.validator.v1.Msg/CreateValidator", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AddValidator(ctx, req.(*MsgAddValidator)) + return srv.(MsgServer).CreateValidator(ctx, req.(*MsgCreateValidator)) } return interceptor(ctx, in, info, handler) } @@ -705,8 +686,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "AddValidator", - Handler: _Msg_AddValidator_Handler, + MethodName: "CreateValidator", + Handler: _Msg_CreateValidator_Handler, }, { MethodName: "RemoveValidator", @@ -725,7 +706,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "chora/validator/v1/msg.proto", } -func (m *MsgAddValidator) Marshal() (dAtA []byte, err error) { +func (m *MsgCreateValidator) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -735,12 +716,12 @@ func (m *MsgAddValidator) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgAddValidator) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgCreateValidator) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgAddValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgCreateValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -750,33 +731,19 @@ func (m *MsgAddValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Metadata) i = encodeVarintMsg(dAtA, i, uint64(len(m.Metadata))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x12 } if len(m.Operator) > 0 { i -= len(m.Operator) copy(dAtA[i:], m.Operator) i = encodeVarintMsg(dAtA, i, uint64(len(m.Operator))) i-- - dAtA[i] = 0x1a - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0x12 - } - if len(m.Admin) > 0 { - i -= len(m.Admin) - copy(dAtA[i:], m.Admin) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Admin))) - i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgAddValidatorResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgCreateValidatorResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -786,12 +753,12 @@ func (m *MsgAddValidatorResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgAddValidatorResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgCreateValidatorResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgAddValidatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgCreateValidatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -833,10 +800,10 @@ func (m *MsgRemoveValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.Admin) > 0 { - i -= len(m.Admin) - copy(dAtA[i:], m.Admin) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Admin))) + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintMsg(dAtA, i, uint64(len(m.Operator))) i-- dAtA[i] = 0xa } @@ -1031,20 +998,12 @@ func encodeVarintMsg(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgAddValidator) Size() (n int) { +func (m *MsgCreateValidator) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Admin) - if l > 0 { - n += 1 + l + sovMsg(uint64(l)) - } - l = len(m.Address) - if l > 0 { - n += 1 + l + sovMsg(uint64(l)) - } l = len(m.Operator) if l > 0 { n += 1 + l + sovMsg(uint64(l)) @@ -1056,7 +1015,7 @@ func (m *MsgAddValidator) Size() (n int) { return n } -func (m *MsgAddValidatorResponse) Size() (n int) { +func (m *MsgCreateValidatorResponse) Size() (n int) { if m == nil { return 0 } @@ -1075,7 +1034,7 @@ func (m *MsgRemoveValidator) Size() (n int) { } var l int _ = l - l = len(m.Admin) + l = len(m.Operator) if l > 0 { n += 1 + l + sovMsg(uint64(l)) } @@ -1173,7 +1132,7 @@ func sovMsg(x uint64) (n int) { func sozMsg(x uint64) (n int) { return sovMsg(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgAddValidator) Unmarshal(dAtA []byte) error { +func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1196,77 +1155,13 @@ func (m *MsgAddValidator) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgAddValidator: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateValidator: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAddValidator: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateValidator: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMsg - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMsg - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMsg - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Admin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMsg - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMsg - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMsg - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) } @@ -1298,7 +1193,7 @@ func (m *MsgAddValidator) Unmarshal(dAtA []byte) error { } m.Operator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } @@ -1351,7 +1246,7 @@ func (m *MsgAddValidator) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgAddValidatorResponse) Unmarshal(dAtA []byte) error { +func (m *MsgCreateValidatorResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1374,10 +1269,10 @@ func (m *MsgAddValidatorResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgAddValidatorResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateValidatorResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAddValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1464,7 +1359,7 @@ func (m *MsgRemoveValidator) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1492,7 +1387,7 @@ func (m *MsgRemoveValidator) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Admin = string(dAtA[iNdEx:postIndex]) + m.Operator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { diff --git a/validator/types/v1/msg_add_validator.feature b/validator/types/v1/msg_add_validator.feature deleted file mode 100644 index 63cd0b9..0000000 --- a/validator/types/v1/msg_add_validator.feature +++ /dev/null @@ -1,93 +0,0 @@ -Feature: MsgAddValidator - - Scenario: valid message - Given message - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", - "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" - } - """ - When validate message - Then expect no error - - Scenario: an error is returned if admin is empty - Given message - """ - {} - """ - When validate message - Then expect the error - """ - admin: empty address string is not allowed: invalid address - """ - - Scenario: an error is returned if admin is not a bech32 address - Given message - """ - { - "admin": "foo" - } - """ - When validate message - Then expect the error - """ - admin: decoding bech32 failed: invalid bech32 string length 3: invalid address - """ - - Scenario: an error is returned if address is empty - Given message - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - } - """ - When validate message - Then expect the error - """ - address: empty address string is not allowed: invalid address - """ - - Scenario: an error is returned if address is not a bech32 address - Given message - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "foo" - } - """ - When validate message - Then expect the error - """ - address: decoding bech32 failed: invalid bech32 string length 3: invalid address - """ - - Scenario: an error is returned if metadata is empty - Given message - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - } - """ - When validate message - Then expect the error - """ - metadata: empty string is not allowed: invalid request - """ - - Scenario: an error is returned if metadata exceeds 128 characters - Given message - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - } - """ - And metadata with length "129" - When validate message - Then expect the error - """ - metadata: exceeds max length 128: invalid request - """ diff --git a/validator/types/v1/msg_add_validator.go b/validator/types/v1/msg_add_validator.go deleted file mode 100644 index ac16605..0000000 --- a/validator/types/v1/msg_add_validator.go +++ /dev/null @@ -1,45 +0,0 @@ -package v1 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -var _ sdk.Msg = &MsgAddValidator{} - -// ValidateBasic performs stateless validation on MsgAddValidator. -func (m MsgAddValidator) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(m.Admin); err != nil { - return sdkerrors.ErrInvalidAddress.Wrapf("admin: %s", err) - } - - if _, err := sdk.AccAddressFromBech32(m.Address); err != nil { - return sdkerrors.ErrInvalidAddress.Wrapf("address: %s", err) - } - - if m.Metadata == "" { - return sdkerrors.ErrInvalidRequest.Wrap("metadata: empty string is not allowed") - } - - if len(m.Metadata) > MetadataMaxLength { - return sdkerrors.ErrInvalidRequest.Wrapf("metadata: exceeds max length %d", MetadataMaxLength) - } - - return nil -} - -// GetSigners returns the expected signers for MsgAddValidator. -func (m MsgAddValidator) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(m.Admin) - return []sdk.AccAddress{addr} -} - -// Route implements the LegacyMsg interface. -func (m MsgAddValidator) Route() string { - return sdk.MsgTypeURL(&m) -} - -// Type implements the LegacyMsg interface. -func (m MsgAddValidator) Type() string { - return sdk.MsgTypeURL(&m) -} diff --git a/validator/types/v1/msg_add_validator_test.go b/validator/types/v1/msg_add_validator_test.go deleted file mode 100644 index 81e413a..0000000 --- a/validator/types/v1/msg_add_validator_test.go +++ /dev/null @@ -1,52 +0,0 @@ -package v1 - -import ( - "strconv" - "strings" - "testing" - - "github.com/cosmos/gogoproto/jsonpb" - "github.com/regen-network/gocuke" - "github.com/stretchr/testify/require" -) - -type msgAddValidator struct { - t gocuke.TestingT - msg *MsgAddValidator - err error -} - -func TestMsgAddValidator(t *testing.T) { - gocuke.NewRunner(t, &msgAddValidator{}). - Path("./msg_add_validator.feature"). - Run() -} - -func (s *msgAddValidator) Before(t gocuke.TestingT) { - s.t = t -} - -func (s *msgAddValidator) Message(a gocuke.DocString) { - s.msg = &MsgAddValidator{} - err := jsonpb.UnmarshalString(a.Content, s.msg) - require.NoError(s.t, err) -} - -func (s *msgAddValidator) MetadataWithLength(a string) { - length, err := strconv.ParseInt(a, 10, 64) - require.NoError(s.t, err) - - s.msg.Metadata = strings.Repeat("x", int(length)) -} - -func (s *msgAddValidator) ValidateMessage() { - s.err = s.msg.ValidateBasic() -} - -func (s *msgAddValidator) ExpectNoError() { - require.NoError(s.t, s.err) -} - -func (s *msgAddValidator) ExpectTheError(a gocuke.DocString) { - require.EqualError(s.t, s.err, a.Content) -} diff --git a/validator/types/v1/msg_create_validator.feature b/validator/types/v1/msg_create_validator.feature new file mode 100644 index 0000000..7141dfb --- /dev/null +++ b/validator/types/v1/msg_create_validator.feature @@ -0,0 +1,63 @@ +Feature: MsgCreateValidator + + Scenario: valid message + Given message + """ + { + "operator": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + When validate message + Then expect no error + + Scenario: an error is returned if admin is empty + Given message + """ + {} + """ + When validate message + Then expect the error + """ + operator: empty address string is not allowed: invalid address + """ + + Scenario: an error is returned if admin is not a bech32 address + Given message + """ + { + "operator": "foo" + } + """ + When validate message + Then expect the error + """ + operator: decoding bech32 failed: invalid bech32 string length 3: invalid address + """ + + Scenario: an error is returned if metadata is empty + Given message + """ + { + "operator": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" + } + """ + When validate message + Then expect the error + """ + metadata: empty string is not allowed: invalid request + """ + + Scenario: an error is returned if metadata exceeds 128 characters + Given message + """ + { + "operator": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" + } + """ + And metadata with length "129" + When validate message + Then expect the error + """ + metadata: exceeds max length 128: invalid request + """ diff --git a/validator/types/v1/msg_create_validator.go b/validator/types/v1/msg_create_validator.go new file mode 100644 index 0000000..e51afb5 --- /dev/null +++ b/validator/types/v1/msg_create_validator.go @@ -0,0 +1,41 @@ +package v1 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgCreateValidator{} + +// ValidateBasic performs stateless validation on MsgCreateValidator. +func (m MsgCreateValidator) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Operator); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("operator: %s", err) + } + + if m.Metadata == "" { + return sdkerrors.ErrInvalidRequest.Wrap("metadata: empty string is not allowed") + } + + if len(m.Metadata) > MetadataMaxLength { + return sdkerrors.ErrInvalidRequest.Wrapf("metadata: exceeds max length %d", MetadataMaxLength) + } + + return nil +} + +// GetSigners returns the expected signers for MsgCreateValidator. +func (m MsgCreateValidator) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(m.Operator) + return []sdk.AccAddress{addr} +} + +// Route implements the LegacyMsg interface. +func (m MsgCreateValidator) Route() string { + return sdk.MsgTypeURL(&m) +} + +// Type implements the LegacyMsg interface. +func (m MsgCreateValidator) Type() string { + return sdk.MsgTypeURL(&m) +} diff --git a/validator/types/v1/msg_create_validator_test.go b/validator/types/v1/msg_create_validator_test.go new file mode 100644 index 0000000..fe7731e --- /dev/null +++ b/validator/types/v1/msg_create_validator_test.go @@ -0,0 +1,52 @@ +package v1 + +import ( + "strconv" + "strings" + "testing" + + "github.com/cosmos/gogoproto/jsonpb" + "github.com/regen-network/gocuke" + "github.com/stretchr/testify/require" +) + +type msgCreateValidator struct { + t gocuke.TestingT + msg *MsgCreateValidator + err error +} + +func TestMsgCreateValidator(t *testing.T) { + gocuke.NewRunner(t, &msgCreateValidator{}). + Path("./msg_create_validator.feature"). + Run() +} + +func (s *msgCreateValidator) Before(t gocuke.TestingT) { + s.t = t +} + +func (s *msgCreateValidator) Message(a gocuke.DocString) { + s.msg = &MsgCreateValidator{} + err := jsonpb.UnmarshalString(a.Content, s.msg) + require.NoError(s.t, err) +} + +func (s *msgCreateValidator) MetadataWithLength(a string) { + length, err := strconv.ParseInt(a, 10, 64) + require.NoError(s.t, err) + + s.msg.Metadata = strings.Repeat("x", int(length)) +} + +func (s *msgCreateValidator) ValidateMessage() { + s.err = s.msg.ValidateBasic() +} + +func (s *msgCreateValidator) ExpectNoError() { + require.NoError(s.t, s.err) +} + +func (s *msgCreateValidator) ExpectTheError(a gocuke.DocString) { + require.EqualError(s.t, s.err, a.Content) +} diff --git a/validator/types/v1/msg_remove_validator.feature b/validator/types/v1/msg_remove_validator.feature index 645308d..e28249e 100644 --- a/validator/types/v1/msg_remove_validator.feature +++ b/validator/types/v1/msg_remove_validator.feature @@ -4,14 +4,14 @@ Feature: MsgRemoveValidator Given message """ { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "operator": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" } """ When validate message Then expect no error - Scenario: an error is returned if admin is empty + Scenario: an error is returned if operator is empty Given message """ {} @@ -19,27 +19,27 @@ Feature: MsgRemoveValidator When validate message Then expect the error """ - admin: empty address string is not allowed: invalid address + operator: empty address string is not allowed: invalid address """ - Scenario: an error is returned if admin is not a bech32 address + Scenario: an error is returned if operator is not a bech32 address Given message """ { - "admin": "foo" + "operator": "foo" } """ When validate message Then expect the error """ - admin: decoding bech32 failed: invalid bech32 string length 3: invalid address + operator: decoding bech32 failed: invalid bech32 string length 3: invalid address """ Scenario: an error is returned if address is empty Given message """ { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" + "operator": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" } """ When validate message @@ -52,7 +52,7 @@ Feature: MsgRemoveValidator Given message """ { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "operator": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", "address": "foo" } """ diff --git a/validator/types/v1/msg_remove_validator.go b/validator/types/v1/msg_remove_validator.go index 07194fe..0dfb898 100644 --- a/validator/types/v1/msg_remove_validator.go +++ b/validator/types/v1/msg_remove_validator.go @@ -9,8 +9,8 @@ var _ sdk.Msg = &MsgRemoveValidator{} // ValidateBasic performs stateless validation on MsgRemoveValidator. func (m MsgRemoveValidator) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(m.Admin); err != nil { - return sdkerrors.ErrInvalidAddress.Wrapf("admin: %s", err) + if _, err := sdk.AccAddressFromBech32(m.Operator); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("operator: %s", err) } if _, err := sdk.AccAddressFromBech32(m.Address); err != nil { @@ -22,7 +22,7 @@ func (m MsgRemoveValidator) ValidateBasic() error { // GetSigners returns the expected signers for MsgRemoveValidator. func (m MsgRemoveValidator) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(m.Admin) + addr, _ := sdk.AccAddressFromBech32(m.Operator) return []sdk.AccAddress{addr} }