From 57a1b59455a4f627c115933cf805f47f9fc98eab Mon Sep 17 00:00:00 2001 From: ryanchristo <12519942+ryanchristo@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:06:33 -0700 Subject: [PATCH] refactor: consistent module service methods --- .../cmd/{tx_update.go => tx_update_admin.go} | 0 admin/proto/buf.lock | 4 +- agent/proto/buf.lock | 4 +- content/proto/v1/events.proto | 6 +- content/proto/v1/msg.proto | 12 +- governor/api/v1/events.pulsar.go | 973 ++------ governor/api/v1/msg.pulsar.go | 2204 +++++------------ governor/api/v1/msg_grpc.pb.go | 142 +- governor/api/v1/state.cosmos_orm.go | 26 +- governor/api/v1/state.pulsar.go | 112 +- governor/cmd/tx.go | 2 +- ..._add_governor.go => tx_create_governor.go} | 15 +- governor/cmd/tx_remove_governor.go | 7 +- ...rnor.go => tx_update_governor_metadata.go} | 4 +- governor/genesis/genesis.go | 2 +- governor/genesis/genesis_test.go | 2 +- .../keeper/features/msg_add_governor.feature | 106 - .../features/msg_remove_governor.feature | 235 -- governor/keeper/keeper.go | 98 - governor/keeper/msg_add_governor.go | 52 - governor/keeper/msg_create_governor.feature | 82 + governor/keeper/msg_create_governor.go | 41 + ...or_test.go => msg_create_governor_test.go} | 34 +- governor/keeper/msg_remove_governor.feature | 150 ++ governor/keeper/msg_remove_governor.go | 28 +- governor/keeper/msg_remove_governor_test.go | 23 +- ...e => msg_update_governor_metadata.feature} | 64 +- ...nor.go => msg_update_governor_metadata.go} | 16 +- ...o => msg_update_governor_metadata_test.go} | 34 +- governor/keeper/msg_update_policy.go | 54 - governor/keeper/msg_update_policy_test.go | 89 - .../{features => }/query_governor.feature | 30 +- governor/keeper/query_governor.go | 11 +- governor/keeper/query_governor_test.go | 2 +- .../{features => }/query_governors.feature | 38 +- governor/keeper/query_governors.go | 6 +- governor/keeper/query_governors_test.go | 2 +- governor/keeper/query_policy.go | 23 - governor/keeper/query_policy_test.go | 61 - governor/module/autocli.go | 4 +- governor/proto/buf.lock | 4 +- governor/proto/v1/events.proto | 19 +- governor/proto/v1/msg.proto | 86 +- governor/proto/v1/state.proto | 8 +- governor/types/v1/codec.go | 14 +- governor/types/v1/events.pb.go | 342 +-- .../v1/features/msg_remove_governor.feature | 63 - governor/types/v1/msg.pb.go | 935 +++---- governor/types/v1/msg_add_validator_test.go | 52 - ...or.feature => msg_create_governor.feature} | 34 +- ...dd_validator.go => msg_create_governor.go} | 20 +- governor/types/v1/msg_create_governor_test.go | 52 + governor/types/v1/msg_remove_governor.feature | 35 + governor/types/v1/msg_remove_governor.go | 33 + governor/types/v1/msg_remove_governor_test.go | 43 + governor/types/v1/msg_remove_validator.go | 37 - .../types/v1/msg_remove_validator_test.go | 43 - ...e => msg_update_governor_metadata.feature} | 2 +- ...tor.go => msg_update_governor_metadata.go} | 14 +- .../v1/msg_update_governor_metadata_test.go | 52 + .../types/v1/msg_update_max_missed_blocks.go | 33 - .../v1/msg_update_max_missed_blocks_test.go | 43 - .../types/v1/msg_update_validator_test.go | 52 - governor/types/v1/state.pb.go | 57 +- .../v1/{features => }/state_governor.feature | 24 +- .../{state_validator.go => state_governor.go} | 2 +- .../types/v1/state_validator_signing_info.go | 16 - .../v1/state_validator_signing_info_test.go | 43 - governor/types/v1/state_validator_test.go | 52 - .../keeper/features/msg_update_policy.feature | 127 - .../keeper/features/query_policy.feature | 59 - .../{features => }/msg_add_validator.feature | 0 validator/keeper/msg_add_validator_test.go | 2 +- .../msg_remove_validator.feature | 0 validator/keeper/msg_remove_validator_test.go | 2 +- .../keeper}/msg_update_policy.feature | 0 validator/keeper/msg_update_policy_test.go | 2 +- .../msg_update_validator.feature | 0 validator/keeper/msg_update_validator_test.go | 2 +- .../keeper}/query_policy.feature | 0 validator/keeper/query_policy_test.go | 2 +- .../{features => }/query_validator.feature | 0 validator/keeper/query_validator_test.go | 2 +- .../{features => }/query_validators.feature | 0 validator/keeper/query_validators_test.go | 2 +- validator/proto/buf.lock | 4 +- .../msg_update_max_missed_blocks.feature | 47 - .../state_validator_signing_info.feature | 46 - .../{features => }/msg_add_validator.feature | 0 validator/types/v1/msg_add_validator_test.go | 2 +- .../msg_remove_validator.feature | 0 .../types/v1/msg_remove_validator_test.go | 2 +- .../v1}/msg_update_max_missed_blocks.feature | 0 .../v1/msg_update_max_missed_blocks_test.go | 2 +- .../msg_update_validator.feature | 0 .../types/v1/msg_update_validator_test.go | 2 +- .../v1/{features => }/state_validator.feature | 0 .../v1}/state_validator_signing_info.feature | 0 .../v1/state_validator_signing_info_test.go | 2 +- validator/types/v1/state_validator_test.go | 2 +- .../keeper/{features => }/msg_create.feature | 0 voucher/keeper/msg_create_test.go | 2 +- .../keeper/{features => }/msg_issue.feature | 0 voucher/keeper/msg_issue_test.go | 2 +- .../{features => }/msg_update_issuer.feature | 0 voucher/keeper/msg_update_issuer_test.go | 2 +- .../msg_update_metadata.feature | 0 voucher/keeper/msg_update_metadata_test.go | 2 +- .../{features => }/query_balance.feature | 0 voucher/keeper/query_balance_test.go | 2 +- .../query_balances_by_address.feature | 0 .../keeper/query_balances_by_address_test.go | 2 +- .../query_balances_by_voucher.feature | 0 .../keeper/query_balances_by_voucher_test.go | 2 +- .../{features => }/query_voucher.feature | 0 voucher/keeper/query_voucher_test.go | 2 +- .../{features => }/query_vouchers.feature | 0 .../query_vouchers_by_issuer.feature | 0 .../keeper/query_vouchers_by_issuer_test.go | 2 +- voucher/keeper/query_vouchers_test.go | 2 +- voucher/proto/buf.lock | 4 +- .../v1/{features => }/msg_create.feature | 0 voucher/types/v1/msg_create_test.go | 2 +- .../types/v1/{features => }/msg_issue.feature | 0 voucher/types/v1/msg_issue_test.go | 2 +- .../{features => }/msg_update_issuer.feature | 0 voucher/types/v1/msg_update_issuer_test.go | 2 +- .../msg_update_metadata.feature | 0 voucher/types/v1/msg_update_metadata_test.go | 2 +- .../v1/{features => }/state_balance.feature | 0 voucher/types/v1/state_balance_test.go | 2 +- .../v1/{features => }/state_voucher.feature | 0 voucher/types/v1/state_voucher_test.go | 2 +- 133 files changed, 2167 insertions(+), 5186 deletions(-) rename admin/cmd/{tx_update.go => tx_update_admin.go} (100%) rename governor/cmd/{tx_add_governor.go => tx_create_governor.go} (67%) rename governor/cmd/{tx_update_governor.go => tx_update_governor_metadata.go} (90%) delete mode 100644 governor/keeper/features/msg_add_governor.feature delete mode 100644 governor/keeper/features/msg_remove_governor.feature delete mode 100644 governor/keeper/msg_add_governor.go create mode 100644 governor/keeper/msg_create_governor.feature create mode 100644 governor/keeper/msg_create_governor.go rename governor/keeper/{msg_add_governor_test.go => msg_create_governor_test.go} (60%) create mode 100644 governor/keeper/msg_remove_governor.feature rename governor/keeper/{features/msg_update_governor.feature => msg_update_governor_metadata.feature} (62%) rename governor/keeper/{msg_update_governor.go => msg_update_governor_metadata.go} (65%) rename governor/keeper/{msg_update_governor_test.go => msg_update_governor_metadata_test.go} (59%) delete mode 100644 governor/keeper/msg_update_policy.go delete mode 100644 governor/keeper/msg_update_policy_test.go rename governor/keeper/{features => }/query_governor.feature (64%) rename governor/keeper/{features => }/query_governors.feature (70%) delete mode 100644 governor/keeper/query_policy.go delete mode 100644 governor/keeper/query_policy_test.go delete mode 100644 governor/types/v1/features/msg_remove_governor.feature delete mode 100644 governor/types/v1/msg_add_validator_test.go rename governor/types/v1/{features/msg_add_governor.feature => msg_create_governor.feature} (62%) rename governor/types/v1/{msg_add_validator.go => msg_create_governor.go} (57%) create mode 100644 governor/types/v1/msg_create_governor_test.go create mode 100644 governor/types/v1/msg_remove_governor.feature create mode 100644 governor/types/v1/msg_remove_governor.go create mode 100644 governor/types/v1/msg_remove_governor_test.go delete mode 100644 governor/types/v1/msg_remove_validator.go delete mode 100644 governor/types/v1/msg_remove_validator_test.go rename governor/types/v1/{features/msg_update_governor.feature => msg_update_governor_metadata.feature} (97%) rename governor/types/v1/{msg_update_validator.go => msg_update_governor_metadata.go} (64%) create mode 100644 governor/types/v1/msg_update_governor_metadata_test.go delete mode 100644 governor/types/v1/msg_update_max_missed_blocks.go delete mode 100644 governor/types/v1/msg_update_max_missed_blocks_test.go delete mode 100644 governor/types/v1/msg_update_validator_test.go rename governor/types/v1/{features => }/state_governor.feature (80%) rename governor/types/v1/{state_validator.go => state_governor.go} (84%) delete mode 100644 governor/types/v1/state_validator_signing_info.go delete mode 100644 governor/types/v1/state_validator_signing_info_test.go delete mode 100644 governor/types/v1/state_validator_test.go delete mode 100644 validator/keeper/features/msg_update_policy.feature delete mode 100644 validator/keeper/features/query_policy.feature rename validator/keeper/{features => }/msg_add_validator.feature (100%) rename validator/keeper/{features => }/msg_remove_validator.feature (100%) rename {governor/keeper/features => validator/keeper}/msg_update_policy.feature (100%) rename validator/keeper/{features => }/msg_update_validator.feature (100%) rename {governor/keeper/features => validator/keeper}/query_policy.feature (100%) rename validator/keeper/{features => }/query_validator.feature (100%) rename validator/keeper/{features => }/query_validators.feature (100%) delete mode 100644 validator/types/v1/features/msg_update_max_missed_blocks.feature delete mode 100644 validator/types/v1/features/state_validator_signing_info.feature rename validator/types/v1/{features => }/msg_add_validator.feature (100%) rename validator/types/v1/{features => }/msg_remove_validator.feature (100%) rename {governor/types/v1/features => validator/types/v1}/msg_update_max_missed_blocks.feature (100%) rename validator/types/v1/{features => }/msg_update_validator.feature (100%) rename validator/types/v1/{features => }/state_validator.feature (100%) rename {governor/types/v1/features => validator/types/v1}/state_validator_signing_info.feature (100%) rename voucher/keeper/{features => }/msg_create.feature (100%) rename voucher/keeper/{features => }/msg_issue.feature (100%) rename voucher/keeper/{features => }/msg_update_issuer.feature (100%) rename voucher/keeper/{features => }/msg_update_metadata.feature (100%) rename voucher/keeper/{features => }/query_balance.feature (100%) rename voucher/keeper/{features => }/query_balances_by_address.feature (100%) rename voucher/keeper/{features => }/query_balances_by_voucher.feature (100%) rename voucher/keeper/{features => }/query_voucher.feature (100%) rename voucher/keeper/{features => }/query_vouchers.feature (100%) rename voucher/keeper/{features => }/query_vouchers_by_issuer.feature (100%) rename voucher/types/v1/{features => }/msg_create.feature (100%) rename voucher/types/v1/{features => }/msg_issue.feature (100%) rename voucher/types/v1/{features => }/msg_update_issuer.feature (100%) rename voucher/types/v1/{features => }/msg_update_metadata.feature (100%) rename voucher/types/v1/{features => }/state_balance.feature (100%) rename voucher/types/v1/{features => }/state_voucher.feature (100%) diff --git a/admin/cmd/tx_update.go b/admin/cmd/tx_update_admin.go similarity index 100% rename from admin/cmd/tx_update.go rename to admin/cmd/tx_update_admin.go diff --git a/admin/proto/buf.lock b/admin/proto/buf.lock index 32d358a..360f94c 100644 --- a/admin/proto/buf.lock +++ b/admin/proto/buf.lock @@ -19,8 +19,8 @@ deps: - remote: buf.build owner: googleapis repository: googleapis - commit: 8bc2c51e08c447cd8886cdea48a73e14 - digest: shake256:a969155953a5cedc5b2df5b42c368f2bc66ff8ce1804bc96e0f14ff2ee8a893687963058909df844d1643cdbc98ff099d2daa6bc9f9f5b8886c49afdc60e19af + commit: e7f8d366f5264595bcc4cd4139af9973 + digest: shake256:e5e5f1c12f82e028ea696faa43b4f9dc6258a6d1226282962a8c8b282e10946281d815884f574bd279ebd9cd7588629beb3db17b892af6c33b56f92f8f67f509 - remote: buf.build owner: protocolbuffers repository: wellknowntypes diff --git a/agent/proto/buf.lock b/agent/proto/buf.lock index 32d358a..360f94c 100644 --- a/agent/proto/buf.lock +++ b/agent/proto/buf.lock @@ -19,8 +19,8 @@ deps: - remote: buf.build owner: googleapis repository: googleapis - commit: 8bc2c51e08c447cd8886cdea48a73e14 - digest: shake256:a969155953a5cedc5b2df5b42c368f2bc66ff8ce1804bc96e0f14ff2ee8a893687963058909df844d1643cdbc98ff099d2daa6bc9f9f5b8886c49afdc60e19af + commit: e7f8d366f5264595bcc4cd4139af9973 + digest: shake256:e5e5f1c12f82e028ea696faa43b4f9dc6258a6d1226282962a8c8b282e10946281d815884f574bd279ebd9cd7588629beb3db17b892af6c33b56f92f8f67f509 - remote: buf.build owner: protocolbuffers repository: wellknowntypes diff --git a/content/proto/v1/events.proto b/content/proto/v1/events.proto index 3268bb1..8dfaa38 100644 --- a/content/proto/v1/events.proto +++ b/content/proto/v1/events.proto @@ -18,14 +18,16 @@ message EventRemoveContent { uint64 id = 1; } -// EventUpdateContentCurator is an event emitted when content curator is updated. +// EventUpdateContentCurator is an event emitted when content curator is +// updated. message EventUpdateContentCurator { // id is the unique identifier of the content. uint64 id = 1; } -// EventUpdateContentMetadata is an event emitted when content metadata is updated. +// EventUpdateContentMetadata is an event emitted when content metadata is +// updated. message EventUpdateContentMetadata { // id is the unique identifier of the content. diff --git a/content/proto/v1/msg.proto b/content/proto/v1/msg.proto index 0e06b9b..97f95d1 100644 --- a/content/proto/v1/msg.proto +++ b/content/proto/v1/msg.proto @@ -16,10 +16,12 @@ service Msg { rpc RemoveContent(MsgRemoveContent) returns (MsgRemoveContentResponse); // UpdateContentCurator updates the curator of content. - rpc UpdateContentCurator(MsgUpdateContentCurator) returns (MsgUpdateContentCuratorResponse); + rpc UpdateContentCurator(MsgUpdateContentCurator) + returns (MsgUpdateContentCuratorResponse); // UpdateContentMetadata updates the metadata of content. - rpc UpdateContentMetadata(MsgUpdateContentMetadata) returns (MsgUpdateContentMetadataResponse); + rpc UpdateContentMetadata(MsgUpdateContentMetadata) + returns (MsgUpdateContentMetadataResponse); } // MsgCreateContent is the Msg/CreateContent request type. @@ -72,7 +74,8 @@ message MsgUpdateContentCurator { string new_curator = 3; } -// MsgUpdateContentCuratorResponse is the Msg/UpdateContentCurator response type. +// MsgUpdateContentCuratorResponse is the Msg/UpdateContentCurator response +// type. message MsgUpdateContentCuratorResponse { // id is the unique identifier of the content. @@ -93,7 +96,8 @@ message MsgUpdateContentMetadata { string new_metadata = 3; } -// MsgUpdateContentMetadataResponse is the Msg/UpdateContentMetadata response type. +// MsgUpdateContentMetadataResponse is the Msg/UpdateContentMetadata response +// type. message MsgUpdateContentMetadataResponse { // id is the unique identifier of the content. diff --git a/governor/api/v1/events.pulsar.go b/governor/api/v1/events.pulsar.go index de70e91..87ef316 100644 --- a/governor/api/v1/events.pulsar.go +++ b/governor/api/v1/events.pulsar.go @@ -13,25 +13,25 @@ import ( ) var ( - md_EventRegister protoreflect.MessageDescriptor - fd_EventRegister_address protoreflect.FieldDescriptor + md_EventCreateGovernor protoreflect.MessageDescriptor + fd_EventCreateGovernor_address protoreflect.FieldDescriptor ) func init() { file_chora_governor_v1_events_proto_init() - md_EventRegister = File_chora_governor_v1_events_proto.Messages().ByName("EventRegister") - fd_EventRegister_address = md_EventRegister.Fields().ByName("address") + md_EventCreateGovernor = File_chora_governor_v1_events_proto.Messages().ByName("EventCreateGovernor") + fd_EventCreateGovernor_address = md_EventCreateGovernor.Fields().ByName("address") } -var _ protoreflect.Message = (*fastReflection_EventRegister)(nil) +var _ protoreflect.Message = (*fastReflection_EventCreateGovernor)(nil) -type fastReflection_EventRegister EventRegister +type fastReflection_EventCreateGovernor EventCreateGovernor -func (x *EventRegister) ProtoReflect() protoreflect.Message { - return (*fastReflection_EventRegister)(x) +func (x *EventCreateGovernor) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventCreateGovernor)(x) } -func (x *EventRegister) slowProtoReflect() protoreflect.Message { +func (x *EventCreateGovernor) slowProtoReflect() protoreflect.Message { mi := &file_chora_governor_v1_events_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -43,43 +43,43 @@ func (x *EventRegister) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_EventRegister_messageType fastReflection_EventRegister_messageType -var _ protoreflect.MessageType = fastReflection_EventRegister_messageType{} +var _fastReflection_EventCreateGovernor_messageType fastReflection_EventCreateGovernor_messageType +var _ protoreflect.MessageType = fastReflection_EventCreateGovernor_messageType{} -type fastReflection_EventRegister_messageType struct{} +type fastReflection_EventCreateGovernor_messageType struct{} -func (x fastReflection_EventRegister_messageType) Zero() protoreflect.Message { - return (*fastReflection_EventRegister)(nil) +func (x fastReflection_EventCreateGovernor_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventCreateGovernor)(nil) } -func (x fastReflection_EventRegister_messageType) New() protoreflect.Message { - return new(fastReflection_EventRegister) +func (x fastReflection_EventCreateGovernor_messageType) New() protoreflect.Message { + return new(fastReflection_EventCreateGovernor) } -func (x fastReflection_EventRegister_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_EventRegister +func (x fastReflection_EventCreateGovernor_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventCreateGovernor } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_EventRegister) Descriptor() protoreflect.MessageDescriptor { - return md_EventRegister +func (x *fastReflection_EventCreateGovernor) Descriptor() protoreflect.MessageDescriptor { + return md_EventCreateGovernor } // 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_EventRegister) Type() protoreflect.MessageType { - return _fastReflection_EventRegister_messageType +func (x *fastReflection_EventCreateGovernor) Type() protoreflect.MessageType { + return _fastReflection_EventCreateGovernor_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_EventRegister) New() protoreflect.Message { - return new(fastReflection_EventRegister) +func (x *fastReflection_EventCreateGovernor) New() protoreflect.Message { + return new(fastReflection_EventCreateGovernor) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_EventRegister) Interface() protoreflect.ProtoMessage { - return (*EventRegister)(x) +func (x *fastReflection_EventCreateGovernor) Interface() protoreflect.ProtoMessage { + return (*EventCreateGovernor)(x) } // Range iterates over every populated field in an undefined order, @@ -87,10 +87,10 @@ func (x *fastReflection_EventRegister) 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_EventRegister) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_EventCreateGovernor) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Address != "" { value := protoreflect.ValueOfString(x.Address) - if !f(fd_EventRegister_address, value) { + if !f(fd_EventCreateGovernor_address, value) { return } } @@ -107,15 +107,15 @@ func (x *fastReflection_EventRegister) Range(f func(protoreflect.FieldDescriptor // 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_EventRegister) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_EventCreateGovernor) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "chora.governor.v1.EventRegister.address": + case "chora.governor.v1.EventCreateGovernor.address": return x.Address != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRegister")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventCreateGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.EventRegister does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventCreateGovernor does not contain field %s", fd.FullName())) } } @@ -125,15 +125,15 @@ func (x *fastReflection_EventRegister) Has(fd protoreflect.FieldDescriptor) bool // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventRegister) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_EventCreateGovernor) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "chora.governor.v1.EventRegister.address": + case "chora.governor.v1.EventCreateGovernor.address": x.Address = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRegister")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventCreateGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.EventRegister does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventCreateGovernor does not contain field %s", fd.FullName())) } } @@ -143,16 +143,16 @@ func (x *fastReflection_EventRegister) 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_EventRegister) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventCreateGovernor) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "chora.governor.v1.EventRegister.address": + case "chora.governor.v1.EventCreateGovernor.address": value := x.Address return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRegister")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventCreateGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.EventRegister does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventCreateGovernor does not contain field %s", descriptor.FullName())) } } @@ -166,15 +166,15 @@ func (x *fastReflection_EventRegister) Get(descriptor protoreflect.FieldDescript // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventRegister) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_EventCreateGovernor) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "chora.governor.v1.EventRegister.address": + case "chora.governor.v1.EventCreateGovernor.address": x.Address = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRegister")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventCreateGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.EventRegister does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventCreateGovernor does not contain field %s", fd.FullName())) } } @@ -188,40 +188,40 @@ func (x *fastReflection_EventRegister) Set(fd protoreflect.FieldDescriptor, valu // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventRegister) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventCreateGovernor) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.EventRegister.address": - panic(fmt.Errorf("field address of message chora.governor.v1.EventRegister is not mutable")) + case "chora.governor.v1.EventCreateGovernor.address": + panic(fmt.Errorf("field address of message chora.governor.v1.EventCreateGovernor is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRegister")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventCreateGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.EventRegister does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventCreateGovernor 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_EventRegister) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventCreateGovernor) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.EventRegister.address": + case "chora.governor.v1.EventCreateGovernor.address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRegister")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventCreateGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.EventRegister does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventCreateGovernor 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_EventRegister) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_EventCreateGovernor) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.EventRegister", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.EventCreateGovernor", d.FullName())) } panic("unreachable") } @@ -229,7 +229,7 @@ func (x *fastReflection_EventRegister) WhichOneof(d protoreflect.OneofDescriptor // 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_EventRegister) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_EventCreateGovernor) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -240,7 +240,7 @@ func (x *fastReflection_EventRegister) 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_EventRegister) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_EventCreateGovernor) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -252,7 +252,7 @@ func (x *fastReflection_EventRegister) SetUnknown(fields protoreflect.RawFields) // 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_EventRegister) IsValid() bool { +func (x *fastReflection_EventCreateGovernor) IsValid() bool { return x != nil } @@ -262,9 +262,9 @@ func (x *fastReflection_EventRegister) 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_EventRegister) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_EventCreateGovernor) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*EventRegister) + x := input.Message.Interface().(*EventCreateGovernor) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -290,7 +290,7 @@ func (x *fastReflection_EventRegister) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*EventRegister) + x := input.Message.Interface().(*EventCreateGovernor) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -327,7 +327,7 @@ func (x *fastReflection_EventRegister) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*EventRegister) + x := input.Message.Interface().(*EventCreateGovernor) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -359,10 +359,10 @@ func (x *fastReflection_EventRegister) 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: EventRegister: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventCreateGovernor: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventRegister: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventCreateGovernor: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -433,25 +433,25 @@ func (x *fastReflection_EventRegister) ProtoMethods() *protoiface.Methods { } var ( - md_EventRemove protoreflect.MessageDescriptor - fd_EventRemove_address protoreflect.FieldDescriptor + md_EventRemoveGovernor protoreflect.MessageDescriptor + fd_EventRemoveGovernor_address protoreflect.FieldDescriptor ) func init() { file_chora_governor_v1_events_proto_init() - md_EventRemove = File_chora_governor_v1_events_proto.Messages().ByName("EventRemove") - fd_EventRemove_address = md_EventRemove.Fields().ByName("address") + md_EventRemoveGovernor = File_chora_governor_v1_events_proto.Messages().ByName("EventRemoveGovernor") + fd_EventRemoveGovernor_address = md_EventRemoveGovernor.Fields().ByName("address") } -var _ protoreflect.Message = (*fastReflection_EventRemove)(nil) +var _ protoreflect.Message = (*fastReflection_EventRemoveGovernor)(nil) -type fastReflection_EventRemove EventRemove +type fastReflection_EventRemoveGovernor EventRemoveGovernor -func (x *EventRemove) ProtoReflect() protoreflect.Message { - return (*fastReflection_EventRemove)(x) +func (x *EventRemoveGovernor) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventRemoveGovernor)(x) } -func (x *EventRemove) slowProtoReflect() protoreflect.Message { +func (x *EventRemoveGovernor) slowProtoReflect() protoreflect.Message { mi := &file_chora_governor_v1_events_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -463,43 +463,43 @@ func (x *EventRemove) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_EventRemove_messageType fastReflection_EventRemove_messageType -var _ protoreflect.MessageType = fastReflection_EventRemove_messageType{} +var _fastReflection_EventRemoveGovernor_messageType fastReflection_EventRemoveGovernor_messageType +var _ protoreflect.MessageType = fastReflection_EventRemoveGovernor_messageType{} -type fastReflection_EventRemove_messageType struct{} +type fastReflection_EventRemoveGovernor_messageType struct{} -func (x fastReflection_EventRemove_messageType) Zero() protoreflect.Message { - return (*fastReflection_EventRemove)(nil) +func (x fastReflection_EventRemoveGovernor_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventRemoveGovernor)(nil) } -func (x fastReflection_EventRemove_messageType) New() protoreflect.Message { - return new(fastReflection_EventRemove) +func (x fastReflection_EventRemoveGovernor_messageType) New() protoreflect.Message { + return new(fastReflection_EventRemoveGovernor) } -func (x fastReflection_EventRemove_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_EventRemove +func (x fastReflection_EventRemoveGovernor_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventRemoveGovernor } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_EventRemove) Descriptor() protoreflect.MessageDescriptor { - return md_EventRemove +func (x *fastReflection_EventRemoveGovernor) Descriptor() protoreflect.MessageDescriptor { + return md_EventRemoveGovernor } // 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_EventRemove) Type() protoreflect.MessageType { - return _fastReflection_EventRemove_messageType +func (x *fastReflection_EventRemoveGovernor) Type() protoreflect.MessageType { + return _fastReflection_EventRemoveGovernor_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_EventRemove) New() protoreflect.Message { - return new(fastReflection_EventRemove) +func (x *fastReflection_EventRemoveGovernor) New() protoreflect.Message { + return new(fastReflection_EventRemoveGovernor) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_EventRemove) Interface() protoreflect.ProtoMessage { - return (*EventRemove)(x) +func (x *fastReflection_EventRemoveGovernor) Interface() protoreflect.ProtoMessage { + return (*EventRemoveGovernor)(x) } // Range iterates over every populated field in an undefined order, @@ -507,10 +507,10 @@ func (x *fastReflection_EventRemove) 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_EventRemove) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_EventRemoveGovernor) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Address != "" { value := protoreflect.ValueOfString(x.Address) - if !f(fd_EventRemove_address, value) { + if !f(fd_EventRemoveGovernor_address, value) { return } } @@ -527,15 +527,15 @@ func (x *fastReflection_EventRemove) Range(f func(protoreflect.FieldDescriptor, // 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_EventRemove) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_EventRemoveGovernor) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "chora.governor.v1.EventRemove.address": + case "chora.governor.v1.EventRemoveGovernor.address": return x.Address != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRemove")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRemoveGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.EventRemove does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventRemoveGovernor does not contain field %s", fd.FullName())) } } @@ -545,15 +545,15 @@ func (x *fastReflection_EventRemove) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventRemove) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_EventRemoveGovernor) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "chora.governor.v1.EventRemove.address": + case "chora.governor.v1.EventRemoveGovernor.address": x.Address = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRemove")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRemoveGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.EventRemove does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventRemoveGovernor does not contain field %s", fd.FullName())) } } @@ -563,16 +563,16 @@ func (x *fastReflection_EventRemove) 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_EventRemove) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventRemoveGovernor) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "chora.governor.v1.EventRemove.address": + case "chora.governor.v1.EventRemoveGovernor.address": value := x.Address return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRemove")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRemoveGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.EventRemove does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventRemoveGovernor does not contain field %s", descriptor.FullName())) } } @@ -586,15 +586,15 @@ func (x *fastReflection_EventRemove) Get(descriptor protoreflect.FieldDescriptor // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventRemove) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_EventRemoveGovernor) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "chora.governor.v1.EventRemove.address": + case "chora.governor.v1.EventRemoveGovernor.address": x.Address = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRemove")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRemoveGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.EventRemove does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventRemoveGovernor does not contain field %s", fd.FullName())) } } @@ -608,40 +608,40 @@ func (x *fastReflection_EventRemove) Set(fd protoreflect.FieldDescriptor, value // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventRemove) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventRemoveGovernor) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.EventRemove.address": - panic(fmt.Errorf("field address of message chora.governor.v1.EventRemove is not mutable")) + case "chora.governor.v1.EventRemoveGovernor.address": + panic(fmt.Errorf("field address of message chora.governor.v1.EventRemoveGovernor is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRemove")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRemoveGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.EventRemove does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventRemoveGovernor 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_EventRemove) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventRemoveGovernor) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.EventRemove.address": + case "chora.governor.v1.EventRemoveGovernor.address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRemove")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventRemoveGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.EventRemove does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventRemoveGovernor 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_EventRemove) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_EventRemoveGovernor) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.EventRemove", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.EventRemoveGovernor", d.FullName())) } panic("unreachable") } @@ -649,7 +649,7 @@ func (x *fastReflection_EventRemove) WhichOneof(d protoreflect.OneofDescriptor) // 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_EventRemove) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_EventRemoveGovernor) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -660,7 +660,7 @@ func (x *fastReflection_EventRemove) 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_EventRemove) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_EventRemoveGovernor) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -672,7 +672,7 @@ func (x *fastReflection_EventRemove) SetUnknown(fields protoreflect.RawFields) { // 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_EventRemove) IsValid() bool { +func (x *fastReflection_EventRemoveGovernor) IsValid() bool { return x != nil } @@ -682,9 +682,9 @@ func (x *fastReflection_EventRemove) 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_EventRemove) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_EventRemoveGovernor) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*EventRemove) + x := input.Message.Interface().(*EventRemoveGovernor) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -710,7 +710,7 @@ func (x *fastReflection_EventRemove) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*EventRemove) + x := input.Message.Interface().(*EventRemoveGovernor) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -747,7 +747,7 @@ func (x *fastReflection_EventRemove) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*EventRemove) + x := input.Message.Interface().(*EventRemoveGovernor) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -779,10 +779,10 @@ func (x *fastReflection_EventRemove) 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: EventRemove: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventRemoveGovernor: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventRemove: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventRemoveGovernor: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -853,25 +853,25 @@ func (x *fastReflection_EventRemove) ProtoMethods() *protoiface.Methods { } var ( - md_EventResign protoreflect.MessageDescriptor - fd_EventResign_address protoreflect.FieldDescriptor + md_EventUpdateGovernorMetadata protoreflect.MessageDescriptor + fd_EventUpdateGovernorMetadata_address protoreflect.FieldDescriptor ) func init() { file_chora_governor_v1_events_proto_init() - md_EventResign = File_chora_governor_v1_events_proto.Messages().ByName("EventResign") - fd_EventResign_address = md_EventResign.Fields().ByName("address") + md_EventUpdateGovernorMetadata = File_chora_governor_v1_events_proto.Messages().ByName("EventUpdateGovernorMetadata") + fd_EventUpdateGovernorMetadata_address = md_EventUpdateGovernorMetadata.Fields().ByName("address") } -var _ protoreflect.Message = (*fastReflection_EventResign)(nil) +var _ protoreflect.Message = (*fastReflection_EventUpdateGovernorMetadata)(nil) -type fastReflection_EventResign EventResign +type fastReflection_EventUpdateGovernorMetadata EventUpdateGovernorMetadata -func (x *EventResign) ProtoReflect() protoreflect.Message { - return (*fastReflection_EventResign)(x) +func (x *EventUpdateGovernorMetadata) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventUpdateGovernorMetadata)(x) } -func (x *EventResign) slowProtoReflect() protoreflect.Message { +func (x *EventUpdateGovernorMetadata) slowProtoReflect() protoreflect.Message { mi := &file_chora_governor_v1_events_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -883,43 +883,43 @@ func (x *EventResign) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_EventResign_messageType fastReflection_EventResign_messageType -var _ protoreflect.MessageType = fastReflection_EventResign_messageType{} +var _fastReflection_EventUpdateGovernorMetadata_messageType fastReflection_EventUpdateGovernorMetadata_messageType +var _ protoreflect.MessageType = fastReflection_EventUpdateGovernorMetadata_messageType{} -type fastReflection_EventResign_messageType struct{} +type fastReflection_EventUpdateGovernorMetadata_messageType struct{} -func (x fastReflection_EventResign_messageType) Zero() protoreflect.Message { - return (*fastReflection_EventResign)(nil) +func (x fastReflection_EventUpdateGovernorMetadata_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventUpdateGovernorMetadata)(nil) } -func (x fastReflection_EventResign_messageType) New() protoreflect.Message { - return new(fastReflection_EventResign) +func (x fastReflection_EventUpdateGovernorMetadata_messageType) New() protoreflect.Message { + return new(fastReflection_EventUpdateGovernorMetadata) } -func (x fastReflection_EventResign_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_EventResign +func (x fastReflection_EventUpdateGovernorMetadata_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventUpdateGovernorMetadata } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_EventResign) Descriptor() protoreflect.MessageDescriptor { - return md_EventResign +func (x *fastReflection_EventUpdateGovernorMetadata) Descriptor() protoreflect.MessageDescriptor { + return md_EventUpdateGovernorMetadata } // 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_EventResign) Type() protoreflect.MessageType { - return _fastReflection_EventResign_messageType +func (x *fastReflection_EventUpdateGovernorMetadata) Type() protoreflect.MessageType { + return _fastReflection_EventUpdateGovernorMetadata_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_EventResign) New() protoreflect.Message { - return new(fastReflection_EventResign) +func (x *fastReflection_EventUpdateGovernorMetadata) New() protoreflect.Message { + return new(fastReflection_EventUpdateGovernorMetadata) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_EventResign) Interface() protoreflect.ProtoMessage { - return (*EventResign)(x) +func (x *fastReflection_EventUpdateGovernorMetadata) Interface() protoreflect.ProtoMessage { + return (*EventUpdateGovernorMetadata)(x) } // Range iterates over every populated field in an undefined order, @@ -927,10 +927,10 @@ func (x *fastReflection_EventResign) 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_EventResign) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_EventUpdateGovernorMetadata) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Address != "" { value := protoreflect.ValueOfString(x.Address) - if !f(fd_EventResign_address, value) { + if !f(fd_EventUpdateGovernorMetadata_address, value) { return } } @@ -947,15 +947,15 @@ func (x *fastReflection_EventResign) Range(f func(protoreflect.FieldDescriptor, // 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_EventResign) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_EventUpdateGovernorMetadata) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "chora.governor.v1.EventResign.address": + case "chora.governor.v1.EventUpdateGovernorMetadata.address": return x.Address != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventResign")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventUpdateGovernorMetadata")) } - panic(fmt.Errorf("message chora.governor.v1.EventResign does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventUpdateGovernorMetadata does not contain field %s", fd.FullName())) } } @@ -965,15 +965,15 @@ func (x *fastReflection_EventResign) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventResign) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_EventUpdateGovernorMetadata) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "chora.governor.v1.EventResign.address": + case "chora.governor.v1.EventUpdateGovernorMetadata.address": x.Address = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventResign")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventUpdateGovernorMetadata")) } - panic(fmt.Errorf("message chora.governor.v1.EventResign does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventUpdateGovernorMetadata does not contain field %s", fd.FullName())) } } @@ -983,16 +983,16 @@ func (x *fastReflection_EventResign) 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_EventResign) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventUpdateGovernorMetadata) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "chora.governor.v1.EventResign.address": + case "chora.governor.v1.EventUpdateGovernorMetadata.address": value := x.Address return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventResign")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventUpdateGovernorMetadata")) } - panic(fmt.Errorf("message chora.governor.v1.EventResign does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventUpdateGovernorMetadata does not contain field %s", descriptor.FullName())) } } @@ -1006,15 +1006,15 @@ func (x *fastReflection_EventResign) Get(descriptor protoreflect.FieldDescriptor // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventResign) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_EventUpdateGovernorMetadata) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "chora.governor.v1.EventResign.address": + case "chora.governor.v1.EventUpdateGovernorMetadata.address": x.Address = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventResign")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventUpdateGovernorMetadata")) } - panic(fmt.Errorf("message chora.governor.v1.EventResign does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventUpdateGovernorMetadata does not contain field %s", fd.FullName())) } } @@ -1028,40 +1028,40 @@ func (x *fastReflection_EventResign) Set(fd protoreflect.FieldDescriptor, value // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventResign) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventUpdateGovernorMetadata) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.EventResign.address": - panic(fmt.Errorf("field address of message chora.governor.v1.EventResign is not mutable")) + case "chora.governor.v1.EventUpdateGovernorMetadata.address": + panic(fmt.Errorf("field address of message chora.governor.v1.EventUpdateGovernorMetadata is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventResign")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventUpdateGovernorMetadata")) } - panic(fmt.Errorf("message chora.governor.v1.EventResign does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventUpdateGovernorMetadata 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_EventResign) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventUpdateGovernorMetadata) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.EventResign.address": + case "chora.governor.v1.EventUpdateGovernorMetadata.address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventResign")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventUpdateGovernorMetadata")) } - panic(fmt.Errorf("message chora.governor.v1.EventResign does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.EventUpdateGovernorMetadata 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_EventResign) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_EventUpdateGovernorMetadata) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.EventResign", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.EventUpdateGovernorMetadata", d.FullName())) } panic("unreachable") } @@ -1069,7 +1069,7 @@ func (x *fastReflection_EventResign) WhichOneof(d protoreflect.OneofDescriptor) // 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_EventResign) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_EventUpdateGovernorMetadata) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1080,7 +1080,7 @@ func (x *fastReflection_EventResign) 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_EventResign) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_EventUpdateGovernorMetadata) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1092,7 +1092,7 @@ func (x *fastReflection_EventResign) SetUnknown(fields protoreflect.RawFields) { // 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_EventResign) IsValid() bool { +func (x *fastReflection_EventUpdateGovernorMetadata) IsValid() bool { return x != nil } @@ -1102,9 +1102,9 @@ func (x *fastReflection_EventResign) 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_EventResign) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_EventUpdateGovernorMetadata) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*EventResign) + x := input.Message.Interface().(*EventUpdateGovernorMetadata) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1130,7 +1130,7 @@ func (x *fastReflection_EventResign) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*EventResign) + x := input.Message.Interface().(*EventUpdateGovernorMetadata) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1167,7 +1167,7 @@ func (x *fastReflection_EventResign) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*EventResign) + x := input.Message.Interface().(*EventUpdateGovernorMetadata) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1199,430 +1199,10 @@ func (x *fastReflection_EventResign) 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: EventResign: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventUpdateGovernorMetadata: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventResign: 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 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 - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_EventUpdate protoreflect.MessageDescriptor - fd_EventUpdate_address protoreflect.FieldDescriptor -) - -func init() { - file_chora_governor_v1_events_proto_init() - md_EventUpdate = File_chora_governor_v1_events_proto.Messages().ByName("EventUpdate") - fd_EventUpdate_address = md_EventUpdate.Fields().ByName("address") -} - -var _ protoreflect.Message = (*fastReflection_EventUpdate)(nil) - -type fastReflection_EventUpdate EventUpdate - -func (x *EventUpdate) ProtoReflect() protoreflect.Message { - return (*fastReflection_EventUpdate)(x) -} - -func (x *EventUpdate) slowProtoReflect() protoreflect.Message { - mi := &file_chora_governor_v1_events_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_EventUpdate_messageType fastReflection_EventUpdate_messageType -var _ protoreflect.MessageType = fastReflection_EventUpdate_messageType{} - -type fastReflection_EventUpdate_messageType struct{} - -func (x fastReflection_EventUpdate_messageType) Zero() protoreflect.Message { - return (*fastReflection_EventUpdate)(nil) -} -func (x fastReflection_EventUpdate_messageType) New() protoreflect.Message { - return new(fastReflection_EventUpdate) -} -func (x fastReflection_EventUpdate_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_EventUpdate -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_EventUpdate) Descriptor() protoreflect.MessageDescriptor { - return md_EventUpdate -} - -// 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_EventUpdate) Type() protoreflect.MessageType { - return _fastReflection_EventUpdate_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_EventUpdate) New() protoreflect.Message { - return new(fastReflection_EventUpdate) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_EventUpdate) Interface() protoreflect.ProtoMessage { - return (*EventUpdate)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_EventUpdate) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Address != "" { - value := protoreflect.ValueOfString(x.Address) - if !f(fd_EventUpdate_address, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// 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_EventUpdate) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "chora.governor.v1.EventUpdate.address": - return x.Address != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventUpdate")) - } - panic(fmt.Errorf("message chora.governor.v1.EventUpdate does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventUpdate) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "chora.governor.v1.EventUpdate.address": - x.Address = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventUpdate")) - } - panic(fmt.Errorf("message chora.governor.v1.EventUpdate does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// 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_EventUpdate) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "chora.governor.v1.EventUpdate.address": - value := x.Address - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventUpdate")) - } - panic(fmt.Errorf("message chora.governor.v1.EventUpdate does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventUpdate) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "chora.governor.v1.EventUpdate.address": - x.Address = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventUpdate")) - } - panic(fmt.Errorf("message chora.governor.v1.EventUpdate does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventUpdate) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "chora.governor.v1.EventUpdate.address": - panic(fmt.Errorf("field address of message chora.governor.v1.EventUpdate is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventUpdate")) - } - panic(fmt.Errorf("message chora.governor.v1.EventUpdate 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_EventUpdate) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "chora.governor.v1.EventUpdate.address": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.EventUpdate")) - } - panic(fmt.Errorf("message chora.governor.v1.EventUpdate 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_EventUpdate) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.EventUpdate", d.FullName())) - } - panic("unreachable") -} - -// 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_EventUpdate) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventUpdate) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// 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_EventUpdate) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_EventUpdate) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*EventUpdate) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Address) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*EventUpdate) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - 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 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*EventUpdate) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire 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++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventUpdate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventUpdateGovernorMetadata: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1705,8 +1285,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// EventRegister is an event emitted when a governor has registered. -type EventRegister struct { +// EventCreateGovernor is an event emitted when a governor has registered. +type EventCreateGovernor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1715,8 +1295,8 @@ type EventRegister struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (x *EventRegister) Reset() { - *x = EventRegister{} +func (x *EventCreateGovernor) Reset() { + *x = EventCreateGovernor{} if protoimpl.UnsafeEnabled { mi := &file_chora_governor_v1_events_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1724,26 +1304,26 @@ func (x *EventRegister) Reset() { } } -func (x *EventRegister) String() string { +func (x *EventCreateGovernor) String() string { return protoimpl.X.MessageStringOf(x) } -func (*EventRegister) ProtoMessage() {} +func (*EventCreateGovernor) ProtoMessage() {} -// Deprecated: Use EventRegister.ProtoReflect.Descriptor instead. -func (*EventRegister) Descriptor() ([]byte, []int) { +// Deprecated: Use EventCreateGovernor.ProtoReflect.Descriptor instead. +func (*EventCreateGovernor) Descriptor() ([]byte, []int) { return file_chora_governor_v1_events_proto_rawDescGZIP(), []int{0} } -func (x *EventRegister) GetAddress() string { +func (x *EventCreateGovernor) GetAddress() string { if x != nil { return x.Address } return "" } -// EventRemove is an event emitted when a governor has been removed. -type EventRemove struct { +// EventRemoveGovernor is an event emitted when a governor has been removed. +type EventRemoveGovernor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1752,8 +1332,8 @@ type EventRemove struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (x *EventRemove) Reset() { - *x = EventRemove{} +func (x *EventRemoveGovernor) Reset() { + *x = EventRemoveGovernor{} if protoimpl.UnsafeEnabled { mi := &file_chora_governor_v1_events_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1761,26 +1341,26 @@ func (x *EventRemove) Reset() { } } -func (x *EventRemove) String() string { +func (x *EventRemoveGovernor) String() string { return protoimpl.X.MessageStringOf(x) } -func (*EventRemove) ProtoMessage() {} +func (*EventRemoveGovernor) ProtoMessage() {} -// Deprecated: Use EventRemove.ProtoReflect.Descriptor instead. -func (*EventRemove) Descriptor() ([]byte, []int) { +// Deprecated: Use EventRemoveGovernor.ProtoReflect.Descriptor instead. +func (*EventRemoveGovernor) Descriptor() ([]byte, []int) { return file_chora_governor_v1_events_proto_rawDescGZIP(), []int{1} } -func (x *EventRemove) GetAddress() string { +func (x *EventRemoveGovernor) GetAddress() string { if x != nil { return x.Address } return "" } -// EventResign is an event emitted when a governor has resigned. -type EventResign struct { +// EventUpdateGovernorMetadata is an event emitted when a governor has updated. +type EventUpdateGovernorMetadata struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1789,8 +1369,8 @@ type EventResign struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (x *EventResign) Reset() { - *x = EventResign{} +func (x *EventUpdateGovernorMetadata) Reset() { + *x = EventUpdateGovernorMetadata{} if protoimpl.UnsafeEnabled { mi := &file_chora_governor_v1_events_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1798,55 +1378,18 @@ func (x *EventResign) Reset() { } } -func (x *EventResign) String() string { +func (x *EventUpdateGovernorMetadata) String() string { return protoimpl.X.MessageStringOf(x) } -func (*EventResign) ProtoMessage() {} +func (*EventUpdateGovernorMetadata) ProtoMessage() {} -// Deprecated: Use EventResign.ProtoReflect.Descriptor instead. -func (*EventResign) Descriptor() ([]byte, []int) { +// Deprecated: Use EventUpdateGovernorMetadata.ProtoReflect.Descriptor instead. +func (*EventUpdateGovernorMetadata) Descriptor() ([]byte, []int) { return file_chora_governor_v1_events_proto_rawDescGZIP(), []int{2} } -func (x *EventResign) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -// EventUpdate is an event emitted when a governor has updated. -type EventUpdate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // address is the address of the governor. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` -} - -func (x *EventUpdate) Reset() { - *x = EventUpdate{} - if protoimpl.UnsafeEnabled { - mi := &file_chora_governor_v1_events_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EventUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EventUpdate) ProtoMessage() {} - -// Deprecated: Use EventUpdate.ProtoReflect.Descriptor instead. -func (*EventUpdate) Descriptor() ([]byte, []int) { - return file_chora_governor_v1_events_proto_rawDescGZIP(), []int{3} -} - -func (x *EventUpdate) GetAddress() string { +func (x *EventUpdateGovernorMetadata) GetAddress() string { if x != nil { return x.Address } @@ -1859,31 +1402,30 @@ var file_chora_governor_v1_events_proto_rawDesc = []byte{ 0x0a, 0x1e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, - 0x2e, 0x76, 0x31, 0x22, 0x29, 0x0a, 0x0d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 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, 0x27, - 0x0a, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 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, 0x27, 0x0a, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x69, 0x67, 0x6e, 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, 0x27, 0x0a, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 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, 0x42, 0xce, 0x01, 0x0a, 0x15, 0x63, 0x6f, - 0x6d, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, - 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x42, 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, 0x67, 0x6f, 0x76, - 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2f, - 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x65, - 0x72, 0x6e, 0x6f, 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x11, 0x43, - 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x11, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x5c, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, - 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x5c, 0x47, 0x6f, 0x76, - 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x3a, 0x3a, 0x47, 0x6f, - 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x2e, 0x76, 0x31, 0x22, 0x2f, 0x0a, 0x13, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 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, 0x2f, 0x0a, 0x13, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 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, 0x37, 0x0a, 0x1b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 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, 0xce, + 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, + 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x42, 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, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x68, 0x6f, 0x72, 0x61, 0x2f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2f, 0x76, 0x31, + 0x3b, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, + 0x58, 0xaa, 0x02, 0x11, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, + 0x6f, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x5c, 0x47, 0x6f, + 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, 0x43, 0x68, 0x6f, 0x72, + 0x61, 0x5c, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x68, 0x6f, 0x72, + 0x61, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1898,12 +1440,11 @@ func file_chora_governor_v1_events_proto_rawDescGZIP() []byte { return file_chora_governor_v1_events_proto_rawDescData } -var file_chora_governor_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_chora_governor_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_chora_governor_v1_events_proto_goTypes = []interface{}{ - (*EventRegister)(nil), // 0: chora.governor.v1.EventRegister - (*EventRemove)(nil), // 1: chora.governor.v1.EventRemove - (*EventResign)(nil), // 2: chora.governor.v1.EventResign - (*EventUpdate)(nil), // 3: chora.governor.v1.EventUpdate + (*EventCreateGovernor)(nil), // 0: chora.governor.v1.EventCreateGovernor + (*EventRemoveGovernor)(nil), // 1: chora.governor.v1.EventRemoveGovernor + (*EventUpdateGovernorMetadata)(nil), // 2: chora.governor.v1.EventUpdateGovernorMetadata } var file_chora_governor_v1_events_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -1920,7 +1461,7 @@ func file_chora_governor_v1_events_proto_init() { } if !protoimpl.UnsafeEnabled { file_chora_governor_v1_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EventRegister); i { + switch v := v.(*EventCreateGovernor); i { case 0: return &v.state case 1: @@ -1932,7 +1473,7 @@ func file_chora_governor_v1_events_proto_init() { } } file_chora_governor_v1_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EventRemove); i { + switch v := v.(*EventRemoveGovernor); i { case 0: return &v.state case 1: @@ -1944,19 +1485,7 @@ func file_chora_governor_v1_events_proto_init() { } } file_chora_governor_v1_events_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EventResign); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_chora_governor_v1_events_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EventUpdate); i { + switch v := v.(*EventUpdateGovernorMetadata); i { case 0: return &v.state case 1: @@ -1974,7 +1503,7 @@ func file_chora_governor_v1_events_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_chora_governor_v1_events_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/governor/api/v1/msg.pulsar.go b/governor/api/v1/msg.pulsar.go index 61c9316..150803d 100644 --- a/governor/api/v1/msg.pulsar.go +++ b/governor/api/v1/msg.pulsar.go @@ -14,27 +14,27 @@ import ( ) var ( - md_MsgRegister protoreflect.MessageDescriptor - fd_MsgRegister_governor protoreflect.FieldDescriptor - fd_MsgRegister_metadata protoreflect.FieldDescriptor + md_MsgCreateGovernor protoreflect.MessageDescriptor + fd_MsgCreateGovernor_address protoreflect.FieldDescriptor + fd_MsgCreateGovernor_metadata protoreflect.FieldDescriptor ) func init() { file_chora_governor_v1_msg_proto_init() - md_MsgRegister = File_chora_governor_v1_msg_proto.Messages().ByName("MsgRegister") - fd_MsgRegister_governor = md_MsgRegister.Fields().ByName("governor") - fd_MsgRegister_metadata = md_MsgRegister.Fields().ByName("metadata") + md_MsgCreateGovernor = File_chora_governor_v1_msg_proto.Messages().ByName("MsgCreateGovernor") + fd_MsgCreateGovernor_address = md_MsgCreateGovernor.Fields().ByName("address") + fd_MsgCreateGovernor_metadata = md_MsgCreateGovernor.Fields().ByName("metadata") } -var _ protoreflect.Message = (*fastReflection_MsgRegister)(nil) +var _ protoreflect.Message = (*fastReflection_MsgCreateGovernor)(nil) -type fastReflection_MsgRegister MsgRegister +type fastReflection_MsgCreateGovernor MsgCreateGovernor -func (x *MsgRegister) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgRegister)(x) +func (x *MsgCreateGovernor) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateGovernor)(x) } -func (x *MsgRegister) slowProtoReflect() protoreflect.Message { +func (x *MsgCreateGovernor) slowProtoReflect() protoreflect.Message { mi := &file_chora_governor_v1_msg_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -46,43 +46,43 @@ func (x *MsgRegister) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgRegister_messageType fastReflection_MsgRegister_messageType -var _ protoreflect.MessageType = fastReflection_MsgRegister_messageType{} +var _fastReflection_MsgCreateGovernor_messageType fastReflection_MsgCreateGovernor_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateGovernor_messageType{} -type fastReflection_MsgRegister_messageType struct{} +type fastReflection_MsgCreateGovernor_messageType struct{} -func (x fastReflection_MsgRegister_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgRegister)(nil) +func (x fastReflection_MsgCreateGovernor_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateGovernor)(nil) } -func (x fastReflection_MsgRegister_messageType) New() protoreflect.Message { - return new(fastReflection_MsgRegister) +func (x fastReflection_MsgCreateGovernor_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateGovernor) } -func (x fastReflection_MsgRegister_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRegister +func (x fastReflection_MsgCreateGovernor_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateGovernor } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgRegister) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRegister +func (x *fastReflection_MsgCreateGovernor) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateGovernor } // 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_MsgRegister) Type() protoreflect.MessageType { - return _fastReflection_MsgRegister_messageType +func (x *fastReflection_MsgCreateGovernor) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateGovernor_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgRegister) New() protoreflect.Message { - return new(fastReflection_MsgRegister) +func (x *fastReflection_MsgCreateGovernor) New() protoreflect.Message { + return new(fastReflection_MsgCreateGovernor) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgRegister) Interface() protoreflect.ProtoMessage { - return (*MsgRegister)(x) +func (x *fastReflection_MsgCreateGovernor) Interface() protoreflect.ProtoMessage { + return (*MsgCreateGovernor)(x) } // Range iterates over every populated field in an undefined order, @@ -90,16 +90,16 @@ func (x *fastReflection_MsgRegister) 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_MsgRegister) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Governor != "" { - value := protoreflect.ValueOfString(x.Governor) - if !f(fd_MsgRegister_governor, value) { +func (x *fastReflection_MsgCreateGovernor) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_MsgCreateGovernor_address, value) { return } } if x.Metadata != "" { value := protoreflect.ValueOfString(x.Metadata) - if !f(fd_MsgRegister_metadata, value) { + if !f(fd_MsgCreateGovernor_metadata, value) { return } } @@ -116,17 +116,17 @@ func (x *fastReflection_MsgRegister) Range(f func(protoreflect.FieldDescriptor, // 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_MsgRegister) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgCreateGovernor) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "chora.governor.v1.MsgRegister.governor": - return x.Governor != "" - case "chora.governor.v1.MsgRegister.metadata": + case "chora.governor.v1.MsgCreateGovernor.address": + return x.Address != "" + case "chora.governor.v1.MsgCreateGovernor.metadata": return x.Metadata != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRegister")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgCreateGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRegister does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgCreateGovernor does not contain field %s", fd.FullName())) } } @@ -136,17 +136,17 @@ func (x *fastReflection_MsgRegister) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRegister) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgCreateGovernor) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "chora.governor.v1.MsgRegister.governor": - x.Governor = "" - case "chora.governor.v1.MsgRegister.metadata": + case "chora.governor.v1.MsgCreateGovernor.address": + x.Address = "" + case "chora.governor.v1.MsgCreateGovernor.metadata": x.Metadata = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRegister")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgCreateGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRegister does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgCreateGovernor does not contain field %s", fd.FullName())) } } @@ -156,19 +156,19 @@ func (x *fastReflection_MsgRegister) 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_MsgRegister) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateGovernor) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "chora.governor.v1.MsgRegister.governor": - value := x.Governor + case "chora.governor.v1.MsgCreateGovernor.address": + value := x.Address return protoreflect.ValueOfString(value) - case "chora.governor.v1.MsgRegister.metadata": + case "chora.governor.v1.MsgCreateGovernor.metadata": value := x.Metadata return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRegister")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgCreateGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRegister does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgCreateGovernor does not contain field %s", descriptor.FullName())) } } @@ -182,17 +182,17 @@ func (x *fastReflection_MsgRegister) Get(descriptor protoreflect.FieldDescriptor // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRegister) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgCreateGovernor) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "chora.governor.v1.MsgRegister.governor": - x.Governor = value.Interface().(string) - case "chora.governor.v1.MsgRegister.metadata": + case "chora.governor.v1.MsgCreateGovernor.address": + x.Address = value.Interface().(string) + case "chora.governor.v1.MsgCreateGovernor.metadata": x.Metadata = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRegister")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgCreateGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRegister does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgCreateGovernor does not contain field %s", fd.FullName())) } } @@ -206,44 +206,44 @@ func (x *fastReflection_MsgRegister) Set(fd protoreflect.FieldDescriptor, value // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRegister) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateGovernor) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.MsgRegister.governor": - panic(fmt.Errorf("field governor of message chora.governor.v1.MsgRegister is not mutable")) - case "chora.governor.v1.MsgRegister.metadata": - panic(fmt.Errorf("field metadata of message chora.governor.v1.MsgRegister is not mutable")) + case "chora.governor.v1.MsgCreateGovernor.address": + panic(fmt.Errorf("field address of message chora.governor.v1.MsgCreateGovernor is not mutable")) + case "chora.governor.v1.MsgCreateGovernor.metadata": + panic(fmt.Errorf("field metadata of message chora.governor.v1.MsgCreateGovernor is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRegister")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgCreateGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRegister does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgCreateGovernor 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_MsgRegister) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateGovernor) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.MsgRegister.governor": + case "chora.governor.v1.MsgCreateGovernor.address": return protoreflect.ValueOfString("") - case "chora.governor.v1.MsgRegister.metadata": + case "chora.governor.v1.MsgCreateGovernor.metadata": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRegister")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgCreateGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRegister does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgCreateGovernor 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_MsgRegister) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgCreateGovernor) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.MsgRegister", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.MsgCreateGovernor", d.FullName())) } panic("unreachable") } @@ -251,7 +251,7 @@ func (x *fastReflection_MsgRegister) WhichOneof(d protoreflect.OneofDescriptor) // 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_MsgRegister) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgCreateGovernor) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -262,7 +262,7 @@ func (x *fastReflection_MsgRegister) 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_MsgRegister) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgCreateGovernor) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -274,7 +274,7 @@ func (x *fastReflection_MsgRegister) SetUnknown(fields protoreflect.RawFields) { // 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_MsgRegister) IsValid() bool { +func (x *fastReflection_MsgCreateGovernor) IsValid() bool { return x != nil } @@ -284,9 +284,9 @@ func (x *fastReflection_MsgRegister) 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_MsgRegister) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgCreateGovernor) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgRegister) + x := input.Message.Interface().(*MsgCreateGovernor) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -298,7 +298,7 @@ func (x *fastReflection_MsgRegister) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Governor) + l = len(x.Address) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -316,7 +316,7 @@ func (x *fastReflection_MsgRegister) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgRegister) + x := input.Message.Interface().(*MsgCreateGovernor) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -342,10 +342,10 @@ func (x *fastReflection_MsgRegister) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x12 } - if len(x.Governor) > 0 { - i -= len(x.Governor) - copy(dAtA[i:], x.Governor) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Governor))) + 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 } @@ -360,7 +360,7 @@ func (x *fastReflection_MsgRegister) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgRegister) + x := input.Message.Interface().(*MsgCreateGovernor) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -392,15 +392,15 @@ func (x *fastReflection_MsgRegister) 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: MsgRegister: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateGovernor: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegister: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateGovernor: 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 Governor", wireType) + 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 { @@ -428,7 +428,7 @@ func (x *fastReflection_MsgRegister) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Governor = string(dAtA[iNdEx:postIndex]) + x.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -498,25 +498,25 @@ func (x *fastReflection_MsgRegister) ProtoMethods() *protoiface.Methods { } var ( - md_MsgRegisterResponse protoreflect.MessageDescriptor - fd_MsgRegisterResponse_governor protoreflect.FieldDescriptor + md_MsgCreateGovernorResponse protoreflect.MessageDescriptor + fd_MsgCreateGovernorResponse_address protoreflect.FieldDescriptor ) func init() { file_chora_governor_v1_msg_proto_init() - md_MsgRegisterResponse = File_chora_governor_v1_msg_proto.Messages().ByName("MsgRegisterResponse") - fd_MsgRegisterResponse_governor = md_MsgRegisterResponse.Fields().ByName("governor") + md_MsgCreateGovernorResponse = File_chora_governor_v1_msg_proto.Messages().ByName("MsgCreateGovernorResponse") + fd_MsgCreateGovernorResponse_address = md_MsgCreateGovernorResponse.Fields().ByName("address") } -var _ protoreflect.Message = (*fastReflection_MsgRegisterResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MsgCreateGovernorResponse)(nil) -type fastReflection_MsgRegisterResponse MsgRegisterResponse +type fastReflection_MsgCreateGovernorResponse MsgCreateGovernorResponse -func (x *MsgRegisterResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgRegisterResponse)(x) +func (x *MsgCreateGovernorResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateGovernorResponse)(x) } -func (x *MsgRegisterResponse) slowProtoReflect() protoreflect.Message { +func (x *MsgCreateGovernorResponse) slowProtoReflect() protoreflect.Message { mi := &file_chora_governor_v1_msg_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -528,43 +528,43 @@ func (x *MsgRegisterResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgRegisterResponse_messageType fastReflection_MsgRegisterResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgRegisterResponse_messageType{} +var _fastReflection_MsgCreateGovernorResponse_messageType fastReflection_MsgCreateGovernorResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateGovernorResponse_messageType{} -type fastReflection_MsgRegisterResponse_messageType struct{} +type fastReflection_MsgCreateGovernorResponse_messageType struct{} -func (x fastReflection_MsgRegisterResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgRegisterResponse)(nil) +func (x fastReflection_MsgCreateGovernorResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateGovernorResponse)(nil) } -func (x fastReflection_MsgRegisterResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgRegisterResponse) +func (x fastReflection_MsgCreateGovernorResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateGovernorResponse) } -func (x fastReflection_MsgRegisterResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRegisterResponse +func (x fastReflection_MsgCreateGovernorResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateGovernorResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgRegisterResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRegisterResponse +func (x *fastReflection_MsgCreateGovernorResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateGovernorResponse } // 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_MsgRegisterResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgRegisterResponse_messageType +func (x *fastReflection_MsgCreateGovernorResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateGovernorResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgRegisterResponse) New() protoreflect.Message { - return new(fastReflection_MsgRegisterResponse) +func (x *fastReflection_MsgCreateGovernorResponse) New() protoreflect.Message { + return new(fastReflection_MsgCreateGovernorResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgRegisterResponse) Interface() protoreflect.ProtoMessage { - return (*MsgRegisterResponse)(x) +func (x *fastReflection_MsgCreateGovernorResponse) Interface() protoreflect.ProtoMessage { + return (*MsgCreateGovernorResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -572,10 +572,10 @@ func (x *fastReflection_MsgRegisterResponse) Interface() protoreflect.ProtoMessa // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgRegisterResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Governor != "" { - value := protoreflect.ValueOfString(x.Governor) - if !f(fd_MsgRegisterResponse_governor, value) { +func (x *fastReflection_MsgCreateGovernorResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_MsgCreateGovernorResponse_address, value) { return } } @@ -592,15 +592,15 @@ func (x *fastReflection_MsgRegisterResponse) Range(f func(protoreflect.FieldDesc // 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_MsgRegisterResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgCreateGovernorResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "chora.governor.v1.MsgRegisterResponse.governor": - return x.Governor != "" + case "chora.governor.v1.MsgCreateGovernorResponse.address": + return x.Address != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRegisterResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgCreateGovernorResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRegisterResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgCreateGovernorResponse does not contain field %s", fd.FullName())) } } @@ -610,15 +610,15 @@ func (x *fastReflection_MsgRegisterResponse) Has(fd protoreflect.FieldDescriptor // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRegisterResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgCreateGovernorResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "chora.governor.v1.MsgRegisterResponse.governor": - x.Governor = "" + case "chora.governor.v1.MsgCreateGovernorResponse.address": + x.Address = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRegisterResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgCreateGovernorResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRegisterResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgCreateGovernorResponse does not contain field %s", fd.FullName())) } } @@ -628,16 +628,16 @@ func (x *fastReflection_MsgRegisterResponse) Clear(fd protoreflect.FieldDescript // 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_MsgRegisterResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateGovernorResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "chora.governor.v1.MsgRegisterResponse.governor": - value := x.Governor + case "chora.governor.v1.MsgCreateGovernorResponse.address": + value := x.Address return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRegisterResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgCreateGovernorResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRegisterResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgCreateGovernorResponse does not contain field %s", descriptor.FullName())) } } @@ -651,15 +651,15 @@ func (x *fastReflection_MsgRegisterResponse) Get(descriptor protoreflect.FieldDe // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRegisterResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgCreateGovernorResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "chora.governor.v1.MsgRegisterResponse.governor": - x.Governor = value.Interface().(string) + case "chora.governor.v1.MsgCreateGovernorResponse.address": + x.Address = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRegisterResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgCreateGovernorResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRegisterResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgCreateGovernorResponse does not contain field %s", fd.FullName())) } } @@ -673,40 +673,40 @@ func (x *fastReflection_MsgRegisterResponse) 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_MsgRegisterResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateGovernorResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.MsgRegisterResponse.governor": - panic(fmt.Errorf("field governor of message chora.governor.v1.MsgRegisterResponse is not mutable")) + case "chora.governor.v1.MsgCreateGovernorResponse.address": + panic(fmt.Errorf("field address of message chora.governor.v1.MsgCreateGovernorResponse is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRegisterResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgCreateGovernorResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRegisterResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgCreateGovernorResponse 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_MsgRegisterResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateGovernorResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.MsgRegisterResponse.governor": + case "chora.governor.v1.MsgCreateGovernorResponse.address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRegisterResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgCreateGovernorResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRegisterResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgCreateGovernorResponse 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_MsgRegisterResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgCreateGovernorResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.MsgRegisterResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.MsgCreateGovernorResponse", d.FullName())) } panic("unreachable") } @@ -714,7 +714,7 @@ func (x *fastReflection_MsgRegisterResponse) WhichOneof(d protoreflect.OneofDesc // 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_MsgRegisterResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgCreateGovernorResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -725,7 +725,7 @@ func (x *fastReflection_MsgRegisterResponse) 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_MsgRegisterResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgCreateGovernorResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -737,7 +737,7 @@ func (x *fastReflection_MsgRegisterResponse) SetUnknown(fields protoreflect.RawF // 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_MsgRegisterResponse) IsValid() bool { +func (x *fastReflection_MsgCreateGovernorResponse) IsValid() bool { return x != nil } @@ -747,9 +747,9 @@ func (x *fastReflection_MsgRegisterResponse) 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_MsgRegisterResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgCreateGovernorResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgRegisterResponse) + x := input.Message.Interface().(*MsgCreateGovernorResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -761,7 +761,7 @@ func (x *fastReflection_MsgRegisterResponse) ProtoMethods() *protoiface.Methods var n int var l int _ = l - l = len(x.Governor) + l = len(x.Address) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -775,7 +775,7 @@ func (x *fastReflection_MsgRegisterResponse) ProtoMethods() *protoiface.Methods } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgRegisterResponse) + x := input.Message.Interface().(*MsgCreateGovernorResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -794,10 +794,10 @@ func (x *fastReflection_MsgRegisterResponse) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Governor) > 0 { - i -= len(x.Governor) - copy(dAtA[i:], x.Governor) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Governor))) + 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 } @@ -812,7 +812,7 @@ func (x *fastReflection_MsgRegisterResponse) ProtoMethods() *protoiface.Methods }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgRegisterResponse) + x := input.Message.Interface().(*MsgCreateGovernorResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -844,15 +844,15 @@ func (x *fastReflection_MsgRegisterResponse) 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: MsgRegisterResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateGovernorResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateGovernorResponse: 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 Governor", wireType) + 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 { @@ -880,7 +880,7 @@ func (x *fastReflection_MsgRegisterResponse) ProtoMethods() *protoiface.Methods if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Governor = string(dAtA[iNdEx:postIndex]) + x.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -918,25 +918,25 @@ func (x *fastReflection_MsgRegisterResponse) ProtoMethods() *protoiface.Methods } var ( - md_MsgRemove protoreflect.MessageDescriptor - fd_MsgRemove_governor protoreflect.FieldDescriptor + md_MsgRemoveGovernor protoreflect.MessageDescriptor + fd_MsgRemoveGovernor_address protoreflect.FieldDescriptor ) func init() { file_chora_governor_v1_msg_proto_init() - md_MsgRemove = File_chora_governor_v1_msg_proto.Messages().ByName("MsgRemove") - fd_MsgRemove_governor = md_MsgRemove.Fields().ByName("governor") + md_MsgRemoveGovernor = File_chora_governor_v1_msg_proto.Messages().ByName("MsgRemoveGovernor") + fd_MsgRemoveGovernor_address = md_MsgRemoveGovernor.Fields().ByName("address") } -var _ protoreflect.Message = (*fastReflection_MsgRemove)(nil) +var _ protoreflect.Message = (*fastReflection_MsgRemoveGovernor)(nil) -type fastReflection_MsgRemove MsgRemove +type fastReflection_MsgRemoveGovernor MsgRemoveGovernor -func (x *MsgRemove) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgRemove)(x) +func (x *MsgRemoveGovernor) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRemoveGovernor)(x) } -func (x *MsgRemove) slowProtoReflect() protoreflect.Message { +func (x *MsgRemoveGovernor) slowProtoReflect() protoreflect.Message { mi := &file_chora_governor_v1_msg_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -948,43 +948,43 @@ func (x *MsgRemove) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgRemove_messageType fastReflection_MsgRemove_messageType -var _ protoreflect.MessageType = fastReflection_MsgRemove_messageType{} +var _fastReflection_MsgRemoveGovernor_messageType fastReflection_MsgRemoveGovernor_messageType +var _ protoreflect.MessageType = fastReflection_MsgRemoveGovernor_messageType{} -type fastReflection_MsgRemove_messageType struct{} +type fastReflection_MsgRemoveGovernor_messageType struct{} -func (x fastReflection_MsgRemove_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgRemove)(nil) +func (x fastReflection_MsgRemoveGovernor_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRemoveGovernor)(nil) } -func (x fastReflection_MsgRemove_messageType) New() protoreflect.Message { - return new(fastReflection_MsgRemove) +func (x fastReflection_MsgRemoveGovernor_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRemoveGovernor) } -func (x fastReflection_MsgRemove_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRemove +func (x fastReflection_MsgRemoveGovernor_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRemoveGovernor } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgRemove) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRemove +func (x *fastReflection_MsgRemoveGovernor) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRemoveGovernor } // 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_MsgRemove) Type() protoreflect.MessageType { - return _fastReflection_MsgRemove_messageType +func (x *fastReflection_MsgRemoveGovernor) Type() protoreflect.MessageType { + return _fastReflection_MsgRemoveGovernor_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgRemove) New() protoreflect.Message { - return new(fastReflection_MsgRemove) +func (x *fastReflection_MsgRemoveGovernor) New() protoreflect.Message { + return new(fastReflection_MsgRemoveGovernor) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgRemove) Interface() protoreflect.ProtoMessage { - return (*MsgRemove)(x) +func (x *fastReflection_MsgRemoveGovernor) Interface() protoreflect.ProtoMessage { + return (*MsgRemoveGovernor)(x) } // Range iterates over every populated field in an undefined order, @@ -992,10 +992,10 @@ func (x *fastReflection_MsgRemove) 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_MsgRemove) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Governor != "" { - value := protoreflect.ValueOfString(x.Governor) - if !f(fd_MsgRemove_governor, value) { +func (x *fastReflection_MsgRemoveGovernor) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_MsgRemoveGovernor_address, value) { return } } @@ -1012,15 +1012,15 @@ func (x *fastReflection_MsgRemove) Range(f func(protoreflect.FieldDescriptor, pr // 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_MsgRemove) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgRemoveGovernor) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "chora.governor.v1.MsgRemove.governor": - return x.Governor != "" + case "chora.governor.v1.MsgRemoveGovernor.address": + return x.Address != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemove")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRemove does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgRemoveGovernor does not contain field %s", fd.FullName())) } } @@ -1030,15 +1030,15 @@ func (x *fastReflection_MsgRemove) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRemove) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgRemoveGovernor) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "chora.governor.v1.MsgRemove.governor": - x.Governor = "" + case "chora.governor.v1.MsgRemoveGovernor.address": + x.Address = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemove")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRemove does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgRemoveGovernor does not contain field %s", fd.FullName())) } } @@ -1048,16 +1048,16 @@ func (x *fastReflection_MsgRemove) 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_MsgRemove) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRemoveGovernor) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "chora.governor.v1.MsgRemove.governor": - value := x.Governor + case "chora.governor.v1.MsgRemoveGovernor.address": + value := x.Address return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemove")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRemove does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgRemoveGovernor does not contain field %s", descriptor.FullName())) } } @@ -1071,15 +1071,15 @@ func (x *fastReflection_MsgRemove) Get(descriptor protoreflect.FieldDescriptor) // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRemove) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgRemoveGovernor) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "chora.governor.v1.MsgRemove.governor": - x.Governor = value.Interface().(string) + case "chora.governor.v1.MsgRemoveGovernor.address": + x.Address = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemove")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRemove does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgRemoveGovernor does not contain field %s", fd.FullName())) } } @@ -1093,40 +1093,40 @@ func (x *fastReflection_MsgRemove) Set(fd protoreflect.FieldDescriptor, value pr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRemove) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRemoveGovernor) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.MsgRemove.governor": - panic(fmt.Errorf("field governor of message chora.governor.v1.MsgRemove is not mutable")) + case "chora.governor.v1.MsgRemoveGovernor.address": + panic(fmt.Errorf("field address of message chora.governor.v1.MsgRemoveGovernor is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemove")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRemove does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgRemoveGovernor 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_MsgRemove) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRemoveGovernor) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.MsgRemove.governor": + case "chora.governor.v1.MsgRemoveGovernor.address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemove")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveGovernor")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRemove does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgRemoveGovernor 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_MsgRemove) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgRemoveGovernor) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.MsgRemove", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.MsgRemoveGovernor", d.FullName())) } panic("unreachable") } @@ -1134,7 +1134,7 @@ func (x *fastReflection_MsgRemove) WhichOneof(d protoreflect.OneofDescriptor) pr // 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_MsgRemove) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgRemoveGovernor) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1145,7 +1145,7 @@ func (x *fastReflection_MsgRemove) 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_MsgRemove) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgRemoveGovernor) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1157,7 +1157,7 @@ func (x *fastReflection_MsgRemove) SetUnknown(fields protoreflect.RawFields) { // 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_MsgRemove) IsValid() bool { +func (x *fastReflection_MsgRemoveGovernor) IsValid() bool { return x != nil } @@ -1167,9 +1167,9 @@ func (x *fastReflection_MsgRemove) 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_MsgRemove) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgRemoveGovernor) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgRemove) + x := input.Message.Interface().(*MsgRemoveGovernor) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1181,7 +1181,7 @@ func (x *fastReflection_MsgRemove) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Governor) + l = len(x.Address) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1195,7 +1195,7 @@ func (x *fastReflection_MsgRemove) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgRemove) + x := input.Message.Interface().(*MsgRemoveGovernor) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1214,10 +1214,10 @@ func (x *fastReflection_MsgRemove) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Governor) > 0 { - i -= len(x.Governor) - copy(dAtA[i:], x.Governor) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Governor))) + 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 } @@ -1232,7 +1232,7 @@ func (x *fastReflection_MsgRemove) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgRemove) + x := input.Message.Interface().(*MsgRemoveGovernor) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1264,15 +1264,15 @@ func (x *fastReflection_MsgRemove) 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: MsgRemove: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRemoveGovernor: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRemove: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRemoveGovernor: 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 Governor", wireType) + 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 { @@ -1300,7 +1300,7 @@ func (x *fastReflection_MsgRemove) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Governor = string(dAtA[iNdEx:postIndex]) + x.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1338,25 +1338,25 @@ func (x *fastReflection_MsgRemove) ProtoMethods() *protoiface.Methods { } var ( - md_MsgRemoveResponse protoreflect.MessageDescriptor - fd_MsgRemoveResponse_governor protoreflect.FieldDescriptor + md_MsgRemoveGovernorResponse protoreflect.MessageDescriptor + fd_MsgRemoveGovernorResponse_address protoreflect.FieldDescriptor ) func init() { file_chora_governor_v1_msg_proto_init() - md_MsgRemoveResponse = File_chora_governor_v1_msg_proto.Messages().ByName("MsgRemoveResponse") - fd_MsgRemoveResponse_governor = md_MsgRemoveResponse.Fields().ByName("governor") + md_MsgRemoveGovernorResponse = File_chora_governor_v1_msg_proto.Messages().ByName("MsgRemoveGovernorResponse") + fd_MsgRemoveGovernorResponse_address = md_MsgRemoveGovernorResponse.Fields().ByName("address") } -var _ protoreflect.Message = (*fastReflection_MsgRemoveResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MsgRemoveGovernorResponse)(nil) -type fastReflection_MsgRemoveResponse MsgRemoveResponse +type fastReflection_MsgRemoveGovernorResponse MsgRemoveGovernorResponse -func (x *MsgRemoveResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgRemoveResponse)(x) +func (x *MsgRemoveGovernorResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRemoveGovernorResponse)(x) } -func (x *MsgRemoveResponse) slowProtoReflect() protoreflect.Message { +func (x *MsgRemoveGovernorResponse) slowProtoReflect() protoreflect.Message { mi := &file_chora_governor_v1_msg_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1368,43 +1368,43 @@ func (x *MsgRemoveResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgRemoveResponse_messageType fastReflection_MsgRemoveResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgRemoveResponse_messageType{} +var _fastReflection_MsgRemoveGovernorResponse_messageType fastReflection_MsgRemoveGovernorResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgRemoveGovernorResponse_messageType{} -type fastReflection_MsgRemoveResponse_messageType struct{} +type fastReflection_MsgRemoveGovernorResponse_messageType struct{} -func (x fastReflection_MsgRemoveResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgRemoveResponse)(nil) +func (x fastReflection_MsgRemoveGovernorResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRemoveGovernorResponse)(nil) } -func (x fastReflection_MsgRemoveResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgRemoveResponse) +func (x fastReflection_MsgRemoveGovernorResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRemoveGovernorResponse) } -func (x fastReflection_MsgRemoveResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRemoveResponse +func (x fastReflection_MsgRemoveGovernorResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRemoveGovernorResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgRemoveResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRemoveResponse +func (x *fastReflection_MsgRemoveGovernorResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRemoveGovernorResponse } // 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_MsgRemoveResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgRemoveResponse_messageType +func (x *fastReflection_MsgRemoveGovernorResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgRemoveGovernorResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgRemoveResponse) New() protoreflect.Message { - return new(fastReflection_MsgRemoveResponse) +func (x *fastReflection_MsgRemoveGovernorResponse) New() protoreflect.Message { + return new(fastReflection_MsgRemoveGovernorResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgRemoveResponse) Interface() protoreflect.ProtoMessage { - return (*MsgRemoveResponse)(x) +func (x *fastReflection_MsgRemoveGovernorResponse) Interface() protoreflect.ProtoMessage { + return (*MsgRemoveGovernorResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -1412,10 +1412,10 @@ func (x *fastReflection_MsgRemoveResponse) 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_MsgRemoveResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Governor != "" { - value := protoreflect.ValueOfString(x.Governor) - if !f(fd_MsgRemoveResponse_governor, value) { +func (x *fastReflection_MsgRemoveGovernorResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_MsgRemoveGovernorResponse_address, value) { return } } @@ -1432,15 +1432,15 @@ func (x *fastReflection_MsgRemoveResponse) 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_MsgRemoveResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgRemoveGovernorResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "chora.governor.v1.MsgRemoveResponse.governor": - return x.Governor != "" + case "chora.governor.v1.MsgRemoveGovernorResponse.address": + return x.Address != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveGovernorResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRemoveResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgRemoveGovernorResponse does not contain field %s", fd.FullName())) } } @@ -1450,15 +1450,15 @@ func (x *fastReflection_MsgRemoveResponse) Has(fd protoreflect.FieldDescriptor) // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRemoveResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgRemoveGovernorResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "chora.governor.v1.MsgRemoveResponse.governor": - x.Governor = "" + case "chora.governor.v1.MsgRemoveGovernorResponse.address": + x.Address = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveGovernorResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRemoveResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgRemoveGovernorResponse does not contain field %s", fd.FullName())) } } @@ -1468,16 +1468,16 @@ func (x *fastReflection_MsgRemoveResponse) 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_MsgRemoveResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRemoveGovernorResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "chora.governor.v1.MsgRemoveResponse.governor": - value := x.Governor + case "chora.governor.v1.MsgRemoveGovernorResponse.address": + value := x.Address return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveGovernorResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRemoveResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgRemoveGovernorResponse does not contain field %s", descriptor.FullName())) } } @@ -1491,15 +1491,15 @@ func (x *fastReflection_MsgRemoveResponse) Get(descriptor protoreflect.FieldDesc // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRemoveResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgRemoveGovernorResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "chora.governor.v1.MsgRemoveResponse.governor": - x.Governor = value.Interface().(string) + case "chora.governor.v1.MsgRemoveGovernorResponse.address": + x.Address = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveGovernorResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRemoveResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgRemoveGovernorResponse does not contain field %s", fd.FullName())) } } @@ -1513,40 +1513,40 @@ func (x *fastReflection_MsgRemoveResponse) 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_MsgRemoveResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRemoveGovernorResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.MsgRemoveResponse.governor": - panic(fmt.Errorf("field governor of message chora.governor.v1.MsgRemoveResponse is not mutable")) + case "chora.governor.v1.MsgRemoveGovernorResponse.address": + panic(fmt.Errorf("field address of message chora.governor.v1.MsgRemoveGovernorResponse is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveGovernorResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRemoveResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgRemoveGovernorResponse 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_MsgRemoveResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRemoveGovernorResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.MsgRemoveResponse.governor": + case "chora.governor.v1.MsgRemoveGovernorResponse.address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgRemoveGovernorResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgRemoveResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgRemoveGovernorResponse 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_MsgRemoveResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgRemoveGovernorResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.MsgRemoveResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.MsgRemoveGovernorResponse", d.FullName())) } panic("unreachable") } @@ -1554,7 +1554,7 @@ func (x *fastReflection_MsgRemoveResponse) 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_MsgRemoveResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgRemoveGovernorResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1565,7 +1565,7 @@ func (x *fastReflection_MsgRemoveResponse) 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_MsgRemoveResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgRemoveGovernorResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1577,7 +1577,7 @@ func (x *fastReflection_MsgRemoveResponse) 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_MsgRemoveResponse) IsValid() bool { +func (x *fastReflection_MsgRemoveGovernorResponse) IsValid() bool { return x != nil } @@ -1587,9 +1587,9 @@ func (x *fastReflection_MsgRemoveResponse) 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_MsgRemoveResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgRemoveGovernorResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgRemoveResponse) + x := input.Message.Interface().(*MsgRemoveGovernorResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1601,7 +1601,7 @@ func (x *fastReflection_MsgRemoveResponse) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Governor) + l = len(x.Address) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1615,7 +1615,7 @@ func (x *fastReflection_MsgRemoveResponse) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgRemoveResponse) + x := input.Message.Interface().(*MsgRemoveGovernorResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1634,10 +1634,10 @@ func (x *fastReflection_MsgRemoveResponse) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Governor) > 0 { - i -= len(x.Governor) - copy(dAtA[i:], x.Governor) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Governor))) + 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 } @@ -1652,7 +1652,7 @@ func (x *fastReflection_MsgRemoveResponse) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgRemoveResponse) + x := input.Message.Interface().(*MsgRemoveGovernorResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1684,15 +1684,15 @@ func (x *fastReflection_MsgRemoveResponse) 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: MsgRemoveResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRemoveGovernorResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRemoveResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRemoveGovernorResponse: 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 Governor", wireType) + 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 { @@ -1720,7 +1720,7 @@ func (x *fastReflection_MsgRemoveResponse) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Governor = string(dAtA[iNdEx:postIndex]) + x.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1758,25 +1758,27 @@ func (x *fastReflection_MsgRemoveResponse) ProtoMethods() *protoiface.Methods { } var ( - md_MsgResign protoreflect.MessageDescriptor - fd_MsgResign_governor protoreflect.FieldDescriptor + md_MsgUpdateGovernorMetadata protoreflect.MessageDescriptor + fd_MsgUpdateGovernorMetadata_address protoreflect.FieldDescriptor + fd_MsgUpdateGovernorMetadata_new_metadata protoreflect.FieldDescriptor ) func init() { file_chora_governor_v1_msg_proto_init() - md_MsgResign = File_chora_governor_v1_msg_proto.Messages().ByName("MsgResign") - fd_MsgResign_governor = md_MsgResign.Fields().ByName("governor") + md_MsgUpdateGovernorMetadata = File_chora_governor_v1_msg_proto.Messages().ByName("MsgUpdateGovernorMetadata") + fd_MsgUpdateGovernorMetadata_address = md_MsgUpdateGovernorMetadata.Fields().ByName("address") + fd_MsgUpdateGovernorMetadata_new_metadata = md_MsgUpdateGovernorMetadata.Fields().ByName("new_metadata") } -var _ protoreflect.Message = (*fastReflection_MsgResign)(nil) +var _ protoreflect.Message = (*fastReflection_MsgUpdateGovernorMetadata)(nil) -type fastReflection_MsgResign MsgResign +type fastReflection_MsgUpdateGovernorMetadata MsgUpdateGovernorMetadata -func (x *MsgResign) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgResign)(x) +func (x *MsgUpdateGovernorMetadata) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateGovernorMetadata)(x) } -func (x *MsgResign) slowProtoReflect() protoreflect.Message { +func (x *MsgUpdateGovernorMetadata) slowProtoReflect() protoreflect.Message { mi := &file_chora_governor_v1_msg_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1788,43 +1790,43 @@ func (x *MsgResign) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgResign_messageType fastReflection_MsgResign_messageType -var _ protoreflect.MessageType = fastReflection_MsgResign_messageType{} +var _fastReflection_MsgUpdateGovernorMetadata_messageType fastReflection_MsgUpdateGovernorMetadata_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateGovernorMetadata_messageType{} -type fastReflection_MsgResign_messageType struct{} +type fastReflection_MsgUpdateGovernorMetadata_messageType struct{} -func (x fastReflection_MsgResign_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgResign)(nil) +func (x fastReflection_MsgUpdateGovernorMetadata_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateGovernorMetadata)(nil) } -func (x fastReflection_MsgResign_messageType) New() protoreflect.Message { - return new(fastReflection_MsgResign) +func (x fastReflection_MsgUpdateGovernorMetadata_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateGovernorMetadata) } -func (x fastReflection_MsgResign_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgResign +func (x fastReflection_MsgUpdateGovernorMetadata_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateGovernorMetadata } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgResign) Descriptor() protoreflect.MessageDescriptor { - return md_MsgResign +func (x *fastReflection_MsgUpdateGovernorMetadata) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateGovernorMetadata } // 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_MsgResign) Type() protoreflect.MessageType { - return _fastReflection_MsgResign_messageType +func (x *fastReflection_MsgUpdateGovernorMetadata) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateGovernorMetadata_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgResign) New() protoreflect.Message { - return new(fastReflection_MsgResign) +func (x *fastReflection_MsgUpdateGovernorMetadata) New() protoreflect.Message { + return new(fastReflection_MsgUpdateGovernorMetadata) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgResign) Interface() protoreflect.ProtoMessage { - return (*MsgResign)(x) +func (x *fastReflection_MsgUpdateGovernorMetadata) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateGovernorMetadata)(x) } // Range iterates over every populated field in an undefined order, @@ -1832,858 +1834,16 @@ func (x *fastReflection_MsgResign) 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_MsgResign) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Governor != "" { - value := protoreflect.ValueOfString(x.Governor) - if !f(fd_MsgResign_governor, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// 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_MsgResign) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "chora.governor.v1.MsgResign.governor": - return x.Governor != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgResign")) - } - panic(fmt.Errorf("message chora.governor.v1.MsgResign does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgResign) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "chora.governor.v1.MsgResign.governor": - x.Governor = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgResign")) - } - panic(fmt.Errorf("message chora.governor.v1.MsgResign does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// 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_MsgResign) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "chora.governor.v1.MsgResign.governor": - value := x.Governor - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgResign")) - } - panic(fmt.Errorf("message chora.governor.v1.MsgResign does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgResign) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "chora.governor.v1.MsgResign.governor": - x.Governor = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgResign")) - } - panic(fmt.Errorf("message chora.governor.v1.MsgResign does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgResign) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "chora.governor.v1.MsgResign.governor": - panic(fmt.Errorf("field governor of message chora.governor.v1.MsgResign is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgResign")) - } - panic(fmt.Errorf("message chora.governor.v1.MsgResign 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_MsgResign) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "chora.governor.v1.MsgResign.governor": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgResign")) - } - panic(fmt.Errorf("message chora.governor.v1.MsgResign 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_MsgResign) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.MsgResign", d.FullName())) - } - panic("unreachable") -} - -// 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_MsgResign) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgResign) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// 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_MsgResign) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_MsgResign) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgResign) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Governor) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgResign) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Governor) > 0 { - i -= len(x.Governor) - copy(dAtA[i:], x.Governor) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Governor))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgResign) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire 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++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgResign: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgResign: 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 Governor", 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.Governor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgResignResponse protoreflect.MessageDescriptor - fd_MsgResignResponse_governor protoreflect.FieldDescriptor -) - -func init() { - file_chora_governor_v1_msg_proto_init() - md_MsgResignResponse = File_chora_governor_v1_msg_proto.Messages().ByName("MsgResignResponse") - fd_MsgResignResponse_governor = md_MsgResignResponse.Fields().ByName("governor") -} - -var _ protoreflect.Message = (*fastReflection_MsgResignResponse)(nil) - -type fastReflection_MsgResignResponse MsgResignResponse - -func (x *MsgResignResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgResignResponse)(x) -} - -func (x *MsgResignResponse) slowProtoReflect() protoreflect.Message { - mi := &file_chora_governor_v1_msg_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgResignResponse_messageType fastReflection_MsgResignResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgResignResponse_messageType{} - -type fastReflection_MsgResignResponse_messageType struct{} - -func (x fastReflection_MsgResignResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgResignResponse)(nil) -} -func (x fastReflection_MsgResignResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgResignResponse) -} -func (x fastReflection_MsgResignResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgResignResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgResignResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgResignResponse -} - -// 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_MsgResignResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgResignResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgResignResponse) New() protoreflect.Message { - return new(fastReflection_MsgResignResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgResignResponse) Interface() protoreflect.ProtoMessage { - return (*MsgResignResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_MsgResignResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Governor != "" { - value := protoreflect.ValueOfString(x.Governor) - if !f(fd_MsgResignResponse_governor, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// 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_MsgResignResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "chora.governor.v1.MsgResignResponse.governor": - return x.Governor != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgResignResponse")) - } - panic(fmt.Errorf("message chora.governor.v1.MsgResignResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgResignResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "chora.governor.v1.MsgResignResponse.governor": - x.Governor = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgResignResponse")) - } - panic(fmt.Errorf("message chora.governor.v1.MsgResignResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// 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_MsgResignResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "chora.governor.v1.MsgResignResponse.governor": - value := x.Governor - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgResignResponse")) - } - panic(fmt.Errorf("message chora.governor.v1.MsgResignResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgResignResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "chora.governor.v1.MsgResignResponse.governor": - x.Governor = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgResignResponse")) - } - panic(fmt.Errorf("message chora.governor.v1.MsgResignResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgResignResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "chora.governor.v1.MsgResignResponse.governor": - panic(fmt.Errorf("field governor of message chora.governor.v1.MsgResignResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgResignResponse")) - } - panic(fmt.Errorf("message chora.governor.v1.MsgResignResponse 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_MsgResignResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "chora.governor.v1.MsgResignResponse.governor": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgResignResponse")) - } - panic(fmt.Errorf("message chora.governor.v1.MsgResignResponse 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_MsgResignResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.MsgResignResponse", d.FullName())) - } - panic("unreachable") -} - -// 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_MsgResignResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgResignResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// 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_MsgResignResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_MsgResignResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgResignResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Governor) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgResignResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Governor) > 0 { - i -= len(x.Governor) - copy(dAtA[i:], x.Governor) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Governor))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgResignResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire 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++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgResignResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgResignResponse: 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 Governor", 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.Governor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgUpdate protoreflect.MessageDescriptor - fd_MsgUpdate_governor protoreflect.FieldDescriptor - fd_MsgUpdate_new_metadata protoreflect.FieldDescriptor -) - -func init() { - file_chora_governor_v1_msg_proto_init() - md_MsgUpdate = File_chora_governor_v1_msg_proto.Messages().ByName("MsgUpdate") - fd_MsgUpdate_governor = md_MsgUpdate.Fields().ByName("governor") - fd_MsgUpdate_new_metadata = md_MsgUpdate.Fields().ByName("new_metadata") -} - -var _ protoreflect.Message = (*fastReflection_MsgUpdate)(nil) - -type fastReflection_MsgUpdate MsgUpdate - -func (x *MsgUpdate) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdate)(x) -} - -func (x *MsgUpdate) slowProtoReflect() protoreflect.Message { - mi := &file_chora_governor_v1_msg_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgUpdate_messageType fastReflection_MsgUpdate_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdate_messageType{} - -type fastReflection_MsgUpdate_messageType struct{} - -func (x fastReflection_MsgUpdate_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdate)(nil) -} -func (x fastReflection_MsgUpdate_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdate) -} -func (x fastReflection_MsgUpdate_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdate -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUpdate) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdate -} - -// 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_MsgUpdate) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdate_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdate) New() protoreflect.Message { - return new(fastReflection_MsgUpdate) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdate) Interface() protoreflect.ProtoMessage { - return (*MsgUpdate)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_MsgUpdate) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Governor != "" { - value := protoreflect.ValueOfString(x.Governor) - if !f(fd_MsgUpdate_governor, value) { +func (x *fastReflection_MsgUpdateGovernorMetadata) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_MsgUpdateGovernorMetadata_address, value) { return } } if x.NewMetadata != "" { value := protoreflect.ValueOfString(x.NewMetadata) - if !f(fd_MsgUpdate_new_metadata, value) { + if !f(fd_MsgUpdateGovernorMetadata_new_metadata, value) { return } } @@ -2700,17 +1860,17 @@ func (x *fastReflection_MsgUpdate) Range(f func(protoreflect.FieldDescriptor, pr // 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_MsgUpdate) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgUpdateGovernorMetadata) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "chora.governor.v1.MsgUpdate.governor": - return x.Governor != "" - case "chora.governor.v1.MsgUpdate.new_metadata": + case "chora.governor.v1.MsgUpdateGovernorMetadata.address": + return x.Address != "" + case "chora.governor.v1.MsgUpdateGovernorMetadata.new_metadata": return x.NewMetadata != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdate")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateGovernorMetadata")) } - panic(fmt.Errorf("message chora.governor.v1.MsgUpdate does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgUpdateGovernorMetadata does not contain field %s", fd.FullName())) } } @@ -2720,17 +1880,17 @@ func (x *fastReflection_MsgUpdate) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdate) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgUpdateGovernorMetadata) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "chora.governor.v1.MsgUpdate.governor": - x.Governor = "" - case "chora.governor.v1.MsgUpdate.new_metadata": + case "chora.governor.v1.MsgUpdateGovernorMetadata.address": + x.Address = "" + case "chora.governor.v1.MsgUpdateGovernorMetadata.new_metadata": x.NewMetadata = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdate")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateGovernorMetadata")) } - panic(fmt.Errorf("message chora.governor.v1.MsgUpdate does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgUpdateGovernorMetadata does not contain field %s", fd.FullName())) } } @@ -2740,19 +1900,19 @@ func (x *fastReflection_MsgUpdate) 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_MsgUpdate) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateGovernorMetadata) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "chora.governor.v1.MsgUpdate.governor": - value := x.Governor + case "chora.governor.v1.MsgUpdateGovernorMetadata.address": + value := x.Address return protoreflect.ValueOfString(value) - case "chora.governor.v1.MsgUpdate.new_metadata": + case "chora.governor.v1.MsgUpdateGovernorMetadata.new_metadata": value := x.NewMetadata return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdate")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateGovernorMetadata")) } - panic(fmt.Errorf("message chora.governor.v1.MsgUpdate does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgUpdateGovernorMetadata does not contain field %s", descriptor.FullName())) } } @@ -2766,17 +1926,17 @@ func (x *fastReflection_MsgUpdate) Get(descriptor protoreflect.FieldDescriptor) // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdate) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgUpdateGovernorMetadata) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "chora.governor.v1.MsgUpdate.governor": - x.Governor = value.Interface().(string) - case "chora.governor.v1.MsgUpdate.new_metadata": + case "chora.governor.v1.MsgUpdateGovernorMetadata.address": + x.Address = value.Interface().(string) + case "chora.governor.v1.MsgUpdateGovernorMetadata.new_metadata": x.NewMetadata = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdate")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateGovernorMetadata")) } - panic(fmt.Errorf("message chora.governor.v1.MsgUpdate does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgUpdateGovernorMetadata does not contain field %s", fd.FullName())) } } @@ -2790,44 +1950,44 @@ func (x *fastReflection_MsgUpdate) Set(fd protoreflect.FieldDescriptor, value pr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdate) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateGovernorMetadata) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.MsgUpdate.governor": - panic(fmt.Errorf("field governor of message chora.governor.v1.MsgUpdate is not mutable")) - case "chora.governor.v1.MsgUpdate.new_metadata": - panic(fmt.Errorf("field new_metadata of message chora.governor.v1.MsgUpdate is not mutable")) + case "chora.governor.v1.MsgUpdateGovernorMetadata.address": + panic(fmt.Errorf("field address of message chora.governor.v1.MsgUpdateGovernorMetadata is not mutable")) + case "chora.governor.v1.MsgUpdateGovernorMetadata.new_metadata": + panic(fmt.Errorf("field new_metadata of message chora.governor.v1.MsgUpdateGovernorMetadata is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdate")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateGovernorMetadata")) } - panic(fmt.Errorf("message chora.governor.v1.MsgUpdate does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgUpdateGovernorMetadata 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_MsgUpdate) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateGovernorMetadata) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.MsgUpdate.governor": + case "chora.governor.v1.MsgUpdateGovernorMetadata.address": return protoreflect.ValueOfString("") - case "chora.governor.v1.MsgUpdate.new_metadata": + case "chora.governor.v1.MsgUpdateGovernorMetadata.new_metadata": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdate")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateGovernorMetadata")) } - panic(fmt.Errorf("message chora.governor.v1.MsgUpdate does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgUpdateGovernorMetadata 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_MsgUpdate) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgUpdateGovernorMetadata) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.MsgUpdate", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.MsgUpdateGovernorMetadata", d.FullName())) } panic("unreachable") } @@ -2835,7 +1995,7 @@ func (x *fastReflection_MsgUpdate) WhichOneof(d protoreflect.OneofDescriptor) pr // 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_MsgUpdate) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgUpdateGovernorMetadata) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -2846,7 +2006,7 @@ func (x *fastReflection_MsgUpdate) 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_MsgUpdate) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgUpdateGovernorMetadata) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -2858,7 +2018,7 @@ func (x *fastReflection_MsgUpdate) SetUnknown(fields protoreflect.RawFields) { // 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_MsgUpdate) IsValid() bool { +func (x *fastReflection_MsgUpdateGovernorMetadata) IsValid() bool { return x != nil } @@ -2868,9 +2028,9 @@ func (x *fastReflection_MsgUpdate) 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_MsgUpdate) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgUpdateGovernorMetadata) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdate) + x := input.Message.Interface().(*MsgUpdateGovernorMetadata) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2882,7 +2042,7 @@ func (x *fastReflection_MsgUpdate) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Governor) + l = len(x.Address) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -2900,7 +2060,7 @@ func (x *fastReflection_MsgUpdate) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdate) + x := input.Message.Interface().(*MsgUpdateGovernorMetadata) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2926,10 +2086,10 @@ func (x *fastReflection_MsgUpdate) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x12 } - if len(x.Governor) > 0 { - i -= len(x.Governor) - copy(dAtA[i:], x.Governor) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Governor))) + 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 } @@ -2944,7 +2104,7 @@ func (x *fastReflection_MsgUpdate) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdate) + x := input.Message.Interface().(*MsgUpdateGovernorMetadata) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2976,15 +2136,15 @@ func (x *fastReflection_MsgUpdate) 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: MsgUpdate: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateGovernorMetadata: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateGovernorMetadata: 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 Governor", wireType) + 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 { @@ -3012,7 +2172,7 @@ func (x *fastReflection_MsgUpdate) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Governor = string(dAtA[iNdEx:postIndex]) + x.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -3082,26 +2242,26 @@ func (x *fastReflection_MsgUpdate) ProtoMethods() *protoiface.Methods { } var ( - md_MsgUpdateResponse protoreflect.MessageDescriptor - fd_MsgUpdateResponse_governor protoreflect.FieldDescriptor + md_MsgUpdateGovernorMetadataResponse protoreflect.MessageDescriptor + fd_MsgUpdateGovernorMetadataResponse_address protoreflect.FieldDescriptor ) func init() { file_chora_governor_v1_msg_proto_init() - md_MsgUpdateResponse = File_chora_governor_v1_msg_proto.Messages().ByName("MsgUpdateResponse") - fd_MsgUpdateResponse_governor = md_MsgUpdateResponse.Fields().ByName("governor") + md_MsgUpdateGovernorMetadataResponse = File_chora_governor_v1_msg_proto.Messages().ByName("MsgUpdateGovernorMetadataResponse") + fd_MsgUpdateGovernorMetadataResponse_address = md_MsgUpdateGovernorMetadataResponse.Fields().ByName("address") } -var _ protoreflect.Message = (*fastReflection_MsgUpdateResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MsgUpdateGovernorMetadataResponse)(nil) -type fastReflection_MsgUpdateResponse MsgUpdateResponse +type fastReflection_MsgUpdateGovernorMetadataResponse MsgUpdateGovernorMetadataResponse -func (x *MsgUpdateResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateResponse)(x) +func (x *MsgUpdateGovernorMetadataResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateGovernorMetadataResponse)(x) } -func (x *MsgUpdateResponse) slowProtoReflect() protoreflect.Message { - mi := &file_chora_governor_v1_msg_proto_msgTypes[7] +func (x *MsgUpdateGovernorMetadataResponse) slowProtoReflect() protoreflect.Message { + mi := &file_chora_governor_v1_msg_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3112,43 +2272,43 @@ func (x *MsgUpdateResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgUpdateResponse_messageType fastReflection_MsgUpdateResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateResponse_messageType{} +var _fastReflection_MsgUpdateGovernorMetadataResponse_messageType fastReflection_MsgUpdateGovernorMetadataResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateGovernorMetadataResponse_messageType{} -type fastReflection_MsgUpdateResponse_messageType struct{} +type fastReflection_MsgUpdateGovernorMetadataResponse_messageType struct{} -func (x fastReflection_MsgUpdateResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateResponse)(nil) +func (x fastReflection_MsgUpdateGovernorMetadataResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateGovernorMetadataResponse)(nil) } -func (x fastReflection_MsgUpdateResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateResponse) +func (x fastReflection_MsgUpdateGovernorMetadataResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateGovernorMetadataResponse) } -func (x fastReflection_MsgUpdateResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateResponse +func (x fastReflection_MsgUpdateGovernorMetadataResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateGovernorMetadataResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgUpdateResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateResponse +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateGovernorMetadataResponse } // 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_MsgUpdateResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateResponse_messageType +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateGovernorMetadataResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateResponse) New() protoreflect.Message { - return new(fastReflection_MsgUpdateResponse) +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateGovernorMetadataResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateResponse) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateResponse)(x) +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateGovernorMetadataResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -3156,10 +2316,10 @@ func (x *fastReflection_MsgUpdateResponse) 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_MsgUpdateResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Governor != "" { - value := protoreflect.ValueOfString(x.Governor) - if !f(fd_MsgUpdateResponse_governor, value) { +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_MsgUpdateGovernorMetadataResponse_address, value) { return } } @@ -3176,15 +2336,15 @@ func (x *fastReflection_MsgUpdateResponse) 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_MsgUpdateResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "chora.governor.v1.MsgUpdateResponse.governor": - return x.Governor != "" + case "chora.governor.v1.MsgUpdateGovernorMetadataResponse.address": + return x.Address != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateGovernorMetadataResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgUpdateResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgUpdateGovernorMetadataResponse does not contain field %s", fd.FullName())) } } @@ -3194,15 +2354,15 @@ func (x *fastReflection_MsgUpdateResponse) Has(fd protoreflect.FieldDescriptor) // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "chora.governor.v1.MsgUpdateResponse.governor": - x.Governor = "" + case "chora.governor.v1.MsgUpdateGovernorMetadataResponse.address": + x.Address = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateGovernorMetadataResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgUpdateResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgUpdateGovernorMetadataResponse does not contain field %s", fd.FullName())) } } @@ -3212,16 +2372,16 @@ func (x *fastReflection_MsgUpdateResponse) 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_MsgUpdateResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "chora.governor.v1.MsgUpdateResponse.governor": - value := x.Governor + case "chora.governor.v1.MsgUpdateGovernorMetadataResponse.address": + value := x.Address return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateGovernorMetadataResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgUpdateResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgUpdateGovernorMetadataResponse does not contain field %s", descriptor.FullName())) } } @@ -3235,15 +2395,15 @@ func (x *fastReflection_MsgUpdateResponse) Get(descriptor protoreflect.FieldDesc // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "chora.governor.v1.MsgUpdateResponse.governor": - x.Governor = value.Interface().(string) + case "chora.governor.v1.MsgUpdateGovernorMetadataResponse.address": + x.Address = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateGovernorMetadataResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgUpdateResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgUpdateGovernorMetadataResponse does not contain field %s", fd.FullName())) } } @@ -3257,40 +2417,40 @@ func (x *fastReflection_MsgUpdateResponse) 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_MsgUpdateResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.MsgUpdateResponse.governor": - panic(fmt.Errorf("field governor of message chora.governor.v1.MsgUpdateResponse is not mutable")) + case "chora.governor.v1.MsgUpdateGovernorMetadataResponse.address": + panic(fmt.Errorf("field address of message chora.governor.v1.MsgUpdateGovernorMetadataResponse is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateGovernorMetadataResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgUpdateResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgUpdateGovernorMetadataResponse 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_MsgUpdateResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.MsgUpdateResponse.governor": + case "chora.governor.v1.MsgUpdateGovernorMetadataResponse.address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: chora.governor.v1.MsgUpdateGovernorMetadataResponse")) } - panic(fmt.Errorf("message chora.governor.v1.MsgUpdateResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message chora.governor.v1.MsgUpdateGovernorMetadataResponse 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_MsgUpdateResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.MsgUpdateResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in chora.governor.v1.MsgUpdateGovernorMetadataResponse", d.FullName())) } panic("unreachable") } @@ -3298,7 +2458,7 @@ func (x *fastReflection_MsgUpdateResponse) 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_MsgUpdateResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -3309,7 +2469,7 @@ func (x *fastReflection_MsgUpdateResponse) 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_MsgUpdateResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -3321,7 +2481,7 @@ func (x *fastReflection_MsgUpdateResponse) 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_MsgUpdateResponse) IsValid() bool { +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) IsValid() bool { return x != nil } @@ -3331,9 +2491,9 @@ func (x *fastReflection_MsgUpdateResponse) 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_MsgUpdateResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgUpdateGovernorMetadataResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateResponse) + x := input.Message.Interface().(*MsgUpdateGovernorMetadataResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3345,7 +2505,7 @@ func (x *fastReflection_MsgUpdateResponse) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Governor) + l = len(x.Address) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -3359,7 +2519,7 @@ func (x *fastReflection_MsgUpdateResponse) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateResponse) + x := input.Message.Interface().(*MsgUpdateGovernorMetadataResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3378,10 +2538,10 @@ func (x *fastReflection_MsgUpdateResponse) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Governor) > 0 { - i -= len(x.Governor) - copy(dAtA[i:], x.Governor) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Governor))) + 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 } @@ -3396,7 +2556,7 @@ func (x *fastReflection_MsgUpdateResponse) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateResponse) + x := input.Message.Interface().(*MsgUpdateGovernorMetadataResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3428,15 +2588,15 @@ func (x *fastReflection_MsgUpdateResponse) 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: MsgUpdateResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateGovernorMetadataResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateGovernorMetadataResponse: 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 Governor", wireType) + 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 { @@ -3464,7 +2624,7 @@ func (x *fastReflection_MsgUpdateResponse) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Governor = string(dAtA[iNdEx:postIndex]) + x.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3514,20 +2674,20 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// MsgRegister is the Msg/Register request type. -type MsgRegister struct { +// MsgCreateGovernor is the Msg/CreateGovernor request type. +type MsgCreateGovernor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` + // address is the address of the governor. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // metadata is the metadata of the governor. Metadata string `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` } -func (x *MsgRegister) Reset() { - *x = MsgRegister{} +func (x *MsgCreateGovernor) Reset() { + *x = MsgCreateGovernor{} if protoimpl.UnsafeEnabled { mi := &file_chora_governor_v1_msg_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3535,43 +2695,43 @@ func (x *MsgRegister) Reset() { } } -func (x *MsgRegister) String() string { +func (x *MsgCreateGovernor) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgRegister) ProtoMessage() {} +func (*MsgCreateGovernor) ProtoMessage() {} -// Deprecated: Use MsgRegister.ProtoReflect.Descriptor instead. -func (*MsgRegister) Descriptor() ([]byte, []int) { +// Deprecated: Use MsgCreateGovernor.ProtoReflect.Descriptor instead. +func (*MsgCreateGovernor) Descriptor() ([]byte, []int) { return file_chora_governor_v1_msg_proto_rawDescGZIP(), []int{0} } -func (x *MsgRegister) GetGovernor() string { +func (x *MsgCreateGovernor) GetAddress() string { if x != nil { - return x.Governor + return x.Address } return "" } -func (x *MsgRegister) GetMetadata() string { +func (x *MsgCreateGovernor) GetMetadata() string { if x != nil { return x.Metadata } return "" } -// MsgRegisterResponse is the Msg/Register response type. -type MsgRegisterResponse struct { +// MsgCreateGovernorResponse is the Msg/CreateGovernor response type. +type MsgCreateGovernorResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` + // address is the address of the governor. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (x *MsgRegisterResponse) Reset() { - *x = MsgRegisterResponse{} +func (x *MsgCreateGovernorResponse) Reset() { + *x = MsgCreateGovernorResponse{} if protoimpl.UnsafeEnabled { mi := &file_chora_governor_v1_msg_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3579,36 +2739,36 @@ func (x *MsgRegisterResponse) Reset() { } } -func (x *MsgRegisterResponse) String() string { +func (x *MsgCreateGovernorResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgRegisterResponse) ProtoMessage() {} +func (*MsgCreateGovernorResponse) ProtoMessage() {} -// Deprecated: Use MsgRegisterResponse.ProtoReflect.Descriptor instead. -func (*MsgRegisterResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use MsgCreateGovernorResponse.ProtoReflect.Descriptor instead. +func (*MsgCreateGovernorResponse) Descriptor() ([]byte, []int) { return file_chora_governor_v1_msg_proto_rawDescGZIP(), []int{1} } -func (x *MsgRegisterResponse) GetGovernor() string { +func (x *MsgCreateGovernorResponse) GetAddress() string { if x != nil { - return x.Governor + return x.Address } return "" } -// MsgRemove is the Msg/Remove request type. -type MsgRemove struct { +// MsgRemoveGovernor is the Msg/RemoveGovernor request type. +type MsgRemoveGovernor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` + // address is the address of the governor. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (x *MsgRemove) Reset() { - *x = MsgRemove{} +func (x *MsgRemoveGovernor) Reset() { + *x = MsgRemoveGovernor{} if protoimpl.UnsafeEnabled { mi := &file_chora_governor_v1_msg_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3616,36 +2776,36 @@ func (x *MsgRemove) Reset() { } } -func (x *MsgRemove) String() string { +func (x *MsgRemoveGovernor) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgRemove) ProtoMessage() {} +func (*MsgRemoveGovernor) ProtoMessage() {} -// Deprecated: Use MsgRemove.ProtoReflect.Descriptor instead. -func (*MsgRemove) Descriptor() ([]byte, []int) { +// Deprecated: Use MsgRemoveGovernor.ProtoReflect.Descriptor instead. +func (*MsgRemoveGovernor) Descriptor() ([]byte, []int) { return file_chora_governor_v1_msg_proto_rawDescGZIP(), []int{2} } -func (x *MsgRemove) GetGovernor() string { +func (x *MsgRemoveGovernor) GetAddress() string { if x != nil { - return x.Governor + return x.Address } return "" } -// MsgRemoveResponse is the Msg/Remove response type. -type MsgRemoveResponse struct { +// MsgRemoveGovernorResponse is the Msg/RemoveGovernor response type. +type MsgRemoveGovernorResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` + // address is the address of the governor. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (x *MsgRemoveResponse) Reset() { - *x = MsgRemoveResponse{} +func (x *MsgRemoveGovernorResponse) Reset() { + *x = MsgRemoveGovernorResponse{} if protoimpl.UnsafeEnabled { mi := &file_chora_governor_v1_msg_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3653,177 +2813,104 @@ func (x *MsgRemoveResponse) Reset() { } } -func (x *MsgRemoveResponse) String() string { +func (x *MsgRemoveGovernorResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgRemoveResponse) ProtoMessage() {} +func (*MsgRemoveGovernorResponse) ProtoMessage() {} -// Deprecated: Use MsgRemoveResponse.ProtoReflect.Descriptor instead. -func (*MsgRemoveResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use MsgRemoveGovernorResponse.ProtoReflect.Descriptor instead. +func (*MsgRemoveGovernorResponse) Descriptor() ([]byte, []int) { return file_chora_governor_v1_msg_proto_rawDescGZIP(), []int{3} } -func (x *MsgRemoveResponse) GetGovernor() string { - if x != nil { - return x.Governor - } - return "" -} - -// MsgResign is the Msg/Resign request type. -type MsgResign struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` -} - -func (x *MsgResign) Reset() { - *x = MsgResign{} - if protoimpl.UnsafeEnabled { - mi := &file_chora_governor_v1_msg_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgResign) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgResign) ProtoMessage() {} - -// Deprecated: Use MsgResign.ProtoReflect.Descriptor instead. -func (*MsgResign) Descriptor() ([]byte, []int) { - return file_chora_governor_v1_msg_proto_rawDescGZIP(), []int{4} -} - -func (x *MsgResign) GetGovernor() string { - if x != nil { - return x.Governor - } - return "" -} - -// MsgResignResponse is the Msg/Resign response type. -type MsgResignResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` -} - -func (x *MsgResignResponse) Reset() { - *x = MsgResignResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_chora_governor_v1_msg_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgResignResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgResignResponse) ProtoMessage() {} - -// Deprecated: Use MsgResignResponse.ProtoReflect.Descriptor instead. -func (*MsgResignResponse) Descriptor() ([]byte, []int) { - return file_chora_governor_v1_msg_proto_rawDescGZIP(), []int{5} -} - -func (x *MsgResignResponse) GetGovernor() string { +func (x *MsgRemoveGovernorResponse) GetAddress() string { if x != nil { - return x.Governor + return x.Address } return "" } -// MsgUpdate is the Msg/Update request type. -type MsgUpdate struct { +// MsgUpdateGovernorMetadata is the Msg/UpdateGovernorMetadata request type. +type MsgUpdateGovernorMetadata struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` + // address is the address of the governor. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // new_metadata is the new metadata of the governor. NewMetadata string `protobuf:"bytes,2,opt,name=new_metadata,json=newMetadata,proto3" json:"new_metadata,omitempty"` } -func (x *MsgUpdate) Reset() { - *x = MsgUpdate{} +func (x *MsgUpdateGovernorMetadata) Reset() { + *x = MsgUpdateGovernorMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_chora_governor_v1_msg_proto_msgTypes[6] + mi := &file_chora_governor_v1_msg_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgUpdate) String() string { +func (x *MsgUpdateGovernorMetadata) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgUpdate) ProtoMessage() {} +func (*MsgUpdateGovernorMetadata) ProtoMessage() {} -// Deprecated: Use MsgUpdate.ProtoReflect.Descriptor instead. -func (*MsgUpdate) Descriptor() ([]byte, []int) { - return file_chora_governor_v1_msg_proto_rawDescGZIP(), []int{6} +// Deprecated: Use MsgUpdateGovernorMetadata.ProtoReflect.Descriptor instead. +func (*MsgUpdateGovernorMetadata) Descriptor() ([]byte, []int) { + return file_chora_governor_v1_msg_proto_rawDescGZIP(), []int{4} } -func (x *MsgUpdate) GetGovernor() string { +func (x *MsgUpdateGovernorMetadata) GetAddress() string { if x != nil { - return x.Governor + return x.Address } return "" } -func (x *MsgUpdate) GetNewMetadata() string { +func (x *MsgUpdateGovernorMetadata) GetNewMetadata() string { if x != nil { return x.NewMetadata } return "" } -// MsgUpdateResponse is the Msg/Update response type. -type MsgUpdateResponse struct { +// MsgUpdateGovernorMetadataResponse is the Msg/UpdateGovernorMetadata response +// type. +type MsgUpdateGovernorMetadataResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` + // address is the address of the governor. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (x *MsgUpdateResponse) Reset() { - *x = MsgUpdateResponse{} +func (x *MsgUpdateGovernorMetadataResponse) Reset() { + *x = MsgUpdateGovernorMetadataResponse{} if protoimpl.UnsafeEnabled { - mi := &file_chora_governor_v1_msg_proto_msgTypes[7] + mi := &file_chora_governor_v1_msg_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgUpdateResponse) String() string { +func (x *MsgUpdateGovernorMetadataResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgUpdateResponse) ProtoMessage() {} +func (*MsgUpdateGovernorMetadataResponse) ProtoMessage() {} -// Deprecated: Use MsgUpdateResponse.ProtoReflect.Descriptor instead. -func (*MsgUpdateResponse) Descriptor() ([]byte, []int) { - return file_chora_governor_v1_msg_proto_rawDescGZIP(), []int{7} +// Deprecated: Use MsgUpdateGovernorMetadataResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateGovernorMetadataResponse) Descriptor() ([]byte, []int) { + return file_chora_governor_v1_msg_proto_rawDescGZIP(), []int{5} } -func (x *MsgUpdateResponse) GetGovernor() string { +func (x *MsgUpdateGovernorMetadataResponse) GetAddress() string { if x != nil { - return x.Governor + return x.Address } return "" } @@ -3835,57 +2922,54 @@ var file_chora_governor_v1_msg_proto_rawDesc = []byte{ 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 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, 0x54, 0x0a, 0x0b, 0x4d, 0x73, 0x67, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x76, 0x65, - 0x72, 0x6e, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x6f, 0x76, 0x65, - 0x72, 0x6e, 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, 0x0d, 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x22, - 0x31, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, - 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, - 0x6f, 0x72, 0x22, 0x36, 0x0a, 0x09, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x12, - 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x3a, 0x0d, 0x82, 0xe7, 0xb0, - 0x2a, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x22, 0x2f, 0x0a, 0x11, 0x4d, 0x73, - 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x22, 0x36, 0x0a, 0x09, 0x4d, - 0x73, 0x67, 0x52, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x76, 0x65, - 0x72, 0x6e, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x6f, 0x76, 0x65, - 0x72, 0x6e, 0x6f, 0x72, 0x3a, 0x0d, 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, - 0x6e, 0x6f, 0x72, 0x22, 0x2f, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x69, 0x67, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x76, 0x65, - 0x72, 0x6e, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x6f, 0x76, 0x65, - 0x72, 0x6e, 0x6f, 0x72, 0x22, 0x59, 0x0a, 0x09, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x12, 0x21, 0x0a, - 0x0c, 0x6e, 0x65, 0x77, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x3a, 0x0d, 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x22, - 0x2f, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, - 0x32, 0xc3, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x52, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, - 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x1a, 0x26, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, - 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x06, - 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x12, 0x1c, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, - 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x1a, 0x24, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, + 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x57, 0x0a, 0x11, 0x4d, 0x73, 0x67, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 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, 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, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x22, 0x35, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, + 0x6f, 0x76, 0x65, 0x72, 0x6e, 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, 0x3b, 0x0a, 0x11, 0x4d, 0x73, 0x67, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 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, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x35, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 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, 0x66, 0x0a, + 0x19, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, + 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 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, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x5f, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x3d, 0x0a, 0x21, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 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, 0xcf, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x64, 0x0a, 0x0e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x12, 0x24, + 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, + 0x72, 0x6e, 0x6f, 0x72, 0x1a, 0x2c, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, + 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x64, 0x0a, 0x0e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x6f, 0x76, 0x65, + 0x72, 0x6e, 0x6f, 0x72, 0x12, 0x24, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x06, 0x52, 0x65, - 0x73, 0x69, 0x67, 0x6e, 0x12, 0x1c, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, - 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x69, - 0x67, 0x6e, 0x1a, 0x24, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, - 0x6e, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x69, 0x67, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, + 0x76, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x1a, 0x2c, 0x2e, 0x63, 0x68, 0x6f, + 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7c, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x2c, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x1a, 0x24, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, - 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x1a, 0x34, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, + 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x6f, + 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xcb, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x42, 0x67, 0x69, @@ -3914,28 +2998,24 @@ func file_chora_governor_v1_msg_proto_rawDescGZIP() []byte { return file_chora_governor_v1_msg_proto_rawDescData } -var file_chora_governor_v1_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_chora_governor_v1_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_chora_governor_v1_msg_proto_goTypes = []interface{}{ - (*MsgRegister)(nil), // 0: chora.governor.v1.MsgRegister - (*MsgRegisterResponse)(nil), // 1: chora.governor.v1.MsgRegisterResponse - (*MsgRemove)(nil), // 2: chora.governor.v1.MsgRemove - (*MsgRemoveResponse)(nil), // 3: chora.governor.v1.MsgRemoveResponse - (*MsgResign)(nil), // 4: chora.governor.v1.MsgResign - (*MsgResignResponse)(nil), // 5: chora.governor.v1.MsgResignResponse - (*MsgUpdate)(nil), // 6: chora.governor.v1.MsgUpdate - (*MsgUpdateResponse)(nil), // 7: chora.governor.v1.MsgUpdateResponse + (*MsgCreateGovernor)(nil), // 0: chora.governor.v1.MsgCreateGovernor + (*MsgCreateGovernorResponse)(nil), // 1: chora.governor.v1.MsgCreateGovernorResponse + (*MsgRemoveGovernor)(nil), // 2: chora.governor.v1.MsgRemoveGovernor + (*MsgRemoveGovernorResponse)(nil), // 3: chora.governor.v1.MsgRemoveGovernorResponse + (*MsgUpdateGovernorMetadata)(nil), // 4: chora.governor.v1.MsgUpdateGovernorMetadata + (*MsgUpdateGovernorMetadataResponse)(nil), // 5: chora.governor.v1.MsgUpdateGovernorMetadataResponse } var file_chora_governor_v1_msg_proto_depIdxs = []int32{ - 0, // 0: chora.governor.v1.Msg.Register:input_type -> chora.governor.v1.MsgRegister - 2, // 1: chora.governor.v1.Msg.Remove:input_type -> chora.governor.v1.MsgRemove - 4, // 2: chora.governor.v1.Msg.Resign:input_type -> chora.governor.v1.MsgResign - 6, // 3: chora.governor.v1.Msg.Update:input_type -> chora.governor.v1.MsgUpdate - 1, // 4: chora.governor.v1.Msg.Register:output_type -> chora.governor.v1.MsgRegisterResponse - 3, // 5: chora.governor.v1.Msg.Remove:output_type -> chora.governor.v1.MsgRemoveResponse - 5, // 6: chora.governor.v1.Msg.Resign:output_type -> chora.governor.v1.MsgResignResponse - 7, // 7: chora.governor.v1.Msg.Update:output_type -> chora.governor.v1.MsgUpdateResponse - 4, // [4:8] is the sub-list for method output_type - 0, // [0:4] is the sub-list for method input_type + 0, // 0: chora.governor.v1.Msg.CreateGovernor:input_type -> chora.governor.v1.MsgCreateGovernor + 2, // 1: chora.governor.v1.Msg.RemoveGovernor:input_type -> chora.governor.v1.MsgRemoveGovernor + 4, // 2: chora.governor.v1.Msg.UpdateGovernorMetadata:input_type -> chora.governor.v1.MsgUpdateGovernorMetadata + 1, // 3: chora.governor.v1.Msg.CreateGovernor:output_type -> chora.governor.v1.MsgCreateGovernorResponse + 3, // 4: chora.governor.v1.Msg.RemoveGovernor:output_type -> chora.governor.v1.MsgRemoveGovernorResponse + 5, // 5: chora.governor.v1.Msg.UpdateGovernorMetadata:output_type -> chora.governor.v1.MsgUpdateGovernorMetadataResponse + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -3948,7 +3028,7 @@ func file_chora_governor_v1_msg_proto_init() { } if !protoimpl.UnsafeEnabled { file_chora_governor_v1_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgRegister); i { + switch v := v.(*MsgCreateGovernor); i { case 0: return &v.state case 1: @@ -3960,7 +3040,7 @@ func file_chora_governor_v1_msg_proto_init() { } } file_chora_governor_v1_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgRegisterResponse); i { + switch v := v.(*MsgCreateGovernorResponse); i { case 0: return &v.state case 1: @@ -3972,7 +3052,7 @@ func file_chora_governor_v1_msg_proto_init() { } } file_chora_governor_v1_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgRemove); i { + switch v := v.(*MsgRemoveGovernor); i { case 0: return &v.state case 1: @@ -3984,7 +3064,7 @@ func file_chora_governor_v1_msg_proto_init() { } } file_chora_governor_v1_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgRemoveResponse); i { + switch v := v.(*MsgRemoveGovernorResponse); i { case 0: return &v.state case 1: @@ -3996,7 +3076,7 @@ func file_chora_governor_v1_msg_proto_init() { } } file_chora_governor_v1_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgResign); i { + switch v := v.(*MsgUpdateGovernorMetadata); i { case 0: return &v.state case 1: @@ -4008,31 +3088,7 @@ func file_chora_governor_v1_msg_proto_init() { } } file_chora_governor_v1_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgResignResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_chora_governor_v1_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_chora_governor_v1_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateResponse); i { + switch v := v.(*MsgUpdateGovernorMetadataResponse); i { case 0: return &v.state case 1: @@ -4050,7 +3106,7 @@ func file_chora_governor_v1_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_chora_governor_v1_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, diff --git a/governor/api/v1/msg_grpc.pb.go b/governor/api/v1/msg_grpc.pb.go index 69b85af..af0bf08 100644 --- a/governor/api/v1/msg_grpc.pb.go +++ b/governor/api/v1/msg_grpc.pb.go @@ -19,10 +19,9 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - Msg_Register_FullMethodName = "/chora.governor.v1.Msg/Register" - Msg_Remove_FullMethodName = "/chora.governor.v1.Msg/Remove" - Msg_Resign_FullMethodName = "/chora.governor.v1.Msg/Resign" - Msg_Update_FullMethodName = "/chora.governor.v1.Msg/Update" + Msg_CreateGovernor_FullMethodName = "/chora.governor.v1.Msg/CreateGovernor" + Msg_RemoveGovernor_FullMethodName = "/chora.governor.v1.Msg/RemoveGovernor" + Msg_UpdateGovernorMetadata_FullMethodName = "/chora.governor.v1.Msg/UpdateGovernorMetadata" ) // MsgClient is the client API for Msg service. @@ -31,14 +30,12 @@ const ( // // Msg is the Msg service. type MsgClient interface { - // Register registers a governor (any account). - Register(ctx context.Context, in *MsgRegister, opts ...grpc.CallOption) (*MsgRegisterResponse, error) - // Remove removes a governor (only admin account). - Remove(ctx context.Context, in *MsgRemove, opts ...grpc.CallOption) (*MsgRemoveResponse, error) - // Resign resigns a governor (only governor account). - Resign(ctx context.Context, in *MsgResign, opts ...grpc.CallOption) (*MsgResignResponse, error) - // Update updates a governor (only governor account). - Update(ctx context.Context, in *MsgUpdate, opts ...grpc.CallOption) (*MsgUpdateResponse, error) + // CreateGovernor registers a governor. + CreateGovernor(ctx context.Context, in *MsgCreateGovernor, opts ...grpc.CallOption) (*MsgCreateGovernorResponse, error) + // RemoveGovernor removes a governor. + RemoveGovernor(ctx context.Context, in *MsgRemoveGovernor, opts ...grpc.CallOption) (*MsgRemoveGovernorResponse, error) + // UpdateGovernorMetadata updates a governor. + UpdateGovernorMetadata(ctx context.Context, in *MsgUpdateGovernorMetadata, opts ...grpc.CallOption) (*MsgUpdateGovernorMetadataResponse, error) } type msgClient struct { @@ -49,40 +46,30 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { return &msgClient{cc} } -func (c *msgClient) Register(ctx context.Context, in *MsgRegister, opts ...grpc.CallOption) (*MsgRegisterResponse, error) { +func (c *msgClient) CreateGovernor(ctx context.Context, in *MsgCreateGovernor, opts ...grpc.CallOption) (*MsgCreateGovernorResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgRegisterResponse) - err := c.cc.Invoke(ctx, Msg_Register_FullMethodName, in, out, cOpts...) + out := new(MsgCreateGovernorResponse) + err := c.cc.Invoke(ctx, Msg_CreateGovernor_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *msgClient) Remove(ctx context.Context, in *MsgRemove, opts ...grpc.CallOption) (*MsgRemoveResponse, error) { +func (c *msgClient) RemoveGovernor(ctx context.Context, in *MsgRemoveGovernor, opts ...grpc.CallOption) (*MsgRemoveGovernorResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgRemoveResponse) - err := c.cc.Invoke(ctx, Msg_Remove_FullMethodName, in, out, cOpts...) + out := new(MsgRemoveGovernorResponse) + err := c.cc.Invoke(ctx, Msg_RemoveGovernor_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *msgClient) Resign(ctx context.Context, in *MsgResign, opts ...grpc.CallOption) (*MsgResignResponse, error) { +func (c *msgClient) UpdateGovernorMetadata(ctx context.Context, in *MsgUpdateGovernorMetadata, opts ...grpc.CallOption) (*MsgUpdateGovernorMetadataResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgResignResponse) - err := c.cc.Invoke(ctx, Msg_Resign_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Update(ctx context.Context, in *MsgUpdate, opts ...grpc.CallOption) (*MsgUpdateResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUpdateResponse) - err := c.cc.Invoke(ctx, Msg_Update_FullMethodName, in, out, cOpts...) + out := new(MsgUpdateGovernorMetadataResponse) + err := c.cc.Invoke(ctx, Msg_UpdateGovernorMetadata_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -95,14 +82,12 @@ func (c *msgClient) Update(ctx context.Context, in *MsgUpdate, opts ...grpc.Call // // Msg is the Msg service. type MsgServer interface { - // Register registers a governor (any account). - Register(context.Context, *MsgRegister) (*MsgRegisterResponse, error) - // Remove removes a governor (only admin account). - Remove(context.Context, *MsgRemove) (*MsgRemoveResponse, error) - // Resign resigns a governor (only governor account). - Resign(context.Context, *MsgResign) (*MsgResignResponse, error) - // Update updates a governor (only governor account). - Update(context.Context, *MsgUpdate) (*MsgUpdateResponse, error) + // CreateGovernor registers a governor. + CreateGovernor(context.Context, *MsgCreateGovernor) (*MsgCreateGovernorResponse, error) + // RemoveGovernor removes a governor. + RemoveGovernor(context.Context, *MsgRemoveGovernor) (*MsgRemoveGovernorResponse, error) + // UpdateGovernorMetadata updates a governor. + UpdateGovernorMetadata(context.Context, *MsgUpdateGovernorMetadata) (*MsgUpdateGovernorMetadataResponse, error) mustEmbedUnimplementedMsgServer() } @@ -113,17 +98,14 @@ type MsgServer interface { // pointer dereference when methods are called. type UnimplementedMsgServer struct{} -func (UnimplementedMsgServer) Register(context.Context, *MsgRegister) (*MsgRegisterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") -} -func (UnimplementedMsgServer) Remove(context.Context, *MsgRemove) (*MsgRemoveResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Remove not implemented") +func (UnimplementedMsgServer) CreateGovernor(context.Context, *MsgCreateGovernor) (*MsgCreateGovernorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateGovernor not implemented") } -func (UnimplementedMsgServer) Resign(context.Context, *MsgResign) (*MsgResignResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Resign not implemented") +func (UnimplementedMsgServer) RemoveGovernor(context.Context, *MsgRemoveGovernor) (*MsgRemoveGovernorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveGovernor not implemented") } -func (UnimplementedMsgServer) Update(context.Context, *MsgUpdate) (*MsgUpdateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") +func (UnimplementedMsgServer) UpdateGovernorMetadata(context.Context, *MsgUpdateGovernorMetadata) (*MsgUpdateGovernorMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateGovernorMetadata not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} func (UnimplementedMsgServer) testEmbeddedByValue() {} @@ -146,74 +128,56 @@ func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { s.RegisterService(&Msg_ServiceDesc, srv) } -func _Msg_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRegister) +func _Msg_CreateGovernor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateGovernor) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).Register(ctx, in) + return srv.(MsgServer).CreateGovernor(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Msg_Register_FullMethodName, + FullMethod: Msg_CreateGovernor_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Register(ctx, req.(*MsgRegister)) + return srv.(MsgServer).CreateGovernor(ctx, req.(*MsgCreateGovernor)) } return interceptor(ctx, in, info, handler) } -func _Msg_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRemove) +func _Msg_RemoveGovernor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRemoveGovernor) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).Remove(ctx, in) + return srv.(MsgServer).RemoveGovernor(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Msg_Remove_FullMethodName, + FullMethod: Msg_RemoveGovernor_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Remove(ctx, req.(*MsgRemove)) + return srv.(MsgServer).RemoveGovernor(ctx, req.(*MsgRemoveGovernor)) } return interceptor(ctx, in, info, handler) } -func _Msg_Resign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgResign) +func _Msg_UpdateGovernorMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateGovernorMetadata) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).Resign(ctx, in) + return srv.(MsgServer).UpdateGovernorMetadata(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Msg_Resign_FullMethodName, + FullMethod: Msg_UpdateGovernorMetadata_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Resign(ctx, req.(*MsgResign)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdate) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Update(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_Update_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Update(ctx, req.(*MsgUpdate)) + return srv.(MsgServer).UpdateGovernorMetadata(ctx, req.(*MsgUpdateGovernorMetadata)) } return interceptor(ctx, in, info, handler) } @@ -226,20 +190,16 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "Register", - Handler: _Msg_Register_Handler, - }, - { - MethodName: "Remove", - Handler: _Msg_Remove_Handler, + MethodName: "CreateGovernor", + Handler: _Msg_CreateGovernor_Handler, }, { - MethodName: "Resign", - Handler: _Msg_Resign_Handler, + MethodName: "RemoveGovernor", + Handler: _Msg_RemoveGovernor_Handler, }, { - MethodName: "Update", - Handler: _Msg_Update_Handler, + MethodName: "UpdateGovernorMetadata", + Handler: _Msg_UpdateGovernorMetadata_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/governor/api/v1/state.cosmos_orm.go b/governor/api/v1/state.cosmos_orm.go index 12a6efc..9afd2b0 100644 --- a/governor/api/v1/state.cosmos_orm.go +++ b/governor/api/v1/state.cosmos_orm.go @@ -14,9 +14,9 @@ type GovernorTable interface { Update(ctx context.Context, governor *Governor) error Save(ctx context.Context, governor *Governor) error Delete(ctx context.Context, governor *Governor) error - Has(ctx context.Context, governor string) (found bool, err error) + Has(ctx context.Context, address []byte) (found bool, err error) // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, governor string) (*Governor, error) + Get(ctx context.Context, address []byte) (*Governor, error) List(ctx context.Context, prefixKey GovernorIndexKey, opts ...ormlist.Option) (GovernorIterator, error) ListRange(ctx context.Context, from, to GovernorIndexKey, opts ...ormlist.Option) (GovernorIterator, error) DeleteBy(ctx context.Context, prefixKey GovernorIndexKey) error @@ -42,18 +42,18 @@ type GovernorIndexKey interface { } // primary key starting index.. -type GovernorPrimaryKey = GovernorGovernorIndexKey +type GovernorPrimaryKey = GovernorAddressIndexKey -type GovernorGovernorIndexKey struct { +type GovernorAddressIndexKey struct { vs []interface{} } -func (x GovernorGovernorIndexKey) id() uint32 { return 0 } -func (x GovernorGovernorIndexKey) values() []interface{} { return x.vs } -func (x GovernorGovernorIndexKey) governorIndexKey() {} +func (x GovernorAddressIndexKey) id() uint32 { return 0 } +func (x GovernorAddressIndexKey) values() []interface{} { return x.vs } +func (x GovernorAddressIndexKey) governorIndexKey() {} -func (this GovernorGovernorIndexKey) WithGovernor(governor string) GovernorGovernorIndexKey { - this.vs = []interface{}{governor} +func (this GovernorAddressIndexKey) WithAddress(address []byte) GovernorAddressIndexKey { + this.vs = []interface{}{address} return this } @@ -77,13 +77,13 @@ func (this governorTable) Delete(ctx context.Context, governor *Governor) error return this.table.Delete(ctx, governor) } -func (this governorTable) Has(ctx context.Context, governor string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, governor) +func (this governorTable) Has(ctx context.Context, address []byte) (found bool, err error) { + return this.table.PrimaryKey().Has(ctx, address) } -func (this governorTable) Get(ctx context.Context, governor string) (*Governor, error) { +func (this governorTable) Get(ctx context.Context, address []byte) (*Governor, error) { var governor Governor - found, err := this.table.PrimaryKey().Get(ctx, &governor, governor) + found, err := this.table.PrimaryKey().Get(ctx, &governor, address) if err != nil { return nil, err } diff --git a/governor/api/v1/state.pulsar.go b/governor/api/v1/state.pulsar.go index 893acbf..36eb832 100644 --- a/governor/api/v1/state.pulsar.go +++ b/governor/api/v1/state.pulsar.go @@ -15,14 +15,14 @@ import ( var ( md_Governor protoreflect.MessageDescriptor - fd_Governor_governor protoreflect.FieldDescriptor + fd_Governor_address protoreflect.FieldDescriptor fd_Governor_metadata protoreflect.FieldDescriptor ) func init() { file_chora_governor_v1_state_proto_init() md_Governor = File_chora_governor_v1_state_proto.Messages().ByName("Governor") - fd_Governor_governor = md_Governor.Fields().ByName("governor") + fd_Governor_address = md_Governor.Fields().ByName("address") fd_Governor_metadata = md_Governor.Fields().ByName("metadata") } @@ -91,9 +91,9 @@ func (x *fastReflection_Governor) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Governor) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Governor != "" { - value := protoreflect.ValueOfString(x.Governor) - if !f(fd_Governor_governor, value) { + if len(x.Address) != 0 { + value := protoreflect.ValueOfBytes(x.Address) + if !f(fd_Governor_address, value) { return } } @@ -118,8 +118,8 @@ func (x *fastReflection_Governor) Range(f func(protoreflect.FieldDescriptor, pro // a repeated field is populated if it is non-empty. func (x *fastReflection_Governor) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "chora.governor.v1.Governor.governor": - return x.Governor != "" + case "chora.governor.v1.Governor.address": + return len(x.Address) != 0 case "chora.governor.v1.Governor.metadata": return x.Metadata != "" default: @@ -138,8 +138,8 @@ func (x *fastReflection_Governor) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Governor) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "chora.governor.v1.Governor.governor": - x.Governor = "" + case "chora.governor.v1.Governor.address": + x.Address = nil case "chora.governor.v1.Governor.metadata": x.Metadata = "" default: @@ -158,9 +158,9 @@ func (x *fastReflection_Governor) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Governor) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "chora.governor.v1.Governor.governor": - value := x.Governor - return protoreflect.ValueOfString(value) + case "chora.governor.v1.Governor.address": + value := x.Address + return protoreflect.ValueOfBytes(value) case "chora.governor.v1.Governor.metadata": value := x.Metadata return protoreflect.ValueOfString(value) @@ -184,8 +184,8 @@ func (x *fastReflection_Governor) Get(descriptor protoreflect.FieldDescriptor) p // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Governor) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "chora.governor.v1.Governor.governor": - x.Governor = value.Interface().(string) + case "chora.governor.v1.Governor.address": + x.Address = value.Bytes() case "chora.governor.v1.Governor.metadata": x.Metadata = value.Interface().(string) default: @@ -208,8 +208,8 @@ func (x *fastReflection_Governor) Set(fd protoreflect.FieldDescriptor, value pro // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Governor) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.Governor.governor": - panic(fmt.Errorf("field governor of message chora.governor.v1.Governor is not mutable")) + case "chora.governor.v1.Governor.address": + panic(fmt.Errorf("field address of message chora.governor.v1.Governor is not mutable")) case "chora.governor.v1.Governor.metadata": panic(fmt.Errorf("field metadata of message chora.governor.v1.Governor is not mutable")) default: @@ -225,8 +225,8 @@ func (x *fastReflection_Governor) Mutable(fd protoreflect.FieldDescriptor) proto // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Governor) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "chora.governor.v1.Governor.governor": - return protoreflect.ValueOfString("") + case "chora.governor.v1.Governor.address": + return protoreflect.ValueOfBytes(nil) case "chora.governor.v1.Governor.metadata": return protoreflect.ValueOfString("") default: @@ -298,7 +298,7 @@ func (x *fastReflection_Governor) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Governor) + l = len(x.Address) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -342,10 +342,10 @@ func (x *fastReflection_Governor) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x12 } - if len(x.Governor) > 0 { - i -= len(x.Governor) - copy(dAtA[i:], x.Governor) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Governor))) + 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 } @@ -400,9 +400,9 @@ func (x *fastReflection_Governor) 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 Governor", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -412,23 +412,25 @@ func (x *fastReflection_Governor) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen 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.Governor = string(dAtA[iNdEx:postIndex]) + x.Address = append(x.Address[:0], dAtA[iNdEx:postIndex]...) + if x.Address == nil { + x.Address = []byte{} + } iNdEx = postIndex case 2: if wireType != 2 { @@ -516,8 +518,8 @@ type Governor struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` + // address is the address of the governor. + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // metadata is the metadata of the governor. Metadata string `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` } @@ -542,11 +544,11 @@ func (*Governor) Descriptor() ([]byte, []int) { return file_chora_governor_v1_state_proto_rawDescGZIP(), []int{0} } -func (x *Governor) GetGovernor() string { +func (x *Governor) GetAddress() []byte { if x != nil { - return x.Governor + return x.Address } - return "" + return nil } func (x *Governor) GetMetadata() string { @@ -563,26 +565,26 @@ var file_chora_governor_v1_state_proto_rawDesc = []byte{ 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 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, 0x58, 0x0a, 0x08, 0x47, - 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, - 0x6e, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, - 0x6e, 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, - 0x14, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x0e, 0x0a, 0x0a, 0x0a, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, - 0x6e, 0x6f, 0x72, 0x18, 0x02, 0x42, 0xcd, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, - 0x6f, 0x72, 0x61, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, - 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x42, 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, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2f, 0x67, 0x6f, 0x76, 0x65, 0x72, - 0x6e, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x76, - 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x2e, - 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x43, 0x68, - 0x6f, 0x72, 0x61, 0x5c, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x1d, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x5c, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, - 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x13, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, - 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x55, 0x0a, 0x08, 0x47, + 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 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, 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, 0x13, 0xf2, + 0x9e, 0xd3, 0x8e, 0x03, 0x0d, 0x0a, 0x09, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x42, 0xcd, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x61, + 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x42, 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, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x2f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, + 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x47, 0x6f, 0x76, + 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x43, 0x68, 0x6f, 0x72, 0x61, + 0x5c, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, 0x43, + 0x68, 0x6f, 0x72, 0x61, 0x5c, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, + 0x68, 0x6f, 0x72, 0x61, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/governor/cmd/tx.go b/governor/cmd/tx.go index cd3977e..6dbe8ae 100644 --- a/governor/cmd/tx.go +++ b/governor/cmd/tx.go @@ -19,7 +19,7 @@ func TxCmd() *cobra.Command { } cmd.AddCommand( - TxAddGovernorCmd(), + TxCreateGovernorCmd(), TxRemoveGovernorCmd(), TxUpdateGovernorCmd(), ) diff --git a/governor/cmd/tx_add_governor.go b/governor/cmd/tx_create_governor.go similarity index 67% rename from governor/cmd/tx_add_governor.go rename to governor/cmd/tx_create_governor.go index 486c22f..4f76ae1 100644 --- a/governor/cmd/tx_add_governor.go +++ b/governor/cmd/tx_create_governor.go @@ -10,23 +10,22 @@ import ( v1 "github.com/chora-io/mods/governor/types/v1" ) -// TxAddGovernorCmd creates and returns the tx add command. -func TxAddGovernorCmd() *cobra.Command { +// TxCreateGovernorCmd creates and returns the tx add command. +func TxCreateGovernorCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "add-governor [address] [metadata]", + Use: "create-governor [metadata]", Short: "submit a transaction to add a governor", Long: "submit a transaction to add a governor", - 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.MsgAddGovernor{ - Admin: clientCtx.GetFromAddress().String(), - Address: args[0], - Metadata: args[1], + msg := v1.MsgCreateGovernor{ + Address: clientCtx.GetFromAddress().String(), + Metadata: args[0], } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) diff --git a/governor/cmd/tx_remove_governor.go b/governor/cmd/tx_remove_governor.go index 3759823..3dbb77e 100644 --- a/governor/cmd/tx_remove_governor.go +++ b/governor/cmd/tx_remove_governor.go @@ -13,10 +13,10 @@ import ( // TxRemoveGovernorCmd creates and returns the tx remove command. func TxRemoveGovernorCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "remove-governor [address]", + Use: "remove-governor", Short: "submit a transaction to remove a governor", Long: "submit a transaction to remove a governor", - Args: cobra.ExactArgs(1), + Args: cobra.ExactArgs(0), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -24,8 +24,7 @@ func TxRemoveGovernorCmd() *cobra.Command { } msg := v1.MsgRemoveGovernor{ - Admin: clientCtx.GetFromAddress().String(), - Address: args[0], + Address: clientCtx.GetFromAddress().String(), } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) diff --git a/governor/cmd/tx_update_governor.go b/governor/cmd/tx_update_governor_metadata.go similarity index 90% rename from governor/cmd/tx_update_governor.go rename to governor/cmd/tx_update_governor_metadata.go index 1c956b5..409afc4 100644 --- a/governor/cmd/tx_update_governor.go +++ b/governor/cmd/tx_update_governor_metadata.go @@ -13,7 +13,7 @@ import ( // TxUpdateGovernorCmd creates and returns the tx update command. func TxUpdateGovernorCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "update-governor [new-metadata]", + Use: "update-governor-metadata [new-metadata]", Short: "submit a transaction to update governor metadata", Long: "submit a transaction to update governor metadata", Args: cobra.ExactArgs(1), @@ -23,7 +23,7 @@ func TxUpdateGovernorCmd() *cobra.Command { return err } - msg := v1.MsgUpdateGovernor{ + msg := v1.MsgUpdateGovernorMetadata{ Address: clientCtx.GetFromAddress().String(), NewMetadata: args[0], } diff --git a/governor/genesis/genesis.go b/governor/genesis/genesis.go index 248af16..1fb08ec 100644 --- a/governor/genesis/genesis.go +++ b/governor/genesis/genesis.go @@ -24,7 +24,7 @@ func ValidateGenesis(bz json.RawMessage) error { func validateJSON(bz json.RawMessage) error { _, err := ormdb.NewModuleDB(&governor.ModuleSchema, ormdb.ModuleDBOptions{ - JSONGovernor: validateMsg, + JSONValidator: validateMsg, }) if err != nil { return err diff --git a/governor/genesis/genesis_test.go b/governor/genesis/genesis_test.go index d52d6f8..47d65c8 100644 --- a/governor/genesis/genesis_test.go +++ b/governor/genesis/genesis_test.go @@ -26,7 +26,7 @@ func TestValidateGenesis(t *testing.T) { name: "valid", setup: func(ctx context.Context, ss governorv1.StateStore) { require.NoError(t, ss.GovernorTable().Insert(ctx, &governorv1.Governor{ - Address: "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + Address: []byte("BTZfSbi0JKqguZ/tIAPUIhdAa7Y="), Metadata: "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf", })) }, diff --git a/governor/keeper/features/msg_add_governor.feature b/governor/keeper/features/msg_add_governor.feature deleted file mode 100644 index bcb3088..0000000 --- a/governor/keeper/features/msg_add_governor.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/governor/keeper/features/msg_remove_governor.feature b/governor/keeper/features/msg_remove_governor.feature deleted file mode 100644 index 78b9b22..0000000 --- a/governor/keeper/features/msg_remove_governor.feature +++ /dev/null @@ -1,235 +0,0 @@ -Feature: Msg/RemoveValidator - - RemoveValidator is successful when: - - admin is the admin address - - validator with address exists - - RemoveValidator has the following outcomes: - - Validator is removed from state - - ValidatorSigningInfo is removed from state - - 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 - """ - { - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", - "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" - } - """ - And validator signing info - """ - { - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", - "missed_blocks": [], - "missed_blocks_count": 0 - } - """ - - Scenario: validator exists - When msg remove validator - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" - } - """ - Then expect no error - - Scenario: validator does not exist - When msg remove validator - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - } - """ - Then expect the error - """ - validator with address chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38: not found: not found - """ - - Rule: Validator is removed from state - - 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: state validator removed - When msg remove validator - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" - } - """ - Then expect no validator with address "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" - - # No failing scenario - state is never updated when message fails - - Rule: ValidatorSigningInfo is removed from state - - 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: state validator removed - When msg remove validator - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" - } - """ - Then expect no validator signing info with address "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" - - # No failing scenario - state is never updated when message fails - - Rule: EventRemoveValidator emitted - - 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: event remove emitted - When msg remove validator - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" - } - """ - Then expect event remove - """ - { - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" - } - """ - - # No failing scenario - event is never emitted when message fails - - Rule: MsgRemoveValidatorResponse is returned - - 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: message response returned - When msg remove validator - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" - } - """ - Then expect response - """ - { - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" - } - """ - - # No failing scenario - response is never returned when message fails diff --git a/governor/keeper/keeper.go b/governor/keeper/keeper.go index 343808d..4b15a99 100644 --- a/governor/keeper/keeper.go +++ b/governor/keeper/keeper.go @@ -5,7 +5,6 @@ import ( "cosmossdk.io/core/store" "cosmossdk.io/orm/model/ormdb" - abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -76,100 +75,3 @@ func (k Keeper) ExportGenesis(ctx sdk.Context, _ codec.JSONCodec) (json.RawMessa return nil, nil } - -// GetPolicy gets the governor signing policy. -func (k Keeper) GetPolicy(ctx sdk.Context) (*governorv1.Policy, error) { - policy, err := k.ss.PolicyTable().Get(ctx) - if err != nil { - return nil, err - } - return policy, nil -} - -// HandleSigningInfo tracks governor signing info and enforces the policy. -func (k Keeper) HandleSigningInfo(ctx sdk.Context, voteInfo abci.VoteInfo, policy *governorv1.Policy) error { - height := ctx.BlockHeight() - - // set governor address - address := sdk.ConsAddress(voteInfo.Governor.Address) - - // get governor signing info - signingInfo, err := k.ss.GovernorSigningInfoTable().Get(ctx, address.String()) - if err != nil { - return err // internal error - } - - // Compute the relative index, so we count the blocks the governor *should* - // have signed. We will use the 0-value default signing info if not present, - // except for start height. The index is in the range [0, SignedBlocksWindow) - // and is used to see if a governor signed a block at the given height - index := signingInfo.IndexOffset % policy.SignedBlocksWindow - - // increment index offset - signingInfo.IndexOffset++ - - // missed and missed previous - missed := signingInfo.MissedBlocks[height].Missed - missedPrevious := signingInfo.MissedBlocks[index].Missed - - switch { - case missed && !missedPrevious: - signingInfo.MissedBlocks[index].Missed = true - signingInfo.MissedBlocksCount++ - case !missed && missedPrevious: - signingInfo.MissedBlocks[index].Missed = false - signingInfo.MissedBlocksCount-- - default: - // bitmap value at this index has not changed - } - - minSignedPerWindow := policy.MinSignedPerWindow - - if missed { - // emit missed block event - if err = ctx.EventManager().EmitTypedEvent(&v1.EventMissedBlock{ - Address: address.String(), - }); err != nil { - return err // internal error - } - } - - minHeight := signingInfo.StartHeight + policy.SignedBlocksWindow - maxMissed := policy.SignedBlocksWindow - minSignedPerWindow - - // remove governor if governor missed blocks exceeds max missed blocks - if height > minHeight && signingInfo.MissedBlocksCount > maxMissed { - // get governor - governor, err := k.ss.GovernorTable().Get(ctx, address.String()) - if err != nil { - return err // internal error - } - - // delete governor - err = k.ss.GovernorTable().Delete(ctx, governor) - if err != nil { - return err // internal error - } - - // delete governor signing info - err = k.ss.GovernorSigningInfoTable().Delete(ctx, signingInfo) - if err != nil { - return err // internal error - } - - // emit remove governor event - if err = ctx.EventManager().EmitTypedEvent(&v1.EventRemoveGovernor{ - Address: address.String(), - }); err != nil { - return err // internal error - } - } else { - // update governor signing info - err = k.ss.GovernorSigningInfoTable().Update(ctx, signingInfo) - if err != nil { - return err // internal error - } - } - - return nil -} diff --git a/governor/keeper/msg_add_governor.go b/governor/keeper/msg_add_governor.go deleted file mode 100644 index 67a2e45..0000000 --- a/governor/keeper/msg_add_governor.go +++ /dev/null @@ -1,52 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - governorv1 "github.com/chora-io/mods/governor/api/v1" - v1 "github.com/chora-io/mods/governor/types/v1" -) - -// AddGovernor implements Msg/AddGovernor. -func (k Keeper) AddGovernor(ctx context.Context, req *v1.MsgAddGovernor) (*v1.MsgAddGovernorResponse, 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, - ) - } - - // insert governor into governor table - err := k.ss.GovernorTable().Insert(ctx, &governorv1.Governor{ - Address: req.Address, - Metadata: req.Metadata, - }) - if err != nil { - return nil, err // internal error - } - - // insert governor into governor signing info table - err = k.ss.GovernorSigningInfoTable().Insert(ctx, &governorv1.GovernorSigningInfo{ - Address: req.Address, - }) - if err != nil { - return nil, err // internal error - } - - // emit event - if err = sdkCtx.EventManager().EmitTypedEvent(&v1.EventAddGovernor{ - Address: req.Address, - }); err != nil { - return nil, err // internal error - } - - // return response - return &v1.MsgAddGovernorResponse{ - Address: req.Address, - }, nil -} diff --git a/governor/keeper/msg_create_governor.feature b/governor/keeper/msg_create_governor.feature new file mode 100644 index 0000000..7cfd9fc --- /dev/null +++ b/governor/keeper/msg_create_governor.feature @@ -0,0 +1,82 @@ +Feature: Msg/CreateGovernor + + Msg/CreateGovernor is successful when: + - always (an error is never returned) + + Msg/CreateGovernor has the following outcomes: + - Governor is added to state + - EventCreateGovernor is emitted + - MsgCreateGovernorResponse is returned + + Rule: An error is never returned + + Scenario: never error + When msg create governor + """ + { + "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + Then expect no error + + Rule: Governor is added to state + + Scenario: state governor added + When msg create governor + """ + { + "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + Then expect state governor + """ + { + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + + # No failing scenario - state is never updated when message fails + + Rule: EventCreateGovernor is emitted + + Scenario: event create governor emitted + When msg create governor + """ + { + "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + Then expect event create governor + """ + { + "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" + } + """ + + # No failing scenario - event is never emitted when message fails + + Rule: MsgCreateGovernorResponse is returned + + Background: + Given admin "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" + + Scenario: message response returned + When msg create governor + """ + { + "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + Then expect response + """ + { + "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" + } + """ + + # No failing scenario - response is never returned when message fails diff --git a/governor/keeper/msg_create_governor.go b/governor/keeper/msg_create_governor.go new file mode 100644 index 0000000..094a20c --- /dev/null +++ b/governor/keeper/msg_create_governor.go @@ -0,0 +1,41 @@ +package keeper + +import ( + "context" + + governorv1 "github.com/chora-io/mods/governor/api/v1" + v1 "github.com/chora-io/mods/governor/types/v1" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// CreateGovernor implements Msg/CreateGovernor. +func (k Keeper) CreateGovernor(ctx context.Context, req *v1.MsgCreateGovernor) (*v1.MsgCreateGovernorResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + // get account address from address + address, err := sdk.AccAddressFromBech32(req.Address) + if err != nil { + return nil, err // internal error + } + + // insert governor into governor table + err = k.ss.GovernorTable().Insert(ctx, &governorv1.Governor{ + Address: address, + Metadata: req.Metadata, + }) + if err != nil { + return nil, err // internal error + } + + // emit event + if err = sdkCtx.EventManager().EmitTypedEvent(&v1.EventCreateGovernor{ + Address: req.Address, + }); err != nil { + return nil, err // internal error + } + + // return response + return &v1.MsgCreateGovernorResponse{ + Address: req.Address, + }, nil +} diff --git a/governor/keeper/msg_add_governor_test.go b/governor/keeper/msg_create_governor_test.go similarity index 60% rename from governor/keeper/msg_add_governor_test.go rename to governor/keeper/msg_create_governor_test.go index 5c740be..7f51850 100644 --- a/governor/keeper/msg_add_governor_test.go +++ b/governor/keeper/msg_create_governor_test.go @@ -12,51 +12,51 @@ import ( "github.com/chora-io/mods/governor/utils" ) -type msgAddGovernor struct { +type msgCreateGovernor struct { *baseSuite - res *v1.MsgAddGovernorResponse + res *v1.MsgCreateGovernorResponse err error } -func TestMsgAddGovernor(t *testing.T) { - gocuke.NewRunner(t, &msgAddGovernor{}). - Path("./features/msg_add_governor.feature"). +func TestMsgCreateGovernor(t *testing.T) { + gocuke.NewRunner(t, &msgCreateGovernor{}). + Path("./msg_create_governor.feature"). Run() } -func (s *msgAddGovernor) Before(t gocuke.TestingT) { +func (s *msgCreateGovernor) Before(t gocuke.TestingT) { s.baseSuite = setupBase(t) } -func (s *msgAddGovernor) Admin(a string) { +func (s *msgCreateGovernor) Admin(a string) { require.Equal(s.t, s.admin.String(), a) } -func (s *msgAddGovernor) MsgAddGovernor(a gocuke.DocString) { - var msg v1.MsgAddGovernor +func (s *msgCreateGovernor) MsgCreateGovernor(a gocuke.DocString) { + var msg v1.MsgCreateGovernor err := jsonpb.UnmarshalString(a.Content, &msg) require.NoError(s.t, err) - s.res, s.err = s.k.AddGovernor(s.sdkCtx, &msg) + s.res, s.err = s.k.CreateGovernor(s.sdkCtx, &msg) } -func (s *msgAddGovernor) ExpectNoError() { +func (s *msgCreateGovernor) ExpectNoError() { require.NoError(s.t, s.err) } -func (s *msgAddGovernor) ExpectTheError(a gocuke.DocString) { +func (s *msgCreateGovernor) ExpectTheError(a gocuke.DocString) { require.EqualError(s.t, s.err, a.Content) } -func (s *msgAddGovernor) ExpectResponse(a gocuke.DocString) { - var expected v1.MsgAddGovernorResponse +func (s *msgCreateGovernor) ExpectResponse(a gocuke.DocString) { + var expected v1.MsgCreateGovernorResponse err := jsonpb.UnmarshalString(a.Content, &expected) require.NoError(s.t, err) require.Equal(s.t, &expected, s.res) } -func (s *msgAddGovernor) ExpectStateGovernor(a gocuke.DocString) { +func (s *msgCreateGovernor) ExpectStateGovernor(a gocuke.DocString) { var expected governorv1.Governor err := jsonpb.UnmarshalString(a.Content, &expected) require.NoError(s.t, err) @@ -68,8 +68,8 @@ func (s *msgAddGovernor) ExpectStateGovernor(a gocuke.DocString) { require.Equal(s.t, expected.Metadata, actual.Metadata) } -func (s *msgAddGovernor) ExpectEventAdd(a gocuke.DocString) { - var expected v1.EventAddGovernor +func (s *msgCreateGovernor) ExpectEventCreateGovernor(a gocuke.DocString) { + var expected v1.EventCreateGovernor err := jsonpb.UnmarshalString(a.Content, &expected) require.NoError(s.t, err) diff --git a/governor/keeper/msg_remove_governor.feature b/governor/keeper/msg_remove_governor.feature new file mode 100644 index 0000000..720975e --- /dev/null +++ b/governor/keeper/msg_remove_governor.feature @@ -0,0 +1,150 @@ +Feature: Msg/RemoveGovernor + + RemoveGovernor is successful when: + - address is the governor address + - governor with address exists + + RemoveGovernor has the following outcomes: + - Governor is removed from state + - EventRemoveGovernor is emitted + - MsgRemoveGovernorResponse is returned + + Rule: The admin must be the governor address + + Background: + Given governor + """ + { + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + + Scenario: address is governor address + When msg remove governor + """ + { + "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" + } + """ + Then expect no error + + Scenario: address is not governor address + When msg remove governor + """ + { + "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" + } + """ + Then expect the error + """ + governor with address chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup: not found: not found + """ + + Rule: The governor must exist + + Background: + Given governor + """ + { + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + + Scenario: governor exists + When msg remove governor + """ + { + "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" + } + """ + Then expect no error + + Scenario: governor does not exist + When msg remove governor + """ + { + "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" + } + """ + Then expect the error + """ + governor with address chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup: not found: not found + """ + + Rule: Governor is removed from state + + Background: + Given governor + """ + { + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + + Scenario: state governor removed + When msg remove governor + """ + { + "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" + } + """ + Then expect no governor with address "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" + + # No failing scenario - state is never updated when message fails + + Rule: EventRemoveGovernor emitted + + Background: + Given governor + """ + { + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + + Scenario: event remove emitted + When msg remove governor + """ + { + "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" + } + """ + Then expect event remove + """ + { + "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" + } + """ + + # No failing scenario - event is never emitted when message fails + + Rule: MsgRemoveGovernorResponse is returned + + Background: + Given governor + """ + { + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", + "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" + } + """ + + Scenario: message response returned + When msg remove governor + """ + { + "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" + } + """ + Then expect response + """ + { + "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" + } + """ + + # No failing scenario - response is never returned when message fails diff --git a/governor/keeper/msg_remove_governor.go b/governor/keeper/msg_remove_governor.go index 2bf019e..90ff2bf 100644 --- a/governor/keeper/msg_remove_governor.go +++ b/governor/keeper/msg_remove_governor.go @@ -14,30 +14,18 @@ import ( func (k Keeper) RemoveGovernor(ctx context.Context, req *v1.MsgRemoveGovernor) (*v1.MsgRemoveGovernorResponse, 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 governor from governor table - governor, err := k.ss.GovernorTable().Get(ctx, req.Address) + // get account address from address + address, err := sdk.AccAddressFromBech32(req.Address) if err != nil { - if ormerrors.NotFound.Is(err) { - return nil, sdkerrors.ErrNotFound.Wrapf( - "governor with address %s: %s", req.Address, err, - ) - } return nil, err // internal error } - // get signing info from governor signing info table - signingInfo, err := k.ss.GovernorSigningInfoTable().Get(ctx, req.Address) + // get governor from governor table + governor, err := k.ss.GovernorTable().Get(ctx, address) if err != nil { if ormerrors.NotFound.Is(err) { return nil, sdkerrors.ErrNotFound.Wrapf( - "governor signing info with address %s", req.Address, + "governor with address %s: %s", req.Address, err, ) } return nil, err // internal error @@ -49,12 +37,6 @@ func (k Keeper) RemoveGovernor(ctx context.Context, req *v1.MsgRemoveGovernor) ( return nil, err // internal error } - // delete governor from governor signing info table - err = k.ss.GovernorSigningInfoTable().Delete(ctx, signingInfo) - if err != nil { - return nil, err // internal error - } - // emit event if err = sdkCtx.EventManager().EmitTypedEvent(&v1.EventRemoveGovernor{ Address: req.Address, diff --git a/governor/keeper/msg_remove_governor_test.go b/governor/keeper/msg_remove_governor_test.go index d6991f0..9a4f169 100644 --- a/governor/keeper/msg_remove_governor_test.go +++ b/governor/keeper/msg_remove_governor_test.go @@ -3,6 +3,7 @@ package keeper import ( "testing" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/gogoproto/jsonpb" "github.com/regen-network/gocuke" "github.com/stretchr/testify/require" @@ -20,7 +21,7 @@ type msgRemoveGovernor struct { func TestMsgRemoveGovernor(t *testing.T) { gocuke.NewRunner(t, &msgRemoveGovernor{}). - Path("./features/msg_remove_governor.feature"). + Path("./msg_remove_governor.feature"). Run() } @@ -43,18 +44,6 @@ func (s *msgRemoveGovernor) Governor(a gocuke.DocString) { require.NoError(s.t, err) } -func (s *msgRemoveGovernor) GovernorSigningInfo(a gocuke.DocString) { - var missedBlocks governorv1.GovernorSigningInfo - err := jsonpb.UnmarshalString(a.Content, &missedBlocks) - require.NoError(s.t, err) - - err = s.k.ss.GovernorSigningInfoTable().Insert(s.sdkCtx, &governorv1.GovernorSigningInfo{ - Address: missedBlocks.Address, - MissedBlocks: missedBlocks.MissedBlocks, - }) - require.NoError(s.t, err) -} - func (s *msgRemoveGovernor) MsgRemoveGovernor(a gocuke.DocString) { var msg v1.MsgRemoveGovernor err := jsonpb.UnmarshalString(a.Content, &msg) @@ -80,13 +69,7 @@ func (s *msgRemoveGovernor) ExpectResponse(a gocuke.DocString) { } func (s *msgRemoveGovernor) ExpectNoGovernorWithAddress(a string) { - found, err := s.k.ss.GovernorTable().Has(s.sdkCtx, a) - require.NoError(s.t, err) - require.False(s.t, found) -} - -func (s *msgRemoveGovernor) ExpectNoGovernorSigningInfoWithAddress(a string) { - found, err := s.k.ss.GovernorSigningInfoTable().Has(s.sdkCtx, a) + found, err := s.k.ss.GovernorTable().Has(s.sdkCtx, sdk.AccAddress(a)) require.NoError(s.t, err) require.False(s.t, found) } diff --git a/governor/keeper/features/msg_update_governor.feature b/governor/keeper/msg_update_governor_metadata.feature similarity index 62% rename from governor/keeper/features/msg_update_governor.feature rename to governor/keeper/msg_update_governor_metadata.feature index 04329f2..ce0c53b 100644 --- a/governor/keeper/features/msg_update_governor.feature +++ b/governor/keeper/msg_update_governor_metadata.feature @@ -1,26 +1,26 @@ -Feature: Msg/UpdateValidator +Feature: Msg/UpdateGovernorMetadata - UpdateValidator is successful when: - - validator with address exists + UpdateGovernorMetadata is successful when: + - governor with address exists - UpdateValidator has the following outcomes: - - Validator is updated in state - - EventUpdateValidator is emitted - - MsgUpdateValidatorResponse is returned + UpdateGovernorMetadata has the following outcomes: + - Governor is updated in state + - EventUpdateGovernorMetadata is emitted + - MsgUpdateGovernorMetadataResponse is returned - Rule: The validator must exist + Rule: The governor must exist Background: - Given validator + Given governor """ { - "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" } """ - Scenario: validator exists - When msg update validator + Scenario: governor exists + When msg update governor metadata """ { "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", @@ -29,8 +29,8 @@ Feature: Msg/UpdateValidator """ Then expect no error - Scenario: validator does not exist - When msg update validator + Scenario: governor does not exist + When msg update governor metadata """ { "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", @@ -39,58 +39,58 @@ Feature: Msg/UpdateValidator """ Then expect the error """ - validator with address chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup: not found: not found + governor with address chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup: not found: not found """ - Rule: Validator is updated in state + Rule: Governor is updated in state Background: - Given validator + Given governor """ { - "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" } """ - Scenario: state validator updated - When msg update validator + Scenario: state governor updated + When msg update governor metadata """ { "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", "new_metadata": "chora:13toVfwypkE1AwUzQmuBHk28WWwCa5QCynCrBuoYgMvN2iroywJ5Vi1.rdf" } """ - Then expect state validator + Then expect state governor """ { - "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", "metadata": "chora:13toVfwypkE1AwUzQmuBHk28WWwCa5QCynCrBuoYgMvN2iroywJ5Vi1.rdf" } """ # No failing scenario - state is never updated when message fails - Rule: EventUpdateValidator emitted + Rule: EventUpdateGovernorMetadata emitted Background: - Given validator + Given governor """ { - "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" } """ - Scenario: event update validator emitted - When msg update validator + Scenario: event update governor emitted + When msg update governor metadata """ { "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", "new_metadata": "chora:13toVfwypkE1AwUzQmuBHk28WWwCa5QCynCrBuoYgMvN2iroywJ5Vi1.rdf" } """ - Then expect event update validator + Then expect event update governor """ { "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" @@ -99,19 +99,19 @@ Feature: Msg/UpdateValidator # No failing scenario - event is never emitted when message fails - Rule: MsgUpdateValidatorResponse is returned + Rule: MsgUpdateGovernorMetadataResponse is returned Background: - Given validator + Given governor """ { - "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" } """ Scenario: message response returned - When msg update validator + When msg update governor metadata """ { "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", diff --git a/governor/keeper/msg_update_governor.go b/governor/keeper/msg_update_governor_metadata.go similarity index 65% rename from governor/keeper/msg_update_governor.go rename to governor/keeper/msg_update_governor_metadata.go index b5df620..af036e6 100644 --- a/governor/keeper/msg_update_governor.go +++ b/governor/keeper/msg_update_governor_metadata.go @@ -10,12 +10,18 @@ import ( v1 "github.com/chora-io/mods/governor/types/v1" ) -// UpdateGovernor implements the Msg/UpdateGovernor method. -func (k Keeper) UpdateGovernor(ctx context.Context, req *v1.MsgUpdateGovernor) (*v1.MsgUpdateGovernorResponse, error) { +// UpdateGovernorMetadata implements the Msg/UpdateGovernorMetadata method. +func (k Keeper) UpdateGovernorMetadata(ctx context.Context, req *v1.MsgUpdateGovernorMetadata) (*v1.MsgUpdateGovernorMetadataResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) + // get account address from address + address, err := sdk.AccAddressFromBech32(req.Address) + if err != nil { + return nil, err // internal error + } + // get governor from governor table - governor, err := k.ss.GovernorTable().Get(ctx, req.Address) + governor, err := k.ss.GovernorTable().Get(ctx, address) if err != nil { if ormerrors.NotFound.Is(err) { return nil, sdkerrors.ErrNotFound.Wrapf("governor with address %s: %s", req.Address, err) @@ -33,14 +39,14 @@ func (k Keeper) UpdateGovernor(ctx context.Context, req *v1.MsgUpdateGovernor) ( } // emit event - if err = sdkCtx.EventManager().EmitTypedEvent(&v1.EventUpdateGovernor{ + if err = sdkCtx.EventManager().EmitTypedEvent(&v1.EventUpdateGovernorMetadata{ Address: req.Address, }); err != nil { return nil, err // internal error } // return response - return &v1.MsgUpdateGovernorResponse{ + return &v1.MsgUpdateGovernorMetadataResponse{ Address: req.Address, }, nil } diff --git a/governor/keeper/msg_update_governor_test.go b/governor/keeper/msg_update_governor_metadata_test.go similarity index 59% rename from governor/keeper/msg_update_governor_test.go rename to governor/keeper/msg_update_governor_metadata_test.go index c40a99d..97d2d38 100644 --- a/governor/keeper/msg_update_governor_test.go +++ b/governor/keeper/msg_update_governor_metadata_test.go @@ -12,23 +12,23 @@ import ( "github.com/chora-io/mods/governor/utils" ) -type msgUpdateGovernor struct { +type msgUpdateGovernorMetadata struct { *baseSuite - res *v1.MsgUpdateGovernorResponse + res *v1.MsgUpdateGovernorMetadataResponse err error } -func TestMsgUpdateGovernor(t *testing.T) { - gocuke.NewRunner(t, &msgUpdateGovernor{}). - Path("./features/msg_update_governor.feature"). +func TestMsgUpdateGovernorMetadata(t *testing.T) { + gocuke.NewRunner(t, &msgUpdateGovernorMetadata{}). + Path("./msg_update_governor_metadata.feature"). Run() } -func (s *msgUpdateGovernor) Before(t gocuke.TestingT) { +func (s *msgUpdateGovernorMetadata) Before(t gocuke.TestingT) { s.baseSuite = setupBase(t) } -func (s *msgUpdateGovernor) Governor(a gocuke.DocString) { +func (s *msgUpdateGovernorMetadata) Governor(a gocuke.DocString) { var governor governorv1.Governor err := jsonpb.UnmarshalString(a.Content, &governor) require.NoError(s.t, err) @@ -39,31 +39,31 @@ func (s *msgUpdateGovernor) Governor(a gocuke.DocString) { require.NoError(s.t, err) } -func (s *msgUpdateGovernor) MsgUpdateGovernor(a gocuke.DocString) { - var msg v1.MsgUpdateGovernor +func (s *msgUpdateGovernorMetadata) MsgUpdateGovernorMetadata(a gocuke.DocString) { + var msg v1.MsgUpdateGovernorMetadata err := jsonpb.UnmarshalString(a.Content, &msg) require.NoError(s.t, err) - s.res, s.err = s.k.UpdateGovernor(s.sdkCtx, &msg) + s.res, s.err = s.k.UpdateGovernorMetadata(s.sdkCtx, &msg) } -func (s *msgUpdateGovernor) ExpectNoError() { +func (s *msgUpdateGovernorMetadata) ExpectNoError() { require.NoError(s.t, s.err) } -func (s *msgUpdateGovernor) ExpectTheError(a gocuke.DocString) { +func (s *msgUpdateGovernorMetadata) ExpectTheError(a gocuke.DocString) { require.EqualError(s.t, s.err, a.Content) } -func (s *msgUpdateGovernor) ExpectResponse(a gocuke.DocString) { - var expected v1.MsgUpdateGovernorResponse +func (s *msgUpdateGovernorMetadata) ExpectResponse(a gocuke.DocString) { + var expected v1.MsgUpdateGovernorMetadataResponse err := jsonpb.UnmarshalString(a.Content, &expected) require.NoError(s.t, err) require.Equal(s.t, &expected, s.res) } -func (s *msgUpdateGovernor) ExpectStateGovernor(a gocuke.DocString) { +func (s *msgUpdateGovernorMetadata) ExpectStateGovernor(a gocuke.DocString) { var expected governorv1.Governor err := jsonpb.UnmarshalString(a.Content, &expected) require.NoError(s.t, err) @@ -75,8 +75,8 @@ func (s *msgUpdateGovernor) ExpectStateGovernor(a gocuke.DocString) { require.Equal(s.t, expected.Metadata, actual.Metadata) } -func (s *msgUpdateGovernor) ExpectEventUpdateGovernor(a gocuke.DocString) { - var expected v1.EventUpdateGovernor +func (s *msgUpdateGovernorMetadata) ExpectEventUpdateGovernor(a gocuke.DocString) { + var expected v1.EventUpdateGovernorMetadata err := jsonpb.UnmarshalString(a.Content, &expected) require.NoError(s.t, err) diff --git a/governor/keeper/msg_update_policy.go b/governor/keeper/msg_update_policy.go deleted file mode 100644 index e4856a9..0000000 --- a/governor/keeper/msg_update_policy.go +++ /dev/null @@ -1,54 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - v1 "github.com/chora-io/mods/governor/types/v1" -) - -// UpdatePolicy implements Msg/UpdatePolicy. -func (k Keeper) UpdatePolicy(ctx context.Context, req *v1.MsgUpdatePolicy) (*v1.MsgUpdatePolicyResponse, 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 governor policy from policy table - policy, err := k.ss.PolicyTable().Get(ctx) - if err != nil { - return nil, err // internal error - } - - // set signed blocks window - policy.SignedBlocksWindow = req.SignedBlocksWindow - - // set min signed per window - policy.MinSignedPerWindow = req.MinSignedPerWindow - - // update governor policy in policy table - err = k.ss.PolicyTable().Save(ctx, policy) - if err != nil { - return nil, err // internal error - } - - // emit event - if err = sdkCtx.EventManager().EmitTypedEvent(&v1.EventUpdatePolicy{ - SignedBlocksWindow: req.SignedBlocksWindow, - MinSignedPerWindow: req.MinSignedPerWindow, - }); err != nil { - return nil, err // internal error - } - - // return response - return &v1.MsgUpdatePolicyResponse{ - SignedBlocksWindow: req.SignedBlocksWindow, - MinSignedPerWindow: req.MinSignedPerWindow, - }, nil -} diff --git a/governor/keeper/msg_update_policy_test.go b/governor/keeper/msg_update_policy_test.go deleted file mode 100644 index fad5308..0000000 --- a/governor/keeper/msg_update_policy_test.go +++ /dev/null @@ -1,89 +0,0 @@ -package keeper - -import ( - "testing" - - "github.com/cosmos/gogoproto/jsonpb" - "github.com/regen-network/gocuke" - "github.com/stretchr/testify/require" - - governorv1 "github.com/chora-io/mods/governor/api/v1" - v1 "github.com/chora-io/mods/governor/types/v1" - "github.com/chora-io/mods/governor/utils" -) - -type msgUpdatePolicy struct { - *baseSuite - res *v1.MsgUpdatePolicyResponse - err error -} - -func TestMsgUpdatePolicy(t *testing.T) { - gocuke.NewRunner(t, &msgUpdatePolicy{}). - Path("./features/msg_update_policy.feature"). - Run() -} - -func (s *msgUpdatePolicy) Before(t gocuke.TestingT) { - s.baseSuite = setupBase(t) -} - -func (s *msgUpdatePolicy) Admin(a string) { - require.Equal(s.t, s.admin.String(), a) -} - -func (s *msgUpdatePolicy) Policy(a gocuke.DocString) { - var policy governorv1.Policy - err := jsonpb.UnmarshalString(a.Content, &policy) - require.NoError(s.t, err) - - err = s.k.ss.PolicyTable().Save(s.sdkCtx, &policy) - require.NoError(s.t, err) -} - -func (s *msgUpdatePolicy) MsgUpdatePolicy(a gocuke.DocString) { - var msg v1.MsgUpdatePolicy - err := jsonpb.UnmarshalString(a.Content, &msg) - require.NoError(s.t, err) - - s.res, s.err = s.k.UpdatePolicy(s.sdkCtx, &msg) -} - -func (s *msgUpdatePolicy) ExpectNoError() { - require.NoError(s.t, s.err) -} - -func (s *msgUpdatePolicy) ExpectTheError(a gocuke.DocString) { - require.EqualError(s.t, s.err, a.Content) -} - -func (s *msgUpdatePolicy) ExpectPolicy(a gocuke.DocString) { - var expected governorv1.Policy - err := jsonpb.UnmarshalString(a.Content, &expected) - require.NoError(s.t, err) - - policy, err := s.k.ss.PolicyTable().Get(s.sdkCtx) - require.NoError(s.t, err) - require.Equal(s.t, expected.SignedBlocksWindow, policy.SignedBlocksWindow) - require.Equal(s.t, expected.MinSignedPerWindow, policy.MinSignedPerWindow) -} - -func (s *msgUpdatePolicy) ExpectEventUpdatePolicy(a gocuke.DocString) { - var expected v1.EventUpdatePolicy - err := jsonpb.UnmarshalString(a.Content, &expected) - require.NoError(s.t, err) - - actual, found := utils.GetEvent(&expected, s.sdkCtx.EventManager().Events()) - require.True(s.t, found) - - err = utils.MatchEvent(&expected, actual) - require.NoError(s.t, err) -} - -func (s *msgUpdatePolicy) ExpectResponse(a gocuke.DocString) { - var expected v1.MsgUpdatePolicyResponse - err := jsonpb.UnmarshalString(a.Content, &expected) - require.NoError(s.t, err) - - require.Equal(s.t, &expected, s.res) -} diff --git a/governor/keeper/features/query_governor.feature b/governor/keeper/query_governor.feature similarity index 64% rename from governor/keeper/features/query_governor.feature rename to governor/keeper/query_governor.feature index 8461f37..0a20d02 100644 --- a/governor/keeper/features/query_governor.feature +++ b/governor/keeper/query_governor.feature @@ -1,24 +1,24 @@ -Feature: Query/Validator +Feature: Query/Governor - Query/Validator is successful when: - - validator with address exists + Query/Governor is successful when: + - governor with address exists - Query/Validator has the following outcomes: + Query/Governor has the following outcomes: - query response returned - Rule: The validator must exist + Rule: The governor must exist Background: - Given validator + Given governor """ { - "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" } """ - Scenario: validator exists - When query validator + Scenario: governor exists + When query governor """ { "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" @@ -26,8 +26,8 @@ Feature: Query/Validator """ Then expect no error - Scenario: validator does not exist - When query validator + Scenario: governor does not exist + When query governor """ { "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" @@ -35,22 +35,22 @@ Feature: Query/Validator """ Then expect the error """ - validator with address chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup: not found + governor with address chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup: not found """ Rule: The query response is returned Background: - Given validator + Given governor """ { - "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" } """ Scenario: query response returned - When query validator + When query governor """ { "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" diff --git a/governor/keeper/query_governor.go b/governor/keeper/query_governor.go index 3394d52..3e23e15 100644 --- a/governor/keeper/query_governor.go +++ b/governor/keeper/query_governor.go @@ -4,6 +4,7 @@ import ( "context" "cosmossdk.io/orm/types/ormerrors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" v1 "github.com/chora-io/mods/governor/types/v1" @@ -12,8 +13,14 @@ import ( // Governor implements the Query/Governor method. func (k Keeper) Governor(ctx context.Context, req *v1.QueryGovernorRequest) (*v1.QueryGovernorResponse, error) { + // get account address from address + address, err := sdk.AccAddressFromBech32(req.Address) + if err != nil { + return nil, err // internal error + } + // get governor from governor table - governor, err := k.ss.GovernorTable().Get(ctx, req.Address) + governor, err := k.ss.GovernorTable().Get(ctx, address) if err != nil { if ormerrors.NotFound.Is(err) { return nil, sdkerrors.ErrNotFound.Wrapf("governor with address %s", req.Address) @@ -23,7 +30,7 @@ func (k Keeper) Governor(ctx context.Context, req *v1.QueryGovernorRequest) (*v1 // return query response return &v1.QueryGovernorResponse{ - Address: governor.Address, + Address: req.Address, Metadata: governor.Metadata, }, nil } diff --git a/governor/keeper/query_governor_test.go b/governor/keeper/query_governor_test.go index 1e17964..88a8cfd 100644 --- a/governor/keeper/query_governor_test.go +++ b/governor/keeper/query_governor_test.go @@ -19,7 +19,7 @@ type queryGovernor struct { func TestQueryGovernor(t *testing.T) { gocuke.NewRunner(t, &queryGovernor{}). - Path("./features/query_governor.feature"). + Path("./query_governor.feature"). Run() } diff --git a/governor/keeper/features/query_governors.feature b/governor/keeper/query_governors.feature similarity index 70% rename from governor/keeper/features/query_governors.feature rename to governor/keeper/query_governors.feature index 8bc9a92..7feaad6 100644 --- a/governor/keeper/features/query_governors.feature +++ b/governor/keeper/query_governors.feature @@ -1,15 +1,15 @@ -Feature: Query/Validators +Feature: Query/Governors - Query/Validators is successful when: + Query/Governors is successful when: - always (an error is never returned) - Query/Validators has the following outcomes: + Query/Governors has the following outcomes: - query response returned Rule: An error is never returned Scenario: never error - When query validators + When query governors """ {} """ @@ -17,35 +17,35 @@ Feature: Query/Validators Rule: The query response is returned - Scenario: response with no validators - When query validators + Scenario: response with no governors + When query governors """ {} """ Then expect response """ { - "validators": [], + "governors": [], "pagination": {} } """ - Scenario: response with one validator - Given validator + Scenario: response with one governor + Given governor """ { - "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" } """ - When query validators + When query governors """ {} """ Then expect response """ { - "validators": [ + "governors": [ { "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" @@ -57,29 +57,29 @@ Feature: Query/Validators } """ - Scenario: response with two validators - Given validator + Scenario: response with two governors + Given governor """ { - "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", + "address": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" } """ - Given validator + Given governor """ { - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", + "address": "hEyiXxUCaFQmkbuhO9r+QDscjIY=", "metadata": "chora:13toVfwypkE1AwUzQmuBHk28WWwCa5QCynCrBuoYgMvN2iroywJ5Vi1.rdf" } """ - When query validators + When query governors """ {} """ Then expect response """ { - "validators": [ + "governors": [ { "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" diff --git a/governor/keeper/query_governors.go b/governor/keeper/query_governors.go index fea17c8..647bd7a 100644 --- a/governor/keeper/query_governors.go +++ b/governor/keeper/query_governors.go @@ -4,6 +4,7 @@ import ( "context" "cosmossdk.io/orm/model/ormlist" + sdk "github.com/cosmos/cosmos-sdk/types" governorv1 "github.com/chora-io/mods/governor/api/v1" v1 "github.com/chora-io/mods/governor/types/v1" @@ -36,8 +37,11 @@ func (k Keeper) Governors(ctx context.Context, req *v1.QueryGovernorsRequest) (* return nil, err // internal error } + // get governor account from address + address := sdk.AccAddress(v.Address) + governor := v1.QueryGovernorsResponse_Governor{ - Address: v.Address, + Address: address.String(), Metadata: v.Metadata, } diff --git a/governor/keeper/query_governors_test.go b/governor/keeper/query_governors_test.go index 817cd4e..9e6f7bb 100644 --- a/governor/keeper/query_governors_test.go +++ b/governor/keeper/query_governors_test.go @@ -19,7 +19,7 @@ type queryGovernors struct { func TestQueryGovernors(t *testing.T) { gocuke.NewRunner(t, &queryGovernors{}). - Path("./features/query_governors.feature"). + Path("./query_governors.feature"). Run() } diff --git a/governor/keeper/query_policy.go b/governor/keeper/query_policy.go deleted file mode 100644 index ecb94da..0000000 --- a/governor/keeper/query_policy.go +++ /dev/null @@ -1,23 +0,0 @@ -package keeper - -import ( - "context" - - v1 "github.com/chora-io/mods/governor/types/v1" -) - -// Policy implements the Query/Policy method. -func (k Keeper) Policy(ctx context.Context, _ *v1.QueryPolicyRequest) (*v1.QueryPolicyResponse, error) { - - // get policy from singleton table - policy, err := k.ss.PolicyTable().Get(ctx) - if err != nil { - return nil, err // internal error - } - - // return query response - return &v1.QueryPolicyResponse{ - SignedBlocksWindow: policy.SignedBlocksWindow, - MinSignedPerWindow: policy.MinSignedPerWindow, - }, nil -} diff --git a/governor/keeper/query_policy_test.go b/governor/keeper/query_policy_test.go deleted file mode 100644 index 9893ea7..0000000 --- a/governor/keeper/query_policy_test.go +++ /dev/null @@ -1,61 +0,0 @@ -package keeper - -import ( - "testing" - - "github.com/cosmos/gogoproto/jsonpb" - "github.com/regen-network/gocuke" - "github.com/stretchr/testify/require" - - governorv1 "github.com/chora-io/mods/governor/api/v1" - v1 "github.com/chora-io/mods/governor/types/v1" -) - -type queryPolicy struct { - *baseSuite - res *v1.QueryPolicyResponse - err error -} - -func TestQueryPolicy(t *testing.T) { - gocuke.NewRunner(t, &queryPolicy{}). - Path("./features/query_policy.feature"). - Run() -} - -func (s *queryPolicy) Before(t gocuke.TestingT) { - s.baseSuite = setupBase(t) -} - -func (s *queryPolicy) Policy(a gocuke.DocString) { - var policy governorv1.Policy - err := jsonpb.UnmarshalString(a.Content, &policy) - require.NoError(s.t, err) - - err = s.k.ss.PolicyTable().Save(s.sdkCtx, &governorv1.Policy{ - SignedBlocksWindow: policy.SignedBlocksWindow, - MinSignedPerWindow: policy.MinSignedPerWindow, - }) - require.NoError(s.t, err) -} - -func (s *queryPolicy) QueryPolicy() { - var req v1.QueryPolicyRequest - s.res, s.err = s.k.Policy(s.sdkCtx, &req) -} - -func (s *queryPolicy) ExpectNoError() { - require.NoError(s.t, s.err) -} - -func (s *queryPolicy) ExpectTheError(a gocuke.DocString) { - require.EqualError(s.t, s.err, a.Content) -} - -func (s *queryPolicy) ExpectResponse(a gocuke.DocString) { - var expected v1.QueryPolicyResponse - err := jsonpb.UnmarshalString(a.Content, &expected) - require.NoError(s.t, err) - - require.Equal(s.t, &expected, s.res) -} diff --git a/governor/module/autocli.go b/governor/module/autocli.go index d4f3b57..33de1fa 100644 --- a/governor/module/autocli.go +++ b/governor/module/autocli.go @@ -37,8 +37,8 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { EnhanceCustomCommand: false, // use custom commands until v0.51 RpcCommandOptions: []*autocliv1.RpcCommandOptions{ //{ - // RpcMethod: "AddGovernor", - // Use: "add-governor [address] [metadata]", + // RpcMethod: "CreateGovernor", + // Use: "create-governor [address] [metadata]", // Short: "submit a transaction to add a governor", // PositionalArgs: []*autocliv1.PositionalArgDescriptor{ // {ProtoField: "address"}, diff --git a/governor/proto/buf.lock b/governor/proto/buf.lock index 32d358a..360f94c 100644 --- a/governor/proto/buf.lock +++ b/governor/proto/buf.lock @@ -19,8 +19,8 @@ deps: - remote: buf.build owner: googleapis repository: googleapis - commit: 8bc2c51e08c447cd8886cdea48a73e14 - digest: shake256:a969155953a5cedc5b2df5b42c368f2bc66ff8ce1804bc96e0f14ff2ee8a893687963058909df844d1643cdbc98ff099d2daa6bc9f9f5b8886c49afdc60e19af + commit: e7f8d366f5264595bcc4cd4139af9973 + digest: shake256:e5e5f1c12f82e028ea696faa43b4f9dc6258a6d1226282962a8c8b282e10946281d815884f574bd279ebd9cd7588629beb3db17b892af6c33b56f92f8f67f509 - remote: buf.build owner: protocolbuffers repository: wellknowntypes diff --git a/governor/proto/v1/events.proto b/governor/proto/v1/events.proto index 3770e16..eb70dc3 100644 --- a/governor/proto/v1/events.proto +++ b/governor/proto/v1/events.proto @@ -4,29 +4,22 @@ package chora.governor.v1; option go_package = "github.com/chora-io/mods/governor/types/v1"; -// EventRegister is an event emitted when a governor has registered. -message EventRegister { +// EventCreateGovernor is an event emitted when a governor has registered. +message EventCreateGovernor { // address is the address of the governor. string address = 1; } -// EventRemove is an event emitted when a governor has been removed. -message EventRemove { +// EventRemoveGovernor is an event emitted when a governor has been removed. +message EventRemoveGovernor { // address is the address of the governor. string address = 1; } -// EventResign is an event emitted when a governor has resigned. -message EventResign { - - // address is the address of the governor. - string address = 1; -} - -// EventUpdate is an event emitted when a governor has updated. -message EventUpdate { +// EventUpdateGovernorMetadata is an event emitted when a governor has updated. +message EventUpdateGovernorMetadata { // address is the address of the governor. string address = 1; diff --git a/governor/proto/v1/msg.proto b/governor/proto/v1/msg.proto index a51a176..a1f98b4 100644 --- a/governor/proto/v1/msg.proto +++ b/governor/proto/v1/msg.proto @@ -9,81 +9,65 @@ option go_package = "github.com/chora-io/mods/governor/types/v1"; // Msg is the Msg service. service Msg { - // Register registers a governor (any account). - rpc Register(MsgRegister) returns (MsgRegisterResponse); + // CreateGovernor registers a governor. + rpc CreateGovernor(MsgCreateGovernor) returns (MsgCreateGovernorResponse); - // Remove removes a governor (only admin account). - rpc Remove(MsgRemove) returns (MsgRemoveResponse); + // RemoveGovernor removes a governor. + rpc RemoveGovernor(MsgRemoveGovernor) returns (MsgRemoveGovernorResponse); - // Resign resigns a governor (only governor account). - rpc Resign(MsgResign) returns (MsgResignResponse); - - // Update updates a governor (only governor account). - rpc Update(MsgUpdate) returns (MsgUpdateResponse); + // UpdateGovernorMetadata updates a governor. + rpc UpdateGovernorMetadata(MsgUpdateGovernorMetadata) + returns (MsgUpdateGovernorMetadataResponse); } -// MsgRegister is the Msg/Register request type. -message MsgRegister { - option (cosmos.msg.v1.signer) = "governor"; +// MsgCreateGovernor is the Msg/CreateGovernor request type. +message MsgCreateGovernor { + option (cosmos.msg.v1.signer) = "address"; - // governor is the address of the governor. - string governor = 1; + // address is the address of the governor. + string address = 1; // metadata is the metadata of the governor. string metadata = 2; } -// MsgRegisterResponse is the Msg/Register response type. -message MsgRegisterResponse { - - // governor is the address of the governor. - string governor = 1; -} - -// MsgRemove is the Msg/Remove request type. -message MsgRemove { - option (cosmos.msg.v1.signer) = "governor"; - - // governor is the address of the governor. - string governor = 1; -} - -// MsgRemoveResponse is the Msg/Remove response type. -message MsgRemoveResponse { +// MsgCreateGovernorResponse is the Msg/CreateGovernor response type. +message MsgCreateGovernorResponse { - // governor is the address of the governor. - string governor = 1; + // address is the address of the governor. + string address = 1; } -// MsgResign is the Msg/Resign request type. -message MsgResign { - option (cosmos.msg.v1.signer) = "governor"; +// MsgRemoveGovernor is the Msg/RemoveGovernor request type. +message MsgRemoveGovernor { + option (cosmos.msg.v1.signer) = "address"; - // governor is the address of the governor. - string governor = 1; + // address is the address of the governor. + string address = 1; } -// MsgResignResponse is the Msg/Resign response type. -message MsgResignResponse { +// MsgRemoveGovernorResponse is the Msg/RemoveGovernor response type. +message MsgRemoveGovernorResponse { - // governor is the address of the governor. - string governor = 1; + // address is the address of the governor. + string address = 1; } -// MsgUpdate is the Msg/Update request type. -message MsgUpdate { - option (cosmos.msg.v1.signer) = "governor"; +// MsgUpdateGovernorMetadata is the Msg/UpdateGovernorMetadata request type. +message MsgUpdateGovernorMetadata { + option (cosmos.msg.v1.signer) = "address"; - // governor is the address of the governor. - string governor = 1; + // address is the address of the governor. + string address = 1; // new_metadata is the new metadata of the governor. string new_metadata = 2; } -// MsgUpdateResponse is the Msg/Update response type. -message MsgUpdateResponse { +// MsgUpdateGovernorMetadataResponse is the Msg/UpdateGovernorMetadata response +// type. +message MsgUpdateGovernorMetadataResponse { - // governor is the address of the governor. - string governor = 1; + // address is the address of the governor. + string address = 1; } diff --git a/governor/proto/v1/state.proto b/governor/proto/v1/state.proto index c63b321..c4e73f7 100644 --- a/governor/proto/v1/state.proto +++ b/governor/proto/v1/state.proto @@ -9,12 +9,12 @@ option go_package = "github.com/chora-io/mods/governor/types/v1"; // Governor defines the table and properties of a governor. message Governor { option (cosmos.orm.v1.table) = { - id : 2, - primary_key : {fields : "governor"} + id : 1, + primary_key : {fields : "address"} }; - // governor is the address of the governor. - string governor = 1; + // address is the address of the governor. + bytes address = 1; // metadata is the metadata of the governor. string metadata = 2; diff --git a/governor/types/v1/codec.go b/governor/types/v1/codec.go index 049fcdb..829baf0 100644 --- a/governor/types/v1/codec.go +++ b/governor/types/v1/codec.go @@ -11,10 +11,9 @@ import ( func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), - &MsgAddValidator{}, - &MsgRemoveValidator{}, - &MsgUpdatePolicy{}, - &MsgUpdateValidator{}, + &MsgCreateGovernor{}, + &MsgRemoveGovernor{}, + &MsgUpdateGovernorMetadata{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) @@ -22,8 +21,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { // RegisterLegacyAminoCodec registers legacy amino codec. func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgAddValidator{}, "validator/MsgAddValidator", nil) - cdc.RegisterConcrete(&MsgRemoveValidator{}, "validator/MsgRemoveValidator", nil) - cdc.RegisterConcrete(&MsgUpdatePolicy{}, "validator/MsgUpdatePolicy", nil) - cdc.RegisterConcrete(&MsgUpdateValidator{}, "validator/MsgUpdateValidator", nil) + cdc.RegisterConcrete(&MsgCreateGovernor{}, "governor/MsgCreateGovernor", nil) + cdc.RegisterConcrete(&MsgRemoveGovernor{}, "governor/MsgRemoveGovernor", nil) + cdc.RegisterConcrete(&MsgUpdateGovernorMetadata{}, "governor/MsgUpdateGovernorMetadata", nil) } diff --git a/governor/types/v1/events.pb.go b/governor/types/v1/events.pb.go index f2a4ad8..a818dc7 100644 --- a/governor/types/v1/events.pb.go +++ b/governor/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 -// EventRegister is an event emitted when a governor has registered. -type EventRegister struct { +// EventCreateGovernor is an event emitted when a governor has registered. +type EventCreateGovernor struct { // address is the address of the governor. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (m *EventRegister) Reset() { *m = EventRegister{} } -func (m *EventRegister) String() string { return proto.CompactTextString(m) } -func (*EventRegister) ProtoMessage() {} -func (*EventRegister) Descriptor() ([]byte, []int) { +func (m *EventCreateGovernor) Reset() { *m = EventCreateGovernor{} } +func (m *EventCreateGovernor) String() string { return proto.CompactTextString(m) } +func (*EventCreateGovernor) ProtoMessage() {} +func (*EventCreateGovernor) Descriptor() ([]byte, []int) { return fileDescriptor_ec8ffcae9bebabcd, []int{0} } -func (m *EventRegister) XXX_Unmarshal(b []byte) error { +func (m *EventCreateGovernor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *EventRegister) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EventCreateGovernor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_EventRegister.Marshal(b, m, deterministic) + return xxx_messageInfo_EventCreateGovernor.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -49,43 +49,43 @@ func (m *EventRegister) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } -func (m *EventRegister) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventRegister.Merge(m, src) +func (m *EventCreateGovernor) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventCreateGovernor.Merge(m, src) } -func (m *EventRegister) XXX_Size() int { +func (m *EventCreateGovernor) XXX_Size() int { return m.Size() } -func (m *EventRegister) XXX_DiscardUnknown() { - xxx_messageInfo_EventRegister.DiscardUnknown(m) +func (m *EventCreateGovernor) XXX_DiscardUnknown() { + xxx_messageInfo_EventCreateGovernor.DiscardUnknown(m) } -var xxx_messageInfo_EventRegister proto.InternalMessageInfo +var xxx_messageInfo_EventCreateGovernor proto.InternalMessageInfo -func (m *EventRegister) GetAddress() string { +func (m *EventCreateGovernor) GetAddress() string { if m != nil { return m.Address } return "" } -// EventRemove is an event emitted when a governor has been removed. -type EventRemove struct { +// EventRemoveGovernor is an event emitted when a governor has been removed. +type EventRemoveGovernor struct { // address is the address of the governor. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (m *EventRemove) Reset() { *m = EventRemove{} } -func (m *EventRemove) String() string { return proto.CompactTextString(m) } -func (*EventRemove) ProtoMessage() {} -func (*EventRemove) Descriptor() ([]byte, []int) { +func (m *EventRemoveGovernor) Reset() { *m = EventRemoveGovernor{} } +func (m *EventRemoveGovernor) String() string { return proto.CompactTextString(m) } +func (*EventRemoveGovernor) ProtoMessage() {} +func (*EventRemoveGovernor) Descriptor() ([]byte, []int) { return fileDescriptor_ec8ffcae9bebabcd, []int{1} } -func (m *EventRemove) XXX_Unmarshal(b []byte) error { +func (m *EventRemoveGovernor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *EventRemove) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EventRemoveGovernor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_EventRemove.Marshal(b, m, deterministic) + return xxx_messageInfo_EventRemoveGovernor.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -95,43 +95,43 @@ func (m *EventRemove) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *EventRemove) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventRemove.Merge(m, src) +func (m *EventRemoveGovernor) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRemoveGovernor.Merge(m, src) } -func (m *EventRemove) XXX_Size() int { +func (m *EventRemoveGovernor) XXX_Size() int { return m.Size() } -func (m *EventRemove) XXX_DiscardUnknown() { - xxx_messageInfo_EventRemove.DiscardUnknown(m) +func (m *EventRemoveGovernor) XXX_DiscardUnknown() { + xxx_messageInfo_EventRemoveGovernor.DiscardUnknown(m) } -var xxx_messageInfo_EventRemove proto.InternalMessageInfo +var xxx_messageInfo_EventRemoveGovernor proto.InternalMessageInfo -func (m *EventRemove) GetAddress() string { +func (m *EventRemoveGovernor) GetAddress() string { if m != nil { return m.Address } return "" } -// EventResign is an event emitted when a governor has resigned. -type EventResign struct { +// EventUpdateGovernorMetadata is an event emitted when a governor has updated. +type EventUpdateGovernorMetadata struct { // address is the address of the governor. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (m *EventResign) Reset() { *m = EventResign{} } -func (m *EventResign) String() string { return proto.CompactTextString(m) } -func (*EventResign) ProtoMessage() {} -func (*EventResign) Descriptor() ([]byte, []int) { +func (m *EventUpdateGovernorMetadata) Reset() { *m = EventUpdateGovernorMetadata{} } +func (m *EventUpdateGovernorMetadata) String() string { return proto.CompactTextString(m) } +func (*EventUpdateGovernorMetadata) ProtoMessage() {} +func (*EventUpdateGovernorMetadata) Descriptor() ([]byte, []int) { return fileDescriptor_ec8ffcae9bebabcd, []int{2} } -func (m *EventResign) XXX_Unmarshal(b []byte) error { +func (m *EventUpdateGovernorMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *EventResign) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EventUpdateGovernorMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_EventResign.Marshal(b, m, deterministic) + return xxx_messageInfo_EventUpdateGovernorMetadata.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -141,65 +141,19 @@ func (m *EventResign) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *EventResign) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventResign.Merge(m, src) +func (m *EventUpdateGovernorMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventUpdateGovernorMetadata.Merge(m, src) } -func (m *EventResign) XXX_Size() int { +func (m *EventUpdateGovernorMetadata) XXX_Size() int { return m.Size() } -func (m *EventResign) XXX_DiscardUnknown() { - xxx_messageInfo_EventResign.DiscardUnknown(m) +func (m *EventUpdateGovernorMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_EventUpdateGovernorMetadata.DiscardUnknown(m) } -var xxx_messageInfo_EventResign proto.InternalMessageInfo +var xxx_messageInfo_EventUpdateGovernorMetadata proto.InternalMessageInfo -func (m *EventResign) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -// EventUpdate is an event emitted when a governor has updated. -type EventUpdate struct { - // address is the address of the governor. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *EventUpdate) Reset() { *m = EventUpdate{} } -func (m *EventUpdate) String() string { return proto.CompactTextString(m) } -func (*EventUpdate) ProtoMessage() {} -func (*EventUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_ec8ffcae9bebabcd, []int{3} -} -func (m *EventUpdate) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventUpdate.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EventUpdate) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventUpdate.Merge(m, src) -} -func (m *EventUpdate) XXX_Size() int { - return m.Size() -} -func (m *EventUpdate) XXX_DiscardUnknown() { - xxx_messageInfo_EventUpdate.DiscardUnknown(m) -} - -var xxx_messageInfo_EventUpdate proto.InternalMessageInfo - -func (m *EventUpdate) GetAddress() string { +func (m *EventUpdateGovernorMetadata) GetAddress() string { if m != nil { return m.Address } @@ -207,62 +161,31 @@ func (m *EventUpdate) GetAddress() string { } func init() { - proto.RegisterType((*EventRegister)(nil), "chora.governor.v1.EventRegister") - proto.RegisterType((*EventRemove)(nil), "chora.governor.v1.EventRemove") - proto.RegisterType((*EventResign)(nil), "chora.governor.v1.EventResign") - proto.RegisterType((*EventUpdate)(nil), "chora.governor.v1.EventUpdate") + proto.RegisterType((*EventCreateGovernor)(nil), "chora.governor.v1.EventCreateGovernor") + proto.RegisterType((*EventRemoveGovernor)(nil), "chora.governor.v1.EventRemoveGovernor") + proto.RegisterType((*EventUpdateGovernorMetadata)(nil), "chora.governor.v1.EventUpdateGovernorMetadata") } func init() { proto.RegisterFile("chora/governor/v1/events.proto", fileDescriptor_ec8ffcae9bebabcd) } var fileDescriptor_ec8ffcae9bebabcd = []byte{ - // 193 bytes of a gzipped FileDescriptorProto + // 198 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xce, 0xc8, 0x2f, 0x4a, 0xd4, 0x4f, 0xcf, 0x2f, 0x4b, 0x2d, 0xca, 0xcb, 0x2f, 0xd2, 0x2f, 0x33, 0xd4, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x04, 0xcb, 0xeb, 0xc1, - 0xe4, 0xf5, 0xca, 0x0c, 0x95, 0x34, 0xb9, 0x78, 0x5d, 0x41, 0x4a, 0x82, 0x52, 0xd3, 0x33, 0x8b, - 0x4b, 0x52, 0x8b, 0x84, 0x24, 0xb8, 0xd8, 0x13, 0x53, 0x52, 0x8a, 0x52, 0x8b, 0x8b, 0x25, 0x18, - 0x15, 0x18, 0x35, 0x38, 0x83, 0x60, 0x5c, 0x25, 0x75, 0x2e, 0x6e, 0xa8, 0xd2, 0xdc, 0xfc, 0xb2, - 0x54, 0xa2, 0x14, 0x16, 0x67, 0xa6, 0xe7, 0x11, 0xa1, 0x30, 0xb4, 0x20, 0x25, 0xb1, 0x04, 0x8f, - 0x89, 0x4e, 0x2e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, - 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x95, 0x9e, - 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0xf6, 0x9d, 0x6e, 0x66, 0xbe, 0x7e, - 0x6e, 0x7e, 0x4a, 0x31, 0x22, 0x14, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0xf5, 0xcb, 0x0c, 0x93, 0xd8, - 0xc0, 0xa1, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xfa, 0x80, 0x0b, 0x4a, 0x27, 0x01, 0x00, - 0x00, -} - -func (m *EventRegister) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EventRegister) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventRegister) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EventRemove) Marshal() (dAtA []byte, err error) { + 0xe4, 0xf5, 0xca, 0x0c, 0x95, 0xf4, 0xb9, 0x84, 0x5d, 0x41, 0x4a, 0x9c, 0x8b, 0x52, 0x13, 0x4b, + 0x52, 0xdd, 0xa1, 0x32, 0x42, 0x12, 0x5c, 0xec, 0x89, 0x29, 0x29, 0x45, 0xa9, 0xc5, 0xc5, 0x12, + 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x30, 0x2e, 0x5c, 0x43, 0x50, 0x6a, 0x6e, 0x7e, 0x19, 0x31, + 0x1a, 0xcc, 0xb9, 0xa4, 0xc1, 0x1a, 0x42, 0x0b, 0x52, 0x90, 0x6c, 0xf0, 0x4d, 0x2d, 0x49, 0x4c, + 0x49, 0x2c, 0x49, 0xc4, 0xad, 0xd1, 0xc9, 0xe5, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, + 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, + 0x18, 0xa2, 0xb4, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xc1, 0x5e, + 0xd2, 0xcd, 0xcc, 0xd7, 0xcf, 0xcd, 0x4f, 0x29, 0x46, 0x78, 0xbd, 0xa4, 0xb2, 0x20, 0xb5, 0x58, + 0xbf, 0xcc, 0x30, 0x89, 0x0d, 0xec, 0x75, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x84, 0x4a, + 0x92, 0x2e, 0x1c, 0x01, 0x00, 0x00, +} + +func (m *EventCreateGovernor) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -272,12 +195,12 @@ func (m *EventRemove) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *EventRemove) MarshalTo(dAtA []byte) (int, error) { +func (m *EventCreateGovernor) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *EventRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EventCreateGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -292,7 +215,7 @@ func (m *EventRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *EventResign) Marshal() (dAtA []byte, err error) { +func (m *EventRemoveGovernor) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -302,12 +225,12 @@ func (m *EventResign) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *EventResign) MarshalTo(dAtA []byte) (int, error) { +func (m *EventRemoveGovernor) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *EventResign) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EventRemoveGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -322,7 +245,7 @@ func (m *EventResign) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *EventUpdate) Marshal() (dAtA []byte, err error) { +func (m *EventUpdateGovernorMetadata) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -332,12 +255,12 @@ func (m *EventUpdate) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *EventUpdate) MarshalTo(dAtA []byte) (int, error) { +func (m *EventUpdateGovernorMetadata) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *EventUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EventUpdateGovernorMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -363,7 +286,7 @@ func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *EventRegister) Size() (n int) { +func (m *EventCreateGovernor) Size() (n int) { if m == nil { return 0 } @@ -376,7 +299,7 @@ func (m *EventRegister) Size() (n int) { return n } -func (m *EventRemove) Size() (n int) { +func (m *EventRemoveGovernor) Size() (n int) { if m == nil { return 0 } @@ -389,20 +312,7 @@ func (m *EventRemove) Size() (n int) { return n } -func (m *EventResign) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *EventUpdate) Size() (n int) { +func (m *EventUpdateGovernorMetadata) Size() (n int) { if m == nil { return 0 } @@ -421,89 +331,7 @@ func sovEvents(x uint64) (n int) { func sozEvents(x uint64) (n int) { return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *EventRegister) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EventRegister: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventRegister: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowEvents - } - 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 ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventRemove) Unmarshal(dAtA []byte) error { +func (m *EventCreateGovernor) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -526,10 +354,10 @@ func (m *EventRemove) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: EventRemove: wiretype end group for non-group") + return fmt.Errorf("proto: EventCreateGovernor: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: EventRemove: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EventCreateGovernor: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -585,7 +413,7 @@ func (m *EventRemove) Unmarshal(dAtA []byte) error { } return nil } -func (m *EventResign) Unmarshal(dAtA []byte) error { +func (m *EventRemoveGovernor) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -608,10 +436,10 @@ func (m *EventResign) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: EventResign: wiretype end group for non-group") + return fmt.Errorf("proto: EventRemoveGovernor: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: EventResign: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EventRemoveGovernor: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -667,7 +495,7 @@ func (m *EventResign) Unmarshal(dAtA []byte) error { } return nil } -func (m *EventUpdate) Unmarshal(dAtA []byte) error { +func (m *EventUpdateGovernorMetadata) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -690,10 +518,10 @@ func (m *EventUpdate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: EventUpdate: wiretype end group for non-group") + return fmt.Errorf("proto: EventUpdateGovernorMetadata: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: EventUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EventUpdateGovernorMetadata: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/governor/types/v1/features/msg_remove_governor.feature b/governor/types/v1/features/msg_remove_governor.feature deleted file mode 100644 index 645308d..0000000 --- a/governor/types/v1/features/msg_remove_governor.feature +++ /dev/null @@ -1,63 +0,0 @@ -Feature: MsgRemoveValidator - - Scenario: valid message - Given message - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" - } - """ - 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 - """ diff --git a/governor/types/v1/msg.pb.go b/governor/types/v1/msg.pb.go index 972492c..8a08ef5 100644 --- a/governor/types/v1/msg.pb.go +++ b/governor/types/v1/msg.pb.go @@ -28,26 +28,26 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// MsgRegister is the Msg/Register request type. -type MsgRegister struct { - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` +// MsgCreateGovernor is the Msg/CreateGovernor request type. +type MsgCreateGovernor struct { + // address is the address of the governor. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // metadata is the metadata of the governor. Metadata string `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` } -func (m *MsgRegister) Reset() { *m = MsgRegister{} } -func (m *MsgRegister) String() string { return proto.CompactTextString(m) } -func (*MsgRegister) ProtoMessage() {} -func (*MsgRegister) Descriptor() ([]byte, []int) { +func (m *MsgCreateGovernor) Reset() { *m = MsgCreateGovernor{} } +func (m *MsgCreateGovernor) String() string { return proto.CompactTextString(m) } +func (*MsgCreateGovernor) ProtoMessage() {} +func (*MsgCreateGovernor) Descriptor() ([]byte, []int) { return fileDescriptor_7a84c7e9509d58dc, []int{0} } -func (m *MsgRegister) XXX_Unmarshal(b []byte) error { +func (m *MsgCreateGovernor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgRegister) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgCreateGovernor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgRegister.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgCreateGovernor.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -57,50 +57,50 @@ func (m *MsgRegister) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *MsgRegister) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegister.Merge(m, src) +func (m *MsgCreateGovernor) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateGovernor.Merge(m, src) } -func (m *MsgRegister) XXX_Size() int { +func (m *MsgCreateGovernor) XXX_Size() int { return m.Size() } -func (m *MsgRegister) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegister.DiscardUnknown(m) +func (m *MsgCreateGovernor) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateGovernor.DiscardUnknown(m) } -var xxx_messageInfo_MsgRegister proto.InternalMessageInfo +var xxx_messageInfo_MsgCreateGovernor proto.InternalMessageInfo -func (m *MsgRegister) GetGovernor() string { +func (m *MsgCreateGovernor) GetAddress() string { if m != nil { - return m.Governor + return m.Address } return "" } -func (m *MsgRegister) GetMetadata() string { +func (m *MsgCreateGovernor) GetMetadata() string { if m != nil { return m.Metadata } return "" } -// MsgRegisterResponse is the Msg/Register response type. -type MsgRegisterResponse struct { - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` +// MsgCreateGovernorResponse is the Msg/CreateGovernor response type. +type MsgCreateGovernorResponse struct { + // address is the address of the governor. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (m *MsgRegisterResponse) Reset() { *m = MsgRegisterResponse{} } -func (m *MsgRegisterResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterResponse) ProtoMessage() {} -func (*MsgRegisterResponse) Descriptor() ([]byte, []int) { +func (m *MsgCreateGovernorResponse) Reset() { *m = MsgCreateGovernorResponse{} } +func (m *MsgCreateGovernorResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateGovernorResponse) ProtoMessage() {} +func (*MsgCreateGovernorResponse) Descriptor() ([]byte, []int) { return fileDescriptor_7a84c7e9509d58dc, []int{1} } -func (m *MsgRegisterResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgCreateGovernorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgRegisterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgCreateGovernorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgRegisterResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgCreateGovernorResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -110,43 +110,43 @@ func (m *MsgRegisterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *MsgRegisterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterResponse.Merge(m, src) +func (m *MsgCreateGovernorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateGovernorResponse.Merge(m, src) } -func (m *MsgRegisterResponse) XXX_Size() int { +func (m *MsgCreateGovernorResponse) XXX_Size() int { return m.Size() } -func (m *MsgRegisterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterResponse.DiscardUnknown(m) +func (m *MsgCreateGovernorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateGovernorResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgRegisterResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgCreateGovernorResponse proto.InternalMessageInfo -func (m *MsgRegisterResponse) GetGovernor() string { +func (m *MsgCreateGovernorResponse) GetAddress() string { if m != nil { - return m.Governor + return m.Address } return "" } -// MsgRemove is the Msg/Remove request type. -type MsgRemove struct { - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` +// MsgRemoveGovernor is the Msg/RemoveGovernor request type. +type MsgRemoveGovernor struct { + // address is the address of the governor. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (m *MsgRemove) Reset() { *m = MsgRemove{} } -func (m *MsgRemove) String() string { return proto.CompactTextString(m) } -func (*MsgRemove) ProtoMessage() {} -func (*MsgRemove) Descriptor() ([]byte, []int) { +func (m *MsgRemoveGovernor) Reset() { *m = MsgRemoveGovernor{} } +func (m *MsgRemoveGovernor) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveGovernor) ProtoMessage() {} +func (*MsgRemoveGovernor) Descriptor() ([]byte, []int) { return fileDescriptor_7a84c7e9509d58dc, []int{2} } -func (m *MsgRemove) XXX_Unmarshal(b []byte) error { +func (m *MsgRemoveGovernor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgRemove) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgRemoveGovernor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgRemove.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgRemoveGovernor.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -156,43 +156,43 @@ func (m *MsgRemove) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *MsgRemove) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRemove.Merge(m, src) +func (m *MsgRemoveGovernor) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveGovernor.Merge(m, src) } -func (m *MsgRemove) XXX_Size() int { +func (m *MsgRemoveGovernor) XXX_Size() int { return m.Size() } -func (m *MsgRemove) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRemove.DiscardUnknown(m) +func (m *MsgRemoveGovernor) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveGovernor.DiscardUnknown(m) } -var xxx_messageInfo_MsgRemove proto.InternalMessageInfo +var xxx_messageInfo_MsgRemoveGovernor proto.InternalMessageInfo -func (m *MsgRemove) GetGovernor() string { +func (m *MsgRemoveGovernor) GetAddress() string { if m != nil { - return m.Governor + return m.Address } return "" } -// MsgRemoveResponse is the Msg/Remove response type. -type MsgRemoveResponse struct { - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` +// MsgRemoveGovernorResponse is the Msg/RemoveGovernor response type. +type MsgRemoveGovernorResponse struct { + // address is the address of the governor. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (m *MsgRemoveResponse) Reset() { *m = MsgRemoveResponse{} } -func (m *MsgRemoveResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRemoveResponse) ProtoMessage() {} -func (*MsgRemoveResponse) Descriptor() ([]byte, []int) { +func (m *MsgRemoveGovernorResponse) Reset() { *m = MsgRemoveGovernorResponse{} } +func (m *MsgRemoveGovernorResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveGovernorResponse) ProtoMessage() {} +func (*MsgRemoveGovernorResponse) Descriptor() ([]byte, []int) { return fileDescriptor_7a84c7e9509d58dc, []int{3} } -func (m *MsgRemoveResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgRemoveGovernorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgRemoveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgRemoveGovernorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgRemoveResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgRemoveGovernorResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -202,137 +202,45 @@ func (m *MsgRemoveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *MsgRemoveResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRemoveResponse.Merge(m, src) +func (m *MsgRemoveGovernorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveGovernorResponse.Merge(m, src) } -func (m *MsgRemoveResponse) XXX_Size() int { +func (m *MsgRemoveGovernorResponse) XXX_Size() int { return m.Size() } -func (m *MsgRemoveResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRemoveResponse.DiscardUnknown(m) +func (m *MsgRemoveGovernorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveGovernorResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgRemoveResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgRemoveGovernorResponse proto.InternalMessageInfo -func (m *MsgRemoveResponse) GetGovernor() string { +func (m *MsgRemoveGovernorResponse) GetAddress() string { if m != nil { - return m.Governor + return m.Address } return "" } -// MsgResign is the Msg/Resign request type. -type MsgResign struct { - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` -} - -func (m *MsgResign) Reset() { *m = MsgResign{} } -func (m *MsgResign) String() string { return proto.CompactTextString(m) } -func (*MsgResign) ProtoMessage() {} -func (*MsgResign) Descriptor() ([]byte, []int) { - return fileDescriptor_7a84c7e9509d58dc, []int{4} -} -func (m *MsgResign) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgResign) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgResign.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgResign) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgResign.Merge(m, src) -} -func (m *MsgResign) XXX_Size() int { - return m.Size() -} -func (m *MsgResign) XXX_DiscardUnknown() { - xxx_messageInfo_MsgResign.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgResign proto.InternalMessageInfo - -func (m *MsgResign) GetGovernor() string { - if m != nil { - return m.Governor - } - return "" -} - -// MsgResignResponse is the Msg/Resign response type. -type MsgResignResponse struct { - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` -} - -func (m *MsgResignResponse) Reset() { *m = MsgResignResponse{} } -func (m *MsgResignResponse) String() string { return proto.CompactTextString(m) } -func (*MsgResignResponse) ProtoMessage() {} -func (*MsgResignResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7a84c7e9509d58dc, []int{5} -} -func (m *MsgResignResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgResignResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgResignResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgResignResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgResignResponse.Merge(m, src) -} -func (m *MsgResignResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgResignResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgResignResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgResignResponse proto.InternalMessageInfo - -func (m *MsgResignResponse) GetGovernor() string { - if m != nil { - return m.Governor - } - return "" -} - -// MsgUpdate is the Msg/Update request type. -type MsgUpdate struct { - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` +// MsgUpdateGovernorMetadata is the Msg/UpdateGovernorMetadata request type. +type MsgUpdateGovernorMetadata struct { + // address is the address of the governor. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // new_metadata is the new metadata of the governor. NewMetadata string `protobuf:"bytes,2,opt,name=new_metadata,json=newMetadata,proto3" json:"new_metadata,omitempty"` } -func (m *MsgUpdate) Reset() { *m = MsgUpdate{} } -func (m *MsgUpdate) String() string { return proto.CompactTextString(m) } -func (*MsgUpdate) ProtoMessage() {} -func (*MsgUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_7a84c7e9509d58dc, []int{6} +func (m *MsgUpdateGovernorMetadata) Reset() { *m = MsgUpdateGovernorMetadata{} } +func (m *MsgUpdateGovernorMetadata) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateGovernorMetadata) ProtoMessage() {} +func (*MsgUpdateGovernorMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_7a84c7e9509d58dc, []int{4} } -func (m *MsgUpdate) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateGovernorMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateGovernorMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpdate.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateGovernorMetadata.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -342,50 +250,51 @@ func (m *MsgUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *MsgUpdate) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdate.Merge(m, src) +func (m *MsgUpdateGovernorMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateGovernorMetadata.Merge(m, src) } -func (m *MsgUpdate) XXX_Size() int { +func (m *MsgUpdateGovernorMetadata) XXX_Size() int { return m.Size() } -func (m *MsgUpdate) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdate.DiscardUnknown(m) +func (m *MsgUpdateGovernorMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateGovernorMetadata.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpdate proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateGovernorMetadata proto.InternalMessageInfo -func (m *MsgUpdate) GetGovernor() string { +func (m *MsgUpdateGovernorMetadata) GetAddress() string { if m != nil { - return m.Governor + return m.Address } return "" } -func (m *MsgUpdate) GetNewMetadata() string { +func (m *MsgUpdateGovernorMetadata) GetNewMetadata() string { if m != nil { return m.NewMetadata } return "" } -// MsgUpdateResponse is the Msg/Update response type. -type MsgUpdateResponse struct { - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` +// MsgUpdateGovernorMetadataResponse is the Msg/UpdateGovernorMetadata response +// type. +type MsgUpdateGovernorMetadataResponse struct { + // address is the address of the governor. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (m *MsgUpdateResponse) Reset() { *m = MsgUpdateResponse{} } -func (m *MsgUpdateResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateResponse) ProtoMessage() {} -func (*MsgUpdateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7a84c7e9509d58dc, []int{7} +func (m *MsgUpdateGovernorMetadataResponse) Reset() { *m = MsgUpdateGovernorMetadataResponse{} } +func (m *MsgUpdateGovernorMetadataResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateGovernorMetadataResponse) ProtoMessage() {} +func (*MsgUpdateGovernorMetadataResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7a84c7e9509d58dc, []int{5} } -func (m *MsgUpdateResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateGovernorMetadataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpdateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateGovernorMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpdateResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateGovernorMetadataResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -395,62 +304,60 @@ func (m *MsgUpdateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *MsgUpdateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateResponse.Merge(m, src) +func (m *MsgUpdateGovernorMetadataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateGovernorMetadataResponse.Merge(m, src) } -func (m *MsgUpdateResponse) XXX_Size() int { +func (m *MsgUpdateGovernorMetadataResponse) XXX_Size() int { return m.Size() } -func (m *MsgUpdateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateResponse.DiscardUnknown(m) +func (m *MsgUpdateGovernorMetadataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateGovernorMetadataResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpdateResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateGovernorMetadataResponse proto.InternalMessageInfo -func (m *MsgUpdateResponse) GetGovernor() string { +func (m *MsgUpdateGovernorMetadataResponse) GetAddress() string { if m != nil { - return m.Governor + return m.Address } return "" } func init() { - proto.RegisterType((*MsgRegister)(nil), "chora.governor.v1.MsgRegister") - proto.RegisterType((*MsgRegisterResponse)(nil), "chora.governor.v1.MsgRegisterResponse") - proto.RegisterType((*MsgRemove)(nil), "chora.governor.v1.MsgRemove") - proto.RegisterType((*MsgRemoveResponse)(nil), "chora.governor.v1.MsgRemoveResponse") - proto.RegisterType((*MsgResign)(nil), "chora.governor.v1.MsgResign") - proto.RegisterType((*MsgResignResponse)(nil), "chora.governor.v1.MsgResignResponse") - proto.RegisterType((*MsgUpdate)(nil), "chora.governor.v1.MsgUpdate") - proto.RegisterType((*MsgUpdateResponse)(nil), "chora.governor.v1.MsgUpdateResponse") + proto.RegisterType((*MsgCreateGovernor)(nil), "chora.governor.v1.MsgCreateGovernor") + proto.RegisterType((*MsgCreateGovernorResponse)(nil), "chora.governor.v1.MsgCreateGovernorResponse") + proto.RegisterType((*MsgRemoveGovernor)(nil), "chora.governor.v1.MsgRemoveGovernor") + proto.RegisterType((*MsgRemoveGovernorResponse)(nil), "chora.governor.v1.MsgRemoveGovernorResponse") + proto.RegisterType((*MsgUpdateGovernorMetadata)(nil), "chora.governor.v1.MsgUpdateGovernorMetadata") + proto.RegisterType((*MsgUpdateGovernorMetadataResponse)(nil), "chora.governor.v1.MsgUpdateGovernorMetadataResponse") } func init() { proto.RegisterFile("chora/governor/v1/msg.proto", fileDescriptor_7a84c7e9509d58dc) } var fileDescriptor_7a84c7e9509d58dc = []byte{ - // 351 bytes of a gzipped FileDescriptorProto + // 339 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xce, 0xc8, 0x2f, 0x4a, 0xd4, 0x4f, 0xcf, 0x2f, 0x4b, 0x2d, 0xca, 0xcb, 0x2f, 0xd2, 0x2f, 0x33, 0xd4, 0xcf, 0x2d, 0x4e, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x04, 0x4b, 0xea, 0xc1, 0x24, 0xf5, 0xca, - 0x0c, 0xa5, 0xc4, 0x93, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0x41, 0x8a, 0x50, 0xd4, 0x2a, 0x85, 0x70, - 0x71, 0xfb, 0x16, 0xa7, 0x07, 0xa5, 0xa6, 0x67, 0x16, 0x97, 0xa4, 0x16, 0x09, 0x49, 0x71, 0x71, - 0xc0, 0xb4, 0x49, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0xc1, 0xf9, 0x20, 0xb9, 0xdc, 0xd4, 0x92, - 0xc4, 0x94, 0xc4, 0x92, 0x44, 0x09, 0x26, 0x88, 0x1c, 0x8c, 0x6f, 0xc5, 0xdb, 0xf4, 0x7c, 0x83, - 0x16, 0x5c, 0xa9, 0x92, 0x21, 0x97, 0x30, 0x92, 0xa9, 0x41, 0xa9, 0xc5, 0x05, 0xf9, 0x79, 0xc5, - 0xa9, 0xf8, 0x4c, 0x57, 0x32, 0xe3, 0xe2, 0x04, 0x6b, 0xc9, 0xcd, 0x2f, 0xc3, 0xab, 0x10, 0xdd, - 0x2a, 0x7d, 0x2e, 0x41, 0xb8, 0x3e, 0x92, 0x2c, 0x2a, 0xce, 0x4c, 0xcf, 0x23, 0xc7, 0x22, 0x90, - 0x3e, 0xa2, 0x2c, 0x8a, 0x04, 0x5b, 0x14, 0x5a, 0x90, 0x92, 0x58, 0x82, 0x57, 0xa1, 0x90, 0x22, - 0x17, 0x4f, 0x5e, 0x6a, 0x79, 0x3c, 0x5a, 0xe0, 0x72, 0xe7, 0xa5, 0x96, 0xfb, 0xe2, 0x08, 0x5f, - 0x88, 0x5b, 0x20, 0x46, 0x13, 0xe3, 0x16, 0xa3, 0xc3, 0x4c, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x42, - 0x41, 0x5c, 0x1c, 0xf0, 0xb8, 0x96, 0xd3, 0xc3, 0x48, 0x27, 0x7a, 0x48, 0xb1, 0x26, 0xa5, 0x86, - 0x5f, 0x1e, 0x6e, 0xaf, 0x0f, 0x17, 0x1b, 0x34, 0xda, 0x64, 0x70, 0xe9, 0x00, 0xc9, 0x4a, 0xa9, - 0xe0, 0x93, 0x45, 0x35, 0x0d, 0x1c, 0x37, 0x38, 0x4d, 0x03, 0xc9, 0xe2, 0x36, 0x0d, 0x25, 0x7e, - 0x7c, 0xb8, 0xd8, 0xa0, 0x11, 0x80, 0xc3, 0x34, 0x88, 0x2c, 0x2e, 0xd3, 0x50, 0x43, 0xd8, 0xc9, - 0xe5, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, - 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xb4, 0xd2, 0x33, 0x4b, 0x32, - 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xc1, 0x26, 0xe9, 0x66, 0xe6, 0xeb, 0xe7, 0xe6, 0xa7, - 0x14, 0x23, 0xb2, 0x68, 0x49, 0x65, 0x41, 0x6a, 0xb1, 0x7e, 0x99, 0x61, 0x12, 0x1b, 0x38, 0xe7, - 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x88, 0x41, 0xcb, 0x28, 0xc4, 0x03, 0x00, 0x00, + 0x0c, 0xa5, 0xc4, 0x93, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0x41, 0x8a, 0x50, 0xd4, 0x2a, 0x85, 0x73, + 0x09, 0xfa, 0x16, 0xa7, 0x3b, 0x17, 0xa5, 0x26, 0x96, 0xa4, 0xba, 0x43, 0x35, 0x08, 0x49, 0x70, + 0xb1, 0x27, 0xa6, 0xa4, 0x14, 0xa5, 0x16, 0x17, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0xc1, + 0xb8, 0x42, 0x52, 0x5c, 0x1c, 0xb9, 0xa9, 0x25, 0x89, 0x29, 0x89, 0x25, 0x89, 0x12, 0x4c, 0x60, + 0x29, 0x38, 0xdf, 0x8a, 0xa7, 0xe9, 0xf9, 0x06, 0x2d, 0x98, 0x4a, 0x25, 0x53, 0x2e, 0x49, 0x0c, + 0x83, 0x83, 0x52, 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x71, 0x5b, 0xa0, 0x64, 0x0d, 0x76, 0x4f, + 0x50, 0x6a, 0x6e, 0x7e, 0x19, 0x11, 0xee, 0xc1, 0x6a, 0x27, 0xaa, 0x66, 0x22, 0xec, 0x4c, 0x03, + 0x6b, 0x0b, 0x2d, 0x48, 0x41, 0x72, 0xaa, 0x2f, 0xd4, 0x57, 0x78, 0xc2, 0x42, 0x91, 0x8b, 0x27, + 0x2f, 0xb5, 0x3c, 0x1e, 0x2d, 0x3c, 0xb8, 0xf3, 0x52, 0xcb, 0x7d, 0xb1, 0x07, 0x89, 0x2d, 0x97, + 0x22, 0x4e, 0x7b, 0x08, 0x3b, 0xd3, 0xe8, 0x3c, 0x13, 0x17, 0xb3, 0x6f, 0x71, 0xba, 0x50, 0x0a, + 0x17, 0x1f, 0x5a, 0x7c, 0xa9, 0xe8, 0x61, 0xc4, 0xb8, 0x1e, 0x46, 0xe0, 0x4b, 0xe9, 0x10, 0xa3, + 0x0a, 0xee, 0x8e, 0x14, 0x2e, 0x3e, 0xb4, 0x58, 0xc0, 0x61, 0x0b, 0xaa, 0x2a, 0x5c, 0xb6, 0xe0, + 0x88, 0x94, 0x1a, 0x2e, 0x31, 0x1c, 0xe1, 0x8e, 0xc3, 0x1c, 0xec, 0xaa, 0xa5, 0x4c, 0x48, 0x51, + 0x0d, 0xb3, 0xdd, 0xc9, 0xe5, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, + 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xb4, + 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xc1, 0x26, 0xeb, 0x66, 0xe6, + 0xeb, 0xe7, 0xe6, 0xa7, 0x14, 0x23, 0xb2, 0x5c, 0x49, 0x65, 0x41, 0x6a, 0xb1, 0x7e, 0x99, 0x61, + 0x12, 0x1b, 0x38, 0x27, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x52, 0x17, 0x64, 0x55, 0x94, + 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -465,14 +372,12 @@ 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 { - // Register registers a governor (any account). - Register(ctx context.Context, in *MsgRegister, opts ...grpc.CallOption) (*MsgRegisterResponse, error) - // Remove removes a governor (only admin account). - Remove(ctx context.Context, in *MsgRemove, opts ...grpc.CallOption) (*MsgRemoveResponse, error) - // Resign resigns a governor (only governor account). - Resign(ctx context.Context, in *MsgResign, opts ...grpc.CallOption) (*MsgResignResponse, error) - // Update updates a governor (only governor account). - Update(ctx context.Context, in *MsgUpdate, opts ...grpc.CallOption) (*MsgUpdateResponse, error) + // CreateGovernor registers a governor. + CreateGovernor(ctx context.Context, in *MsgCreateGovernor, opts ...grpc.CallOption) (*MsgCreateGovernorResponse, error) + // RemoveGovernor removes a governor. + RemoveGovernor(ctx context.Context, in *MsgRemoveGovernor, opts ...grpc.CallOption) (*MsgRemoveGovernorResponse, error) + // UpdateGovernorMetadata updates a governor. + UpdateGovernorMetadata(ctx context.Context, in *MsgUpdateGovernorMetadata, opts ...grpc.CallOption) (*MsgUpdateGovernorMetadataResponse, error) } type msgClient struct { @@ -483,36 +388,27 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } -func (c *msgClient) Register(ctx context.Context, in *MsgRegister, opts ...grpc.CallOption) (*MsgRegisterResponse, error) { - out := new(MsgRegisterResponse) - err := c.cc.Invoke(ctx, "/chora.governor.v1.Msg/Register", in, out, opts...) +func (c *msgClient) CreateGovernor(ctx context.Context, in *MsgCreateGovernor, opts ...grpc.CallOption) (*MsgCreateGovernorResponse, error) { + out := new(MsgCreateGovernorResponse) + err := c.cc.Invoke(ctx, "/chora.governor.v1.Msg/CreateGovernor", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *msgClient) Remove(ctx context.Context, in *MsgRemove, opts ...grpc.CallOption) (*MsgRemoveResponse, error) { - out := new(MsgRemoveResponse) - err := c.cc.Invoke(ctx, "/chora.governor.v1.Msg/Remove", in, out, opts...) +func (c *msgClient) RemoveGovernor(ctx context.Context, in *MsgRemoveGovernor, opts ...grpc.CallOption) (*MsgRemoveGovernorResponse, error) { + out := new(MsgRemoveGovernorResponse) + err := c.cc.Invoke(ctx, "/chora.governor.v1.Msg/RemoveGovernor", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *msgClient) Resign(ctx context.Context, in *MsgResign, opts ...grpc.CallOption) (*MsgResignResponse, error) { - out := new(MsgResignResponse) - err := c.cc.Invoke(ctx, "/chora.governor.v1.Msg/Resign", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Update(ctx context.Context, in *MsgUpdate, opts ...grpc.CallOption) (*MsgUpdateResponse, error) { - out := new(MsgUpdateResponse) - err := c.cc.Invoke(ctx, "/chora.governor.v1.Msg/Update", in, out, opts...) +func (c *msgClient) UpdateGovernorMetadata(ctx context.Context, in *MsgUpdateGovernorMetadata, opts ...grpc.CallOption) (*MsgUpdateGovernorMetadataResponse, error) { + out := new(MsgUpdateGovernorMetadataResponse) + err := c.cc.Invoke(ctx, "/chora.governor.v1.Msg/UpdateGovernorMetadata", in, out, opts...) if err != nil { return nil, err } @@ -521,105 +417,82 @@ func (c *msgClient) Update(ctx context.Context, in *MsgUpdate, opts ...grpc.Call // MsgServer is the server API for Msg service. type MsgServer interface { - // Register registers a governor (any account). - Register(context.Context, *MsgRegister) (*MsgRegisterResponse, error) - // Remove removes a governor (only admin account). - Remove(context.Context, *MsgRemove) (*MsgRemoveResponse, error) - // Resign resigns a governor (only governor account). - Resign(context.Context, *MsgResign) (*MsgResignResponse, error) - // Update updates a governor (only governor account). - Update(context.Context, *MsgUpdate) (*MsgUpdateResponse, error) + // CreateGovernor registers a governor. + CreateGovernor(context.Context, *MsgCreateGovernor) (*MsgCreateGovernorResponse, error) + // RemoveGovernor removes a governor. + RemoveGovernor(context.Context, *MsgRemoveGovernor) (*MsgRemoveGovernorResponse, error) + // UpdateGovernorMetadata updates a governor. + UpdateGovernorMetadata(context.Context, *MsgUpdateGovernorMetadata) (*MsgUpdateGovernorMetadataResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. type UnimplementedMsgServer struct { } -func (*UnimplementedMsgServer) Register(ctx context.Context, req *MsgRegister) (*MsgRegisterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") +func (*UnimplementedMsgServer) CreateGovernor(ctx context.Context, req *MsgCreateGovernor) (*MsgCreateGovernorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateGovernor not implemented") } -func (*UnimplementedMsgServer) Remove(ctx context.Context, req *MsgRemove) (*MsgRemoveResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Remove not implemented") +func (*UnimplementedMsgServer) RemoveGovernor(ctx context.Context, req *MsgRemoveGovernor) (*MsgRemoveGovernorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveGovernor not implemented") } -func (*UnimplementedMsgServer) Resign(ctx context.Context, req *MsgResign) (*MsgResignResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Resign not implemented") -} -func (*UnimplementedMsgServer) Update(ctx context.Context, req *MsgUpdate) (*MsgUpdateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") +func (*UnimplementedMsgServer) UpdateGovernorMetadata(ctx context.Context, req *MsgUpdateGovernorMetadata) (*MsgUpdateGovernorMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateGovernorMetadata not implemented") } func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } -func _Msg_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRegister) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Register(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/chora.governor.v1.Msg/Register", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Register(ctx, req.(*MsgRegister)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRemove) +func _Msg_CreateGovernor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateGovernor) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).Remove(ctx, in) + return srv.(MsgServer).CreateGovernor(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/chora.governor.v1.Msg/Remove", + FullMethod: "/chora.governor.v1.Msg/CreateGovernor", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Remove(ctx, req.(*MsgRemove)) + return srv.(MsgServer).CreateGovernor(ctx, req.(*MsgCreateGovernor)) } return interceptor(ctx, in, info, handler) } -func _Msg_Resign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgResign) +func _Msg_RemoveGovernor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRemoveGovernor) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).Resign(ctx, in) + return srv.(MsgServer).RemoveGovernor(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/chora.governor.v1.Msg/Resign", + FullMethod: "/chora.governor.v1.Msg/RemoveGovernor", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Resign(ctx, req.(*MsgResign)) + return srv.(MsgServer).RemoveGovernor(ctx, req.(*MsgRemoveGovernor)) } return interceptor(ctx, in, info, handler) } -func _Msg_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdate) +func _Msg_UpdateGovernorMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateGovernorMetadata) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).Update(ctx, in) + return srv.(MsgServer).UpdateGovernorMetadata(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/chora.governor.v1.Msg/Update", + FullMethod: "/chora.governor.v1.Msg/UpdateGovernorMetadata", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Update(ctx, req.(*MsgUpdate)) + return srv.(MsgServer).UpdateGovernorMetadata(ctx, req.(*MsgUpdateGovernorMetadata)) } return interceptor(ctx, in, info, handler) } @@ -629,27 +502,23 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "Register", - Handler: _Msg_Register_Handler, - }, - { - MethodName: "Remove", - Handler: _Msg_Remove_Handler, + MethodName: "CreateGovernor", + Handler: _Msg_CreateGovernor_Handler, }, { - MethodName: "Resign", - Handler: _Msg_Resign_Handler, + MethodName: "RemoveGovernor", + Handler: _Msg_RemoveGovernor_Handler, }, { - MethodName: "Update", - Handler: _Msg_Update_Handler, + MethodName: "UpdateGovernorMetadata", + Handler: _Msg_UpdateGovernorMetadata_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "chora/governor/v1/msg.proto", } -func (m *MsgRegister) Marshal() (dAtA []byte, err error) { +func (m *MsgCreateGovernor) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -659,12 +528,12 @@ func (m *MsgRegister) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgRegister) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgCreateGovernor) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRegister) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgCreateGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -676,47 +545,17 @@ func (m *MsgRegister) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.Governor) > 0 { - i -= len(m.Governor) - copy(dAtA[i:], m.Governor) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Governor))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgRegisterResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgRegisterResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRegisterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Governor) > 0 { - i -= len(m.Governor) - copy(dAtA[i:], m.Governor) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Governor))) + 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] = 0xa } return len(dAtA) - i, nil } -func (m *MsgRemove) Marshal() (dAtA []byte, err error) { +func (m *MsgCreateGovernorResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -726,27 +565,27 @@ func (m *MsgRemove) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgRemove) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgCreateGovernorResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgCreateGovernorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Governor) > 0 { - i -= len(m.Governor) - copy(dAtA[i:], m.Governor) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Governor))) + 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] = 0xa } return len(dAtA) - i, nil } -func (m *MsgRemoveResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgRemoveGovernor) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -756,27 +595,27 @@ func (m *MsgRemoveResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgRemoveResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgRemoveGovernor) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRemoveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgRemoveGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Governor) > 0 { - i -= len(m.Governor) - copy(dAtA[i:], m.Governor) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Governor))) + 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] = 0xa } return len(dAtA) - i, nil } -func (m *MsgResign) Marshal() (dAtA []byte, err error) { +func (m *MsgRemoveGovernorResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -786,27 +625,27 @@ func (m *MsgResign) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgResign) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgRemoveGovernorResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgResign) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgRemoveGovernorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Governor) > 0 { - i -= len(m.Governor) - copy(dAtA[i:], m.Governor) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Governor))) + 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] = 0xa } return len(dAtA) - i, nil } -func (m *MsgResignResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateGovernorMetadata) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -816,42 +655,12 @@ func (m *MsgResignResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgResignResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateGovernorMetadata) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgResignResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Governor) > 0 { - i -= len(m.Governor) - copy(dAtA[i:], m.Governor) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Governor))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdate) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUpdate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateGovernorMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -863,17 +672,17 @@ func (m *MsgUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.Governor) > 0 { - i -= len(m.Governor) - copy(dAtA[i:], m.Governor) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Governor))) + 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] = 0xa } return len(dAtA) - i, nil } -func (m *MsgUpdateResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateGovernorMetadataResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -883,20 +692,20 @@ func (m *MsgUpdateResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateGovernorMetadataResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateGovernorMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Governor) > 0 { - i -= len(m.Governor) - copy(dAtA[i:], m.Governor) - i = encodeVarintMsg(dAtA, i, uint64(len(m.Governor))) + 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] = 0xa } @@ -914,13 +723,13 @@ func encodeVarintMsg(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgRegister) Size() (n int) { +func (m *MsgCreateGovernor) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Governor) + l = len(m.Address) if l > 0 { n += 1 + l + sovMsg(uint64(l)) } @@ -931,78 +740,52 @@ func (m *MsgRegister) Size() (n int) { return n } -func (m *MsgRegisterResponse) Size() (n int) { +func (m *MsgCreateGovernorResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Governor) + l = len(m.Address) if l > 0 { n += 1 + l + sovMsg(uint64(l)) } return n } -func (m *MsgRemove) Size() (n int) { +func (m *MsgRemoveGovernor) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Governor) + l = len(m.Address) if l > 0 { n += 1 + l + sovMsg(uint64(l)) } return n } -func (m *MsgRemoveResponse) Size() (n int) { +func (m *MsgRemoveGovernorResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Governor) + l = len(m.Address) if l > 0 { n += 1 + l + sovMsg(uint64(l)) } return n } -func (m *MsgResign) Size() (n int) { +func (m *MsgUpdateGovernorMetadata) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Governor) - if l > 0 { - n += 1 + l + sovMsg(uint64(l)) - } - return n -} - -func (m *MsgResignResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Governor) - if l > 0 { - n += 1 + l + sovMsg(uint64(l)) - } - return n -} - -func (m *MsgUpdate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Governor) + l = len(m.Address) if l > 0 { n += 1 + l + sovMsg(uint64(l)) } @@ -1013,13 +796,13 @@ func (m *MsgUpdate) Size() (n int) { return n } -func (m *MsgUpdateResponse) Size() (n int) { +func (m *MsgUpdateGovernorMetadataResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Governor) + l = len(m.Address) if l > 0 { n += 1 + l + sovMsg(uint64(l)) } @@ -1032,7 +815,7 @@ func sovMsg(x uint64) (n int) { func sozMsg(x uint64) (n int) { return sovMsg(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgRegister) Unmarshal(dAtA []byte) error { +func (m *MsgCreateGovernor) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1055,15 +838,15 @@ func (m *MsgRegister) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRegister: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateGovernor: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegister: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateGovernor: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Governor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1091,7 +874,7 @@ func (m *MsgRegister) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Governor = string(dAtA[iNdEx:postIndex]) + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -1146,171 +929,7 @@ func (m *MsgRegister) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRegisterResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMsg - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgRegisterResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Governor", 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.Governor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMsg(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMsg - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRemove) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMsg - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgRemove: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRemove: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Governor", 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.Governor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMsg(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMsg - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRemoveResponse) Unmarshal(dAtA []byte) error { +func (m *MsgCreateGovernorResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1333,15 +952,15 @@ func (m *MsgRemoveResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRemoveResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateGovernorResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRemoveResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateGovernorResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Governor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1369,7 +988,7 @@ func (m *MsgRemoveResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Governor = string(dAtA[iNdEx:postIndex]) + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1392,7 +1011,7 @@ func (m *MsgRemoveResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgResign) Unmarshal(dAtA []byte) error { +func (m *MsgRemoveGovernor) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1415,15 +1034,15 @@ func (m *MsgResign) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgResign: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRemoveGovernor: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgResign: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRemoveGovernor: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Governor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1451,7 +1070,7 @@ func (m *MsgResign) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Governor = string(dAtA[iNdEx:postIndex]) + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1474,7 +1093,7 @@ func (m *MsgResign) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgResignResponse) Unmarshal(dAtA []byte) error { +func (m *MsgRemoveGovernorResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1497,15 +1116,15 @@ func (m *MsgResignResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgResignResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRemoveGovernorResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgResignResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRemoveGovernorResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Governor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1533,7 +1152,7 @@ func (m *MsgResignResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Governor = string(dAtA[iNdEx:postIndex]) + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1556,7 +1175,7 @@ func (m *MsgResignResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdate) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateGovernorMetadata) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1579,15 +1198,15 @@ func (m *MsgUpdate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdate: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateGovernorMetadata: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateGovernorMetadata: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Governor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1615,7 +1234,7 @@ func (m *MsgUpdate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Governor = string(dAtA[iNdEx:postIndex]) + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -1670,7 +1289,7 @@ func (m *MsgUpdate) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateGovernorMetadataResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1693,15 +1312,15 @@ func (m *MsgUpdateResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateGovernorMetadataResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateGovernorMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Governor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1729,7 +1348,7 @@ func (m *MsgUpdateResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Governor = string(dAtA[iNdEx:postIndex]) + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/governor/types/v1/msg_add_validator_test.go b/governor/types/v1/msg_add_validator_test.go deleted file mode 100644 index a441c7b..0000000 --- a/governor/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("./features/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/governor/types/v1/features/msg_add_governor.feature b/governor/types/v1/msg_create_governor.feature similarity index 62% rename from governor/types/v1/features/msg_add_governor.feature rename to governor/types/v1/msg_create_governor.feature index 63cd0b9..5b29638 100644 --- a/governor/types/v1/features/msg_add_governor.feature +++ b/governor/types/v1/msg_create_governor.feature @@ -1,10 +1,9 @@ -Feature: MsgAddValidator +Feature: MsgCreateGovernor Scenario: valid message Given message """ { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" } @@ -12,36 +11,10 @@ Feature: MsgAddValidator 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 @@ -53,7 +26,6 @@ Feature: MsgAddValidator Given message """ { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", "address": "foo" } """ @@ -67,7 +39,6 @@ Feature: MsgAddValidator Given message """ { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" } """ @@ -81,7 +52,6 @@ Feature: MsgAddValidator Given message """ { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" } """ diff --git a/governor/types/v1/msg_add_validator.go b/governor/types/v1/msg_create_governor.go similarity index 57% rename from governor/types/v1/msg_add_validator.go rename to governor/types/v1/msg_create_governor.go index ac16605..dcc91c0 100644 --- a/governor/types/v1/msg_add_validator.go +++ b/governor/types/v1/msg_create_governor.go @@ -5,14 +5,10 @@ import ( 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) - } +var _ sdk.Msg = &MsgCreateGovernor{} +// ValidateBasic performs stateless validation on MsgCreateGovernor. +func (m MsgCreateGovernor) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(m.Address); err != nil { return sdkerrors.ErrInvalidAddress.Wrapf("address: %s", err) } @@ -28,18 +24,18 @@ func (m MsgAddValidator) ValidateBasic() error { return nil } -// GetSigners returns the expected signers for MsgAddValidator. -func (m MsgAddValidator) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(m.Admin) +// GetSigners returns the expected signers for MsgCreateGovernor. +func (m MsgCreateGovernor) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(m.Address) return []sdk.AccAddress{addr} } // Route implements the LegacyMsg interface. -func (m MsgAddValidator) Route() string { +func (m MsgCreateGovernor) Route() string { return sdk.MsgTypeURL(&m) } // Type implements the LegacyMsg interface. -func (m MsgAddValidator) Type() string { +func (m MsgCreateGovernor) Type() string { return sdk.MsgTypeURL(&m) } diff --git a/governor/types/v1/msg_create_governor_test.go b/governor/types/v1/msg_create_governor_test.go new file mode 100644 index 0000000..98a6b26 --- /dev/null +++ b/governor/types/v1/msg_create_governor_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 msgCreateGovernor struct { + t gocuke.TestingT + msg *MsgCreateGovernor + err error +} + +func TestMsgCreateGovernor(t *testing.T) { + gocuke.NewRunner(t, &msgCreateGovernor{}). + Path("./msg_create_governor.feature"). + Run() +} + +func (s *msgCreateGovernor) Before(t gocuke.TestingT) { + s.t = t +} + +func (s *msgCreateGovernor) Message(a gocuke.DocString) { + s.msg = &MsgCreateGovernor{} + err := jsonpb.UnmarshalString(a.Content, s.msg) + require.NoError(s.t, err) +} + +func (s *msgCreateGovernor) 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 *msgCreateGovernor) ValidateMessage() { + s.err = s.msg.ValidateBasic() +} + +func (s *msgCreateGovernor) ExpectNoError() { + require.NoError(s.t, s.err) +} + +func (s *msgCreateGovernor) ExpectTheError(a gocuke.DocString) { + require.EqualError(s.t, s.err, a.Content) +} diff --git a/governor/types/v1/msg_remove_governor.feature b/governor/types/v1/msg_remove_governor.feature new file mode 100644 index 0000000..b7cc648 --- /dev/null +++ b/governor/types/v1/msg_remove_governor.feature @@ -0,0 +1,35 @@ +Feature: MsgRemoveGovernor + + Scenario: valid message + Given message + """ + { + "address": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup" + } + """ + When validate message + Then expect no error + + Scenario: an error is returned if address is empty + Given message + """ + {} + """ + 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 + """ + { + "address": "foo" + } + """ + When validate message + Then expect the error + """ + address: decoding bech32 failed: invalid bech32 string length 3: invalid address + """ diff --git a/governor/types/v1/msg_remove_governor.go b/governor/types/v1/msg_remove_governor.go new file mode 100644 index 0000000..2169a6c --- /dev/null +++ b/governor/types/v1/msg_remove_governor.go @@ -0,0 +1,33 @@ +package v1 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgRemoveGovernor{} + +// ValidateBasic performs stateless validation on MsgRemoveGovernor. +func (m MsgRemoveGovernor) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Address); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("address: %s", err) + } + + return nil +} + +// GetSigners returns the expected signers for MsgRemoveGovernor. +func (m MsgRemoveGovernor) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(m.Address) + return []sdk.AccAddress{addr} +} + +// Route implements the LegacyMsg interface. +func (m MsgRemoveGovernor) Route() string { + return sdk.MsgTypeURL(&m) +} + +// Type implements the LegacyMsg interface. +func (m MsgRemoveGovernor) Type() string { + return sdk.MsgTypeURL(&m) +} diff --git a/governor/types/v1/msg_remove_governor_test.go b/governor/types/v1/msg_remove_governor_test.go new file mode 100644 index 0000000..9142f19 --- /dev/null +++ b/governor/types/v1/msg_remove_governor_test.go @@ -0,0 +1,43 @@ +package v1 + +import ( + "testing" + + "github.com/cosmos/gogoproto/jsonpb" + "github.com/regen-network/gocuke" + "github.com/stretchr/testify/require" +) + +type msgRemoveGovernor struct { + t gocuke.TestingT + msg *MsgRemoveGovernor + err error +} + +func TestMsgRemoveGovernor(t *testing.T) { + gocuke.NewRunner(t, &msgRemoveGovernor{}). + Path("./msg_remove_governor.feature"). + Run() +} + +func (s *msgRemoveGovernor) Before(t gocuke.TestingT) { + s.t = t +} + +func (s *msgRemoveGovernor) Message(a gocuke.DocString) { + s.msg = &MsgRemoveGovernor{} + err := jsonpb.UnmarshalString(a.Content, s.msg) + require.NoError(s.t, err) +} + +func (s *msgRemoveGovernor) ValidateMessage() { + s.err = s.msg.ValidateBasic() +} + +func (s *msgRemoveGovernor) ExpectNoError() { + require.NoError(s.t, s.err) +} + +func (s *msgRemoveGovernor) ExpectTheError(a gocuke.DocString) { + require.EqualError(s.t, s.err, a.Content) +} diff --git a/governor/types/v1/msg_remove_validator.go b/governor/types/v1/msg_remove_validator.go deleted file mode 100644 index 07194fe..0000000 --- a/governor/types/v1/msg_remove_validator.go +++ /dev/null @@ -1,37 +0,0 @@ -package v1 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -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.Address); err != nil { - return sdkerrors.ErrInvalidAddress.Wrapf("address: %s", err) - } - - return nil -} - -// GetSigners returns the expected signers for MsgRemoveValidator. -func (m MsgRemoveValidator) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(m.Admin) - return []sdk.AccAddress{addr} -} - -// Route implements the LegacyMsg interface. -func (m MsgRemoveValidator) Route() string { - return sdk.MsgTypeURL(&m) -} - -// Type implements the LegacyMsg interface. -func (m MsgRemoveValidator) Type() string { - return sdk.MsgTypeURL(&m) -} diff --git a/governor/types/v1/msg_remove_validator_test.go b/governor/types/v1/msg_remove_validator_test.go deleted file mode 100644 index 2cd663b..0000000 --- a/governor/types/v1/msg_remove_validator_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package v1 - -import ( - "testing" - - "github.com/cosmos/gogoproto/jsonpb" - "github.com/regen-network/gocuke" - "github.com/stretchr/testify/require" -) - -type msgRemoveValidator struct { - t gocuke.TestingT - msg *MsgRemoveValidator - err error -} - -func TestMsgRemoveValidator(t *testing.T) { - gocuke.NewRunner(t, &msgRemoveValidator{}). - Path("./features/msg_remove_validator.feature"). - Run() -} - -func (s *msgRemoveValidator) Before(t gocuke.TestingT) { - s.t = t -} - -func (s *msgRemoveValidator) Message(a gocuke.DocString) { - s.msg = &MsgRemoveValidator{} - err := jsonpb.UnmarshalString(a.Content, s.msg) - require.NoError(s.t, err) -} - -func (s *msgRemoveValidator) ValidateMessage() { - s.err = s.msg.ValidateBasic() -} - -func (s *msgRemoveValidator) ExpectNoError() { - require.NoError(s.t, s.err) -} - -func (s *msgRemoveValidator) ExpectTheError(a gocuke.DocString) { - require.EqualError(s.t, s.err, a.Content) -} diff --git a/governor/types/v1/features/msg_update_governor.feature b/governor/types/v1/msg_update_governor_metadata.feature similarity index 97% rename from governor/types/v1/features/msg_update_governor.feature rename to governor/types/v1/msg_update_governor_metadata.feature index 2826b04..068ecd6 100644 --- a/governor/types/v1/features/msg_update_governor.feature +++ b/governor/types/v1/msg_update_governor_metadata.feature @@ -1,4 +1,4 @@ -Feature: MsgUpdateValidator +Feature: MsgUpdateGovernorMetadata Scenario: valid message Given message diff --git a/governor/types/v1/msg_update_validator.go b/governor/types/v1/msg_update_governor_metadata.go similarity index 64% rename from governor/types/v1/msg_update_validator.go rename to governor/types/v1/msg_update_governor_metadata.go index 131a678..29d0cf0 100644 --- a/governor/types/v1/msg_update_validator.go +++ b/governor/types/v1/msg_update_governor_metadata.go @@ -5,10 +5,10 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -var _ sdk.Msg = &MsgUpdateValidator{} +var _ sdk.Msg = &MsgUpdateGovernorMetadata{} -// ValidateBasic performs stateless validation on MsgUpdateValidator. -func (m MsgUpdateValidator) ValidateBasic() error { +// ValidateBasic performs stateless validation on MsgUpdateGovernorMetadata. +func (m MsgUpdateGovernorMetadata) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(m.Address); err != nil { return sdkerrors.ErrInvalidAddress.Wrapf("address: %s", err) } @@ -24,18 +24,18 @@ func (m MsgUpdateValidator) ValidateBasic() error { return nil } -// GetSigners returns the expected signers for MsgUpdateValidator. -func (m MsgUpdateValidator) GetSigners() []sdk.AccAddress { +// GetSigners returns the expected signers for MsgUpdateGovernorMetadata. +func (m MsgUpdateGovernorMetadata) GetSigners() []sdk.AccAddress { addr, _ := sdk.AccAddressFromBech32(m.Address) return []sdk.AccAddress{addr} } // Route implements the LegacyMsg interface. -func (m MsgUpdateValidator) Route() string { +func (m MsgUpdateGovernorMetadata) Route() string { return sdk.MsgTypeURL(&m) } // Type implements the LegacyMsg interface. -func (m MsgUpdateValidator) Type() string { +func (m MsgUpdateGovernorMetadata) Type() string { return sdk.MsgTypeURL(&m) } diff --git a/governor/types/v1/msg_update_governor_metadata_test.go b/governor/types/v1/msg_update_governor_metadata_test.go new file mode 100644 index 0000000..89e7fe2 --- /dev/null +++ b/governor/types/v1/msg_update_governor_metadata_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 msgUpdateGovernorMetadata struct { + t gocuke.TestingT + msg *MsgUpdateGovernorMetadata + err error +} + +func TestMsgUpdateGovernorMetadata(t *testing.T) { + gocuke.NewRunner(t, &msgUpdateGovernorMetadata{}). + Path("./msg_update_governor_metadata.feature"). + Run() +} + +func (s *msgUpdateGovernorMetadata) Before(t gocuke.TestingT) { + s.t = t +} + +func (s *msgUpdateGovernorMetadata) Message(a gocuke.DocString) { + s.msg = &MsgUpdateGovernorMetadata{} + err := jsonpb.UnmarshalString(a.Content, s.msg) + require.NoError(s.t, err) +} + +func (s *msgUpdateGovernorMetadata) NewMetadataWithLength(a string) { + length, err := strconv.ParseInt(a, 10, 64) + require.NoError(s.t, err) + + s.msg.NewMetadata = strings.Repeat("x", int(length)) +} + +func (s *msgUpdateGovernorMetadata) ValidateMessage() { + s.err = s.msg.ValidateBasic() +} + +func (s *msgUpdateGovernorMetadata) ExpectNoError() { + require.NoError(s.t, s.err) +} + +func (s *msgUpdateGovernorMetadata) ExpectTheError(a gocuke.DocString) { + require.EqualError(s.t, s.err, a.Content) +} diff --git a/governor/types/v1/msg_update_max_missed_blocks.go b/governor/types/v1/msg_update_max_missed_blocks.go deleted file mode 100644 index 4cec904..0000000 --- a/governor/types/v1/msg_update_max_missed_blocks.go +++ /dev/null @@ -1,33 +0,0 @@ -package v1 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -var _ sdk.Msg = &MsgUpdatePolicy{} - -// ValidateBasic performs stateless validation on MsgUpdatePolicy. -func (m MsgUpdatePolicy) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(m.Admin); err != nil { - return sdkerrors.ErrInvalidAddress.Wrapf("admin: %s", err) - } - - return nil -} - -// GetSigners returns the expected signers for MsgUpdatePolicy. -func (m MsgUpdatePolicy) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(m.Admin) - return []sdk.AccAddress{addr} -} - -// Route implements the LegacyMsg interface. -func (m MsgUpdatePolicy) Route() string { - return sdk.MsgTypeURL(&m) -} - -// Type implements the LegacyMsg interface. -func (m MsgUpdatePolicy) Type() string { - return sdk.MsgTypeURL(&m) -} diff --git a/governor/types/v1/msg_update_max_missed_blocks_test.go b/governor/types/v1/msg_update_max_missed_blocks_test.go deleted file mode 100644 index ab22862..0000000 --- a/governor/types/v1/msg_update_max_missed_blocks_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package v1 - -import ( - "testing" - - "github.com/cosmos/gogoproto/jsonpb" - "github.com/regen-network/gocuke" - "github.com/stretchr/testify/require" -) - -type msgUpdatePolicy struct { - t gocuke.TestingT - msg *MsgUpdatePolicy - err error -} - -func TestMsgUpdatePolicy(t *testing.T) { - gocuke.NewRunner(t, &msgUpdatePolicy{}). - Path("./features/msg_update_max_missed_blocks.feature"). - Run() -} - -func (s *msgUpdatePolicy) Before(t gocuke.TestingT) { - s.t = t -} - -func (s *msgUpdatePolicy) Message(a gocuke.DocString) { - s.msg = &MsgUpdatePolicy{} - err := jsonpb.UnmarshalString(a.Content, s.msg) - require.NoError(s.t, err) -} - -func (s *msgUpdatePolicy) ValidateMessage() { - s.err = s.msg.ValidateBasic() -} - -func (s *msgUpdatePolicy) ExpectNoError() { - require.NoError(s.t, s.err) -} - -func (s *msgUpdatePolicy) ExpectTheError(a gocuke.DocString) { - require.EqualError(s.t, s.err, a.Content) -} diff --git a/governor/types/v1/msg_update_validator_test.go b/governor/types/v1/msg_update_validator_test.go deleted file mode 100644 index 23a834c..0000000 --- a/governor/types/v1/msg_update_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 msgUpdateValidator struct { - t gocuke.TestingT - msg *MsgUpdateValidator - err error -} - -func TestMsgUpdateValidator(t *testing.T) { - gocuke.NewRunner(t, &msgUpdateValidator{}). - Path("./features/msg_update_validator.feature"). - Run() -} - -func (s *msgUpdateValidator) Before(t gocuke.TestingT) { - s.t = t -} - -func (s *msgUpdateValidator) Message(a gocuke.DocString) { - s.msg = &MsgUpdateValidator{} - err := jsonpb.UnmarshalString(a.Content, s.msg) - require.NoError(s.t, err) -} - -func (s *msgUpdateValidator) NewMetadataWithLength(a string) { - length, err := strconv.ParseInt(a, 10, 64) - require.NoError(s.t, err) - - s.msg.NewMetadata = strings.Repeat("x", int(length)) -} - -func (s *msgUpdateValidator) ValidateMessage() { - s.err = s.msg.ValidateBasic() -} - -func (s *msgUpdateValidator) ExpectNoError() { - require.NoError(s.t, s.err) -} - -func (s *msgUpdateValidator) ExpectTheError(a gocuke.DocString) { - require.EqualError(s.t, s.err, a.Content) -} diff --git a/governor/types/v1/state.pb.go b/governor/types/v1/state.pb.go index a720f7a..0e1c44b 100644 --- a/governor/types/v1/state.pb.go +++ b/governor/types/v1/state.pb.go @@ -25,8 +25,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Governor defines the table and properties of a governor. type Governor struct { - // governor is the address of the governor. - Governor string `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` + // address is the address of the governor. + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // metadata is the metadata of the governor. Metadata string `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` } @@ -64,11 +64,11 @@ func (m *Governor) XXX_DiscardUnknown() { var xxx_messageInfo_Governor proto.InternalMessageInfo -func (m *Governor) GetGovernor() string { +func (m *Governor) GetAddress() []byte { if m != nil { - return m.Governor + return m.Address } - return "" + return nil } func (m *Governor) GetMetadata() string { @@ -85,20 +85,21 @@ func init() { func init() { proto.RegisterFile("chora/governor/v1/state.proto", fileDescriptor_8a431de71a1c4e75) } var fileDescriptor_8a431de71a1c4e75 = []byte{ - // 201 bytes of a gzipped FileDescriptorProto + // 210 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0xce, 0xc8, 0x2f, 0x4a, 0xd4, 0x4f, 0xcf, 0x2f, 0x4b, 0x2d, 0xca, 0xcb, 0x2f, 0xd2, 0x2f, 0x33, 0xd4, 0x2f, 0x2e, 0x49, 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x04, 0x4b, 0xeb, 0xc1, 0xa4, 0xf5, 0xca, 0x0c, 0xa5, 0xc4, 0x93, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xf5, 0xf3, 0x8b, 0x72, 0x41, - 0xaa, 0xf3, 0x8b, 0x72, 0x21, 0x6a, 0x95, 0x22, 0xb8, 0x38, 0xdc, 0xa1, 0xea, 0x84, 0xa4, 0xb8, - 0x38, 0x60, 0x7a, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0xe0, 0x7c, 0x90, 0x5c, 0x6e, 0x6a, - 0x49, 0x62, 0x4a, 0x62, 0x49, 0xa2, 0x04, 0x13, 0x44, 0x0e, 0xc6, 0xb7, 0x12, 0xf9, 0x34, 0xef, - 0x72, 0x1f, 0x33, 0x1f, 0x17, 0x17, 0x92, 0x7e, 0x26, 0x27, 0x97, 0x13, 0x8f, 0xe4, 0x18, 0x2f, - 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, - 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x4a, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, - 0xd5, 0x07, 0x3b, 0x55, 0x37, 0x33, 0x5f, 0x3f, 0x37, 0x3f, 0xa5, 0x18, 0xe1, 0xa3, 0x92, 0xca, - 0x82, 0xd4, 0x62, 0xfd, 0x32, 0xc3, 0x24, 0x36, 0xb0, 0x33, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x64, 0xfd, 0xca, 0xcf, 0xf3, 0x00, 0x00, 0x00, + 0xaa, 0xf3, 0x8b, 0x72, 0x21, 0x6a, 0x95, 0x42, 0xb9, 0x38, 0xdc, 0xa1, 0xea, 0x84, 0x24, 0xb8, + 0xd8, 0x13, 0x53, 0x52, 0x8a, 0x52, 0x8b, 0x8b, 0x25, 0x18, 0x15, 0x18, 0x35, 0x78, 0x82, 0x60, + 0x5c, 0x21, 0x29, 0x2e, 0x8e, 0xdc, 0xd4, 0x92, 0xc4, 0x94, 0xc4, 0x92, 0x44, 0x09, 0x26, 0x05, + 0x46, 0x0d, 0xce, 0x20, 0x38, 0xdf, 0x4a, 0xf8, 0xd3, 0xbc, 0xcb, 0x7d, 0xcc, 0xbc, 0x5c, 0x9c, + 0x48, 0xba, 0x9d, 0x5c, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, + 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x2b, + 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xec, 0x4e, 0xdd, 0xcc, 0x7c, + 0xfd, 0xdc, 0xfc, 0x94, 0x62, 0x84, 0x77, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0xf5, 0xcb, 0x0c, 0x93, + 0xd8, 0xc0, 0x6e, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x91, 0xfe, 0x73, 0x06, 0xf0, 0x00, + 0x00, 0x00, } func (m *Governor) Marshal() (dAtA []byte, err error) { @@ -128,10 +129,10 @@ func (m *Governor) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.Governor) > 0 { - i -= len(m.Governor) - copy(dAtA[i:], m.Governor) - i = encodeVarintState(dAtA, i, uint64(len(m.Governor))) + 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 } @@ -155,7 +156,7 @@ func (m *Governor) Size() (n int) { } var l int _ = l - l = len(m.Governor) + l = len(m.Address) if l > 0 { n += 1 + l + sovState(uint64(l)) } @@ -203,9 +204,9 @@ func (m *Governor) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Governor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -215,23 +216,25 @@ func (m *Governor) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthState } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthState } if postIndex > l { return io.ErrUnexpectedEOF } - m.Governor = string(dAtA[iNdEx:postIndex]) + m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) + if m.Address == nil { + m.Address = []byte{} + } iNdEx = postIndex case 2: if wireType != 2 { diff --git a/governor/types/v1/features/state_governor.feature b/governor/types/v1/state_governor.feature similarity index 80% rename from governor/types/v1/features/state_governor.feature rename to governor/types/v1/state_governor.feature index b6966e6..8e748ca 100644 --- a/governor/types/v1/features/state_governor.feature +++ b/governor/types/v1/state_governor.feature @@ -1,62 +1,62 @@ -Feature: Validator +Feature: Governor - Scenario: valid validator - Given validator + Scenario: valid governor + Given governor """ { "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", "metadata": "chora:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf" } """ - When validate validator + When validate governor Then expect no error Scenario: an error is returned if address is empty - Given validator + Given governor """ {} """ - When validate validator + When validate governor Then expect the error """ address: empty address string is not allowed: parse error """ Scenario: an error is returned if address is not a bech32 address - Given validator + Given governor """ { "address": "foo" } """ - When validate validator + When validate governor Then expect the error """ address: decoding bech32 failed: invalid bech32 string length 3: parse error """ Scenario: an error is returned if metadata is empty - Given validator + Given governor """ { "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" } """ - When validate validator + When validate governor Then expect the error """ metadata: empty string is not allowed: parse error """ Scenario: an error is returned if metadata exceeds 128 characters - Given validator + Given governor """ { "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" } """ And metadata with length "129" - When validate validator + When validate governor Then expect the error """ metadata: exceeds max length 128: parse error diff --git a/governor/types/v1/state_validator.go b/governor/types/v1/state_governor.go similarity index 84% rename from governor/types/v1/state_validator.go rename to governor/types/v1/state_governor.go index fd32471..2830cc8 100644 --- a/governor/types/v1/state_validator.go +++ b/governor/types/v1/state_governor.go @@ -8,7 +8,7 @@ import ( // Validate validates Governor. func (m *Governor) Validate() error { - if _, err := sdk.AccAddressFromBech32(m.Address); err != nil { + if _, err := sdk.AccAddressFromBech32(sdk.AccAddress(m.Address).String()); err != nil { return errors.ErrParse.Wrapf("address: %s", err) } diff --git a/governor/types/v1/state_validator_signing_info.go b/governor/types/v1/state_validator_signing_info.go deleted file mode 100644 index b571e77..0000000 --- a/governor/types/v1/state_validator_signing_info.go +++ /dev/null @@ -1,16 +0,0 @@ -package v1 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/chora-io/mods/validator/errors" -) - -// Validate validates ValidatorSigningInfo. -func (m *ValidatorSigningInfo) Validate() error { - if _, err := sdk.AccAddressFromBech32(m.Address); err != nil { - return errors.ErrParse.Wrapf("address: %s", err) - } - - return nil -} diff --git a/governor/types/v1/state_validator_signing_info_test.go b/governor/types/v1/state_validator_signing_info_test.go deleted file mode 100644 index 118c354..0000000 --- a/governor/types/v1/state_validator_signing_info_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package v1 - -import ( - "testing" - - "github.com/cosmos/gogoproto/jsonpb" - "github.com/regen-network/gocuke" - "github.com/stretchr/testify/require" -) - -type validatorSigningInfo struct { - t gocuke.TestingT - validatorSigningInfo *ValidatorSigningInfo - err error -} - -func TestValidatorSigningInfo(t *testing.T) { - gocuke.NewRunner(t, &validatorSigningInfo{}). - Path("./features/state_validator_signing_info.feature"). - Run() -} - -func (s *validatorSigningInfo) Before(t gocuke.TestingT) { - s.t = t -} - -func (s *validatorSigningInfo) ValidatorSigningInfo(a gocuke.DocString) { - s.validatorSigningInfo = &ValidatorSigningInfo{} - err := jsonpb.UnmarshalString(a.Content, s.validatorSigningInfo) - require.NoError(s.t, err) -} - -func (s *validatorSigningInfo) ValidateValidatorSigningInfo() { - s.err = s.validatorSigningInfo.Validate() -} - -func (s *validatorSigningInfo) ExpectNoError() { - require.NoError(s.t, s.err) -} - -func (s *validatorSigningInfo) ExpectTheError(a gocuke.DocString) { - require.EqualError(s.t, s.err, a.Content) -} diff --git a/governor/types/v1/state_validator_test.go b/governor/types/v1/state_validator_test.go deleted file mode 100644 index 5381962..0000000 --- a/governor/types/v1/state_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 validator struct { - t gocuke.TestingT - validator *Validator - err error -} - -func TestValidator(t *testing.T) { - gocuke.NewRunner(t, &validator{}). - Path("./features/state_validator.feature"). - Run() -} - -func (s *validator) Before(t gocuke.TestingT) { - s.t = t -} - -func (s *validator) Validator(a gocuke.DocString) { - s.validator = &Validator{} - err := jsonpb.UnmarshalString(a.Content, s.validator) - require.NoError(s.t, err) -} - -func (s *validator) MetadataWithLength(a string) { - length, err := strconv.ParseInt(a, 10, 64) - require.NoError(s.t, err) - - s.validator.Metadata = strings.Repeat("x", int(length)) -} - -func (s *validator) ValidateValidator() { - s.err = s.validator.Validate() -} - -func (s *validator) ExpectNoError() { - require.NoError(s.t, s.err) -} - -func (s *validator) ExpectTheError(a gocuke.DocString) { - require.EqualError(s.t, s.err, a.Content) -} diff --git a/validator/keeper/features/msg_update_policy.feature b/validator/keeper/features/msg_update_policy.feature deleted file mode 100644 index 4873bf0..0000000 --- a/validator/keeper/features/msg_update_policy.feature +++ /dev/null @@ -1,127 +0,0 @@ -Feature: Msg/UpdatePolicy - - UpdatePolicy is successful when: - - admin is the admin address - - UpdatePolicy has the following outcomes: - - Policy is updated in state - - EventUpdatePolicy is emitted - - MsgUpdatePolicyResponse is returned - - Rule: The admin must be the admin address - - Background: - Given admin "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - And policy - """ - { - "signedBlocksWindow": 100 - } - """ - - Scenario: admin is admin address - When msg update policy - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "signedBlocksWindow": 100 - } - """ - Then expect no error - - Scenario: admin is not admin address - When msg update policy - """ - { - "admin": "chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup", - "signedBlocksWindow": 100 - } - """ - Then expect the error - """ - admin: expected chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38: received chora1s3x2yhc4qf59gf53hwsnhkh7gqa3eryxnu6nup: unauthorized - """ - - Rule: Policy is updated in state - - Background: - Given admin "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - And policy - """ - { - "signedBlocksWindow": 100 - } - """ - - Scenario: policy updated - When msg update policy - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "signedBlocksWindow": 200 - } - """ - Then expect policy - """ - { - "signedBlocksWindow": 200 - } - """ - - # No failing scenario - state is never updated when message fails - - Rule: EventUpdatePolicy emitted - - Background: - Given admin "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - And policy - """ - { - "signedBlocksWindow": 100 - } - """ - - Scenario: event remove emitted - When msg update policy - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "signedBlocksWindow": 200 - } - """ - Then expect event update policy - """ - { - "signedBlocksWindow": 200 - } - """ - - # No failing scenario - event is never emitted when message fails - - Rule: MsgUpdatePolicyResponse returned - - Background: - Given admin "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - And policy - """ - { - "signedBlocksWindow": 100 - } - """ - - Scenario: message response returned - When msg update policy - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "signedBlocksWindow": 200 - } - """ - Then expect response - """ - { - "signedBlocksWindow": 200 - } - """ - - # No failing scenario - response is never returned when message fails diff --git a/validator/keeper/features/query_policy.feature b/validator/keeper/features/query_policy.feature deleted file mode 100644 index f0e713b..0000000 --- a/validator/keeper/features/query_policy.feature +++ /dev/null @@ -1,59 +0,0 @@ -Feature: Query/Policy - - Query/Policy is successful when: - - always (an error is never returned) - - Query/Policy has the following outcomes: - - query response returned - - Rule: An error is never returned - - Scenario: never error - Given policy - """ - { - "signedBlocksWindow": 100 - } - """ - When query policy - Then expect no error - - Scenario: never error with zero value - When query policy - Then expect no error - - # No failing scenario - only internal errors can occur - - Rule: The query response is returned - - Scenario: query response returned - Given policy - """ - { - "signedBlocksWindow": 100 - } - """ - When query policy - Then expect response - """ - { - "signedBlocksWindow": 100 - } - """ - - Scenario: query response returned with zero value - Given policy - """ - { - "signedBlocksWindow": 0 - } - """ - When query policy - Then expect response - """ - { - "signedBlocksWindow": 0 - } - """ - - # No failing scenario - response is never returned when query fails diff --git a/validator/keeper/features/msg_add_validator.feature b/validator/keeper/msg_add_validator.feature similarity index 100% rename from validator/keeper/features/msg_add_validator.feature rename to validator/keeper/msg_add_validator.feature diff --git a/validator/keeper/msg_add_validator_test.go b/validator/keeper/msg_add_validator_test.go index eaaaac2..96c5c93 100644 --- a/validator/keeper/msg_add_validator_test.go +++ b/validator/keeper/msg_add_validator_test.go @@ -20,7 +20,7 @@ type msgAddValidator struct { func TestMsgAddValidator(t *testing.T) { gocuke.NewRunner(t, &msgAddValidator{}). - Path("./features/msg_add_validator.feature"). + Path("./msg_add_validator.feature"). Run() } diff --git a/validator/keeper/features/msg_remove_validator.feature b/validator/keeper/msg_remove_validator.feature similarity index 100% rename from validator/keeper/features/msg_remove_validator.feature rename to validator/keeper/msg_remove_validator.feature diff --git a/validator/keeper/msg_remove_validator_test.go b/validator/keeper/msg_remove_validator_test.go index d5c857d..fa2b8bf 100644 --- a/validator/keeper/msg_remove_validator_test.go +++ b/validator/keeper/msg_remove_validator_test.go @@ -20,7 +20,7 @@ type msgRemoveValidator struct { func TestMsgRemoveValidator(t *testing.T) { gocuke.NewRunner(t, &msgRemoveValidator{}). - Path("./features/msg_remove_validator.feature"). + Path("./msg_remove_validator.feature"). Run() } diff --git a/governor/keeper/features/msg_update_policy.feature b/validator/keeper/msg_update_policy.feature similarity index 100% rename from governor/keeper/features/msg_update_policy.feature rename to validator/keeper/msg_update_policy.feature diff --git a/validator/keeper/msg_update_policy_test.go b/validator/keeper/msg_update_policy_test.go index 12c2b2a..f3ff93d 100644 --- a/validator/keeper/msg_update_policy_test.go +++ b/validator/keeper/msg_update_policy_test.go @@ -20,7 +20,7 @@ type msgUpdatePolicy struct { func TestMsgUpdatePolicy(t *testing.T) { gocuke.NewRunner(t, &msgUpdatePolicy{}). - Path("./features/msg_update_policy.feature"). + Path("./msg_update_policy.feature"). Run() } diff --git a/validator/keeper/features/msg_update_validator.feature b/validator/keeper/msg_update_validator.feature similarity index 100% rename from validator/keeper/features/msg_update_validator.feature rename to validator/keeper/msg_update_validator.feature diff --git a/validator/keeper/msg_update_validator_test.go b/validator/keeper/msg_update_validator_test.go index fb284cc..cf73aa0 100644 --- a/validator/keeper/msg_update_validator_test.go +++ b/validator/keeper/msg_update_validator_test.go @@ -20,7 +20,7 @@ type msgUpdateValidator struct { func TestMsgUpdateValidator(t *testing.T) { gocuke.NewRunner(t, &msgUpdateValidator{}). - Path("./features/msg_update_validator.feature"). + Path("./msg_update_validator.feature"). Run() } diff --git a/governor/keeper/features/query_policy.feature b/validator/keeper/query_policy.feature similarity index 100% rename from governor/keeper/features/query_policy.feature rename to validator/keeper/query_policy.feature diff --git a/validator/keeper/query_policy_test.go b/validator/keeper/query_policy_test.go index a58bad8..85b801e 100644 --- a/validator/keeper/query_policy_test.go +++ b/validator/keeper/query_policy_test.go @@ -19,7 +19,7 @@ type queryPolicy struct { func TestQueryPolicy(t *testing.T) { gocuke.NewRunner(t, &queryPolicy{}). - Path("./features/query_policy.feature"). + Path("./query_policy.feature"). Run() } diff --git a/validator/keeper/features/query_validator.feature b/validator/keeper/query_validator.feature similarity index 100% rename from validator/keeper/features/query_validator.feature rename to validator/keeper/query_validator.feature diff --git a/validator/keeper/query_validator_test.go b/validator/keeper/query_validator_test.go index 34712b5..e853994 100644 --- a/validator/keeper/query_validator_test.go +++ b/validator/keeper/query_validator_test.go @@ -19,7 +19,7 @@ type queryValidator struct { func TestQueryValidator(t *testing.T) { gocuke.NewRunner(t, &queryValidator{}). - Path("./features/query_validator.feature"). + Path("./query_validator.feature"). Run() } diff --git a/validator/keeper/features/query_validators.feature b/validator/keeper/query_validators.feature similarity index 100% rename from validator/keeper/features/query_validators.feature rename to validator/keeper/query_validators.feature diff --git a/validator/keeper/query_validators_test.go b/validator/keeper/query_validators_test.go index b9e6932..6a5ad23 100644 --- a/validator/keeper/query_validators_test.go +++ b/validator/keeper/query_validators_test.go @@ -19,7 +19,7 @@ type queryValidators struct { func TestQueryValidators(t *testing.T) { gocuke.NewRunner(t, &queryValidators{}). - Path("./features/query_validators.feature"). + Path("./query_validators.feature"). Run() } diff --git a/validator/proto/buf.lock b/validator/proto/buf.lock index 32d358a..360f94c 100644 --- a/validator/proto/buf.lock +++ b/validator/proto/buf.lock @@ -19,8 +19,8 @@ deps: - remote: buf.build owner: googleapis repository: googleapis - commit: 8bc2c51e08c447cd8886cdea48a73e14 - digest: shake256:a969155953a5cedc5b2df5b42c368f2bc66ff8ce1804bc96e0f14ff2ee8a893687963058909df844d1643cdbc98ff099d2daa6bc9f9f5b8886c49afdc60e19af + commit: e7f8d366f5264595bcc4cd4139af9973 + digest: shake256:e5e5f1c12f82e028ea696faa43b4f9dc6258a6d1226282962a8c8b282e10946281d815884f574bd279ebd9cd7588629beb3db17b892af6c33b56f92f8f67f509 - remote: buf.build owner: protocolbuffers repository: wellknowntypes diff --git a/validator/types/v1/features/msg_update_max_missed_blocks.feature b/validator/types/v1/features/msg_update_max_missed_blocks.feature deleted file mode 100644 index 837c50f..0000000 --- a/validator/types/v1/features/msg_update_max_missed_blocks.feature +++ /dev/null @@ -1,47 +0,0 @@ -Feature: MsgUpdatePolicy - - Scenario: valid message - Given message - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "signedBlocksWindow": 100, - "minSignedPerWindow": 100 - } - """ - When validate message - Then expect no error - - Scenario: valid message with zero values - Given message - """ - { - "admin": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - } - """ - 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 - """ diff --git a/validator/types/v1/features/state_validator_signing_info.feature b/validator/types/v1/features/state_validator_signing_info.feature deleted file mode 100644 index 6801ded..0000000 --- a/validator/types/v1/features/state_validator_signing_info.feature +++ /dev/null @@ -1,46 +0,0 @@ -Feature: ValidatorSigningInfo - - Scenario: valid validator signing info - Given validator signing info - """ - { - "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38", - "missedBlocksCount": 10 - } - """ - When validate validator signing info - Then expect no error - - Scenario: valid validator signing info with zero value - Given validator signing info - """ - { - "address": "chora1q5m97jdcksj24g9enlkjqq75ygt5q6ak54jk38" - } - """ - When validate validator signing info - Then expect no error - - Scenario: an error is returned if address is empty - Given validator signing info - """ - {} - """ - When validate validator signing info - Then expect the error - """ - address: empty address string is not allowed: parse error - """ - - Scenario: an error is returned if address is not a bech32 address - Given validator signing info - """ - { - "address": "foo" - } - """ - When validate validator signing info - Then expect the error - """ - address: decoding bech32 failed: invalid bech32 string length 3: parse error - """ diff --git a/validator/types/v1/features/msg_add_validator.feature b/validator/types/v1/msg_add_validator.feature similarity index 100% rename from validator/types/v1/features/msg_add_validator.feature rename to validator/types/v1/msg_add_validator.feature diff --git a/validator/types/v1/msg_add_validator_test.go b/validator/types/v1/msg_add_validator_test.go index a441c7b..81e413a 100644 --- a/validator/types/v1/msg_add_validator_test.go +++ b/validator/types/v1/msg_add_validator_test.go @@ -18,7 +18,7 @@ type msgAddValidator struct { func TestMsgAddValidator(t *testing.T) { gocuke.NewRunner(t, &msgAddValidator{}). - Path("./features/msg_add_validator.feature"). + Path("./msg_add_validator.feature"). Run() } diff --git a/validator/types/v1/features/msg_remove_validator.feature b/validator/types/v1/msg_remove_validator.feature similarity index 100% rename from validator/types/v1/features/msg_remove_validator.feature rename to validator/types/v1/msg_remove_validator.feature diff --git a/validator/types/v1/msg_remove_validator_test.go b/validator/types/v1/msg_remove_validator_test.go index 2cd663b..3f8e976 100644 --- a/validator/types/v1/msg_remove_validator_test.go +++ b/validator/types/v1/msg_remove_validator_test.go @@ -16,7 +16,7 @@ type msgRemoveValidator struct { func TestMsgRemoveValidator(t *testing.T) { gocuke.NewRunner(t, &msgRemoveValidator{}). - Path("./features/msg_remove_validator.feature"). + Path("./msg_remove_validator.feature"). Run() } diff --git a/governor/types/v1/features/msg_update_max_missed_blocks.feature b/validator/types/v1/msg_update_max_missed_blocks.feature similarity index 100% rename from governor/types/v1/features/msg_update_max_missed_blocks.feature rename to validator/types/v1/msg_update_max_missed_blocks.feature diff --git a/validator/types/v1/msg_update_max_missed_blocks_test.go b/validator/types/v1/msg_update_max_missed_blocks_test.go index ab22862..9cdce03 100644 --- a/validator/types/v1/msg_update_max_missed_blocks_test.go +++ b/validator/types/v1/msg_update_max_missed_blocks_test.go @@ -16,7 +16,7 @@ type msgUpdatePolicy struct { func TestMsgUpdatePolicy(t *testing.T) { gocuke.NewRunner(t, &msgUpdatePolicy{}). - Path("./features/msg_update_max_missed_blocks.feature"). + Path("./msg_update_max_missed_blocks.feature"). Run() } diff --git a/validator/types/v1/features/msg_update_validator.feature b/validator/types/v1/msg_update_validator.feature similarity index 100% rename from validator/types/v1/features/msg_update_validator.feature rename to validator/types/v1/msg_update_validator.feature diff --git a/validator/types/v1/msg_update_validator_test.go b/validator/types/v1/msg_update_validator_test.go index 23a834c..a7a3c7f 100644 --- a/validator/types/v1/msg_update_validator_test.go +++ b/validator/types/v1/msg_update_validator_test.go @@ -18,7 +18,7 @@ type msgUpdateValidator struct { func TestMsgUpdateValidator(t *testing.T) { gocuke.NewRunner(t, &msgUpdateValidator{}). - Path("./features/msg_update_validator.feature"). + Path("./msg_update_validator.feature"). Run() } diff --git a/validator/types/v1/features/state_validator.feature b/validator/types/v1/state_validator.feature similarity index 100% rename from validator/types/v1/features/state_validator.feature rename to validator/types/v1/state_validator.feature diff --git a/governor/types/v1/features/state_validator_signing_info.feature b/validator/types/v1/state_validator_signing_info.feature similarity index 100% rename from governor/types/v1/features/state_validator_signing_info.feature rename to validator/types/v1/state_validator_signing_info.feature diff --git a/validator/types/v1/state_validator_signing_info_test.go b/validator/types/v1/state_validator_signing_info_test.go index 118c354..a9ff782 100644 --- a/validator/types/v1/state_validator_signing_info_test.go +++ b/validator/types/v1/state_validator_signing_info_test.go @@ -16,7 +16,7 @@ type validatorSigningInfo struct { func TestValidatorSigningInfo(t *testing.T) { gocuke.NewRunner(t, &validatorSigningInfo{}). - Path("./features/state_validator_signing_info.feature"). + Path("./state_validator_signing_info.feature"). Run() } diff --git a/validator/types/v1/state_validator_test.go b/validator/types/v1/state_validator_test.go index 5381962..ddc76fb 100644 --- a/validator/types/v1/state_validator_test.go +++ b/validator/types/v1/state_validator_test.go @@ -18,7 +18,7 @@ type validator struct { func TestValidator(t *testing.T) { gocuke.NewRunner(t, &validator{}). - Path("./features/state_validator.feature"). + Path("./state_validator.feature"). Run() } diff --git a/voucher/keeper/features/msg_create.feature b/voucher/keeper/msg_create.feature similarity index 100% rename from voucher/keeper/features/msg_create.feature rename to voucher/keeper/msg_create.feature diff --git a/voucher/keeper/msg_create_test.go b/voucher/keeper/msg_create_test.go index abc95a2..8d3426a 100644 --- a/voucher/keeper/msg_create_test.go +++ b/voucher/keeper/msg_create_test.go @@ -20,7 +20,7 @@ type msgCreate struct { func TestMsgCreate(t *testing.T) { gocuke.NewRunner(t, &msgCreate{}). - Path("./features/msg_create.feature"). + Path("./msg_create.feature"). Run() } diff --git a/voucher/keeper/features/msg_issue.feature b/voucher/keeper/msg_issue.feature similarity index 100% rename from voucher/keeper/features/msg_issue.feature rename to voucher/keeper/msg_issue.feature diff --git a/voucher/keeper/msg_issue_test.go b/voucher/keeper/msg_issue_test.go index 60213b4..79bb91f 100644 --- a/voucher/keeper/msg_issue_test.go +++ b/voucher/keeper/msg_issue_test.go @@ -21,7 +21,7 @@ type msgIssue struct { func TestMsgIssue(t *testing.T) { gocuke.NewRunner(t, &msgIssue{}). - Path("./features/msg_issue.feature"). + Path("./msg_issue.feature"). Run() } diff --git a/voucher/keeper/features/msg_update_issuer.feature b/voucher/keeper/msg_update_issuer.feature similarity index 100% rename from voucher/keeper/features/msg_update_issuer.feature rename to voucher/keeper/msg_update_issuer.feature diff --git a/voucher/keeper/msg_update_issuer_test.go b/voucher/keeper/msg_update_issuer_test.go index 60d8773..892ef76 100644 --- a/voucher/keeper/msg_update_issuer_test.go +++ b/voucher/keeper/msg_update_issuer_test.go @@ -20,7 +20,7 @@ type msgUpdateIssuer struct { func TestMsgUpdateIssuer(t *testing.T) { gocuke.NewRunner(t, &msgUpdateIssuer{}). - Path("./features/msg_update_issuer.feature"). + Path("./msg_update_issuer.feature"). Run() } diff --git a/voucher/keeper/features/msg_update_metadata.feature b/voucher/keeper/msg_update_metadata.feature similarity index 100% rename from voucher/keeper/features/msg_update_metadata.feature rename to voucher/keeper/msg_update_metadata.feature diff --git a/voucher/keeper/msg_update_metadata_test.go b/voucher/keeper/msg_update_metadata_test.go index 8f8f886..99b8fee 100644 --- a/voucher/keeper/msg_update_metadata_test.go +++ b/voucher/keeper/msg_update_metadata_test.go @@ -20,7 +20,7 @@ type msgUpdateMetadata struct { func TestMsgUpdateMetadata(t *testing.T) { gocuke.NewRunner(t, &msgUpdateMetadata{}). - Path("./features/msg_update_metadata.feature"). + Path("./msg_update_metadata.feature"). Run() } diff --git a/voucher/keeper/features/query_balance.feature b/voucher/keeper/query_balance.feature similarity index 100% rename from voucher/keeper/features/query_balance.feature rename to voucher/keeper/query_balance.feature diff --git a/voucher/keeper/query_balance_test.go b/voucher/keeper/query_balance_test.go index 6515e65..4574dac 100644 --- a/voucher/keeper/query_balance_test.go +++ b/voucher/keeper/query_balance_test.go @@ -19,7 +19,7 @@ type queryBalance struct { func TestQueryBalance(t *testing.T) { gocuke.NewRunner(t, &queryBalance{}). - Path("./features/query_balance.feature"). + Path("./query_balance.feature"). Run() } diff --git a/voucher/keeper/features/query_balances_by_address.feature b/voucher/keeper/query_balances_by_address.feature similarity index 100% rename from voucher/keeper/features/query_balances_by_address.feature rename to voucher/keeper/query_balances_by_address.feature diff --git a/voucher/keeper/query_balances_by_address_test.go b/voucher/keeper/query_balances_by_address_test.go index d207c39..1a004ce 100644 --- a/voucher/keeper/query_balances_by_address_test.go +++ b/voucher/keeper/query_balances_by_address_test.go @@ -19,7 +19,7 @@ type queryBalancesByAddress struct { func TestQueryBalancesByAddress(t *testing.T) { gocuke.NewRunner(t, &queryBalancesByAddress{}). - Path("./features/query_balances_by_address.feature"). + Path("./query_balances_by_address.feature"). Run() } diff --git a/voucher/keeper/features/query_balances_by_voucher.feature b/voucher/keeper/query_balances_by_voucher.feature similarity index 100% rename from voucher/keeper/features/query_balances_by_voucher.feature rename to voucher/keeper/query_balances_by_voucher.feature diff --git a/voucher/keeper/query_balances_by_voucher_test.go b/voucher/keeper/query_balances_by_voucher_test.go index 8059524..1684fa3 100644 --- a/voucher/keeper/query_balances_by_voucher_test.go +++ b/voucher/keeper/query_balances_by_voucher_test.go @@ -19,7 +19,7 @@ type queryBalancesByVoucher struct { func TestQueryBalancesByVoucher(t *testing.T) { gocuke.NewRunner(t, &queryBalancesByVoucher{}). - Path("./features/query_balances_by_voucher.feature"). + Path("./query_balances_by_voucher.feature"). Run() } diff --git a/voucher/keeper/features/query_voucher.feature b/voucher/keeper/query_voucher.feature similarity index 100% rename from voucher/keeper/features/query_voucher.feature rename to voucher/keeper/query_voucher.feature diff --git a/voucher/keeper/query_voucher_test.go b/voucher/keeper/query_voucher_test.go index a38922d..09c58d3 100644 --- a/voucher/keeper/query_voucher_test.go +++ b/voucher/keeper/query_voucher_test.go @@ -19,7 +19,7 @@ type queryVoucher struct { func TestQueryVoucher(t *testing.T) { gocuke.NewRunner(t, &queryVoucher{}). - Path("./features/query_voucher.feature"). + Path("./query_voucher.feature"). Run() } diff --git a/voucher/keeper/features/query_vouchers.feature b/voucher/keeper/query_vouchers.feature similarity index 100% rename from voucher/keeper/features/query_vouchers.feature rename to voucher/keeper/query_vouchers.feature diff --git a/voucher/keeper/features/query_vouchers_by_issuer.feature b/voucher/keeper/query_vouchers_by_issuer.feature similarity index 100% rename from voucher/keeper/features/query_vouchers_by_issuer.feature rename to voucher/keeper/query_vouchers_by_issuer.feature diff --git a/voucher/keeper/query_vouchers_by_issuer_test.go b/voucher/keeper/query_vouchers_by_issuer_test.go index a755db8..81ac9f3 100644 --- a/voucher/keeper/query_vouchers_by_issuer_test.go +++ b/voucher/keeper/query_vouchers_by_issuer_test.go @@ -19,7 +19,7 @@ type queryVouchersByIssuer struct { func TestQueryVouchersByIssuer(t *testing.T) { gocuke.NewRunner(t, &queryVouchersByIssuer{}). - Path("./features/query_vouchers_by_issuer.feature"). + Path("./query_vouchers_by_issuer.feature"). Run() } diff --git a/voucher/keeper/query_vouchers_test.go b/voucher/keeper/query_vouchers_test.go index ef5a7a4..50791ba 100644 --- a/voucher/keeper/query_vouchers_test.go +++ b/voucher/keeper/query_vouchers_test.go @@ -19,7 +19,7 @@ type queryVouchers struct { func TestQueryVouchers(t *testing.T) { gocuke.NewRunner(t, &queryVouchers{}). - Path("./features/query_vouchers.feature"). + Path("./query_vouchers.feature"). Run() } diff --git a/voucher/proto/buf.lock b/voucher/proto/buf.lock index 32d358a..360f94c 100644 --- a/voucher/proto/buf.lock +++ b/voucher/proto/buf.lock @@ -19,8 +19,8 @@ deps: - remote: buf.build owner: googleapis repository: googleapis - commit: 8bc2c51e08c447cd8886cdea48a73e14 - digest: shake256:a969155953a5cedc5b2df5b42c368f2bc66ff8ce1804bc96e0f14ff2ee8a893687963058909df844d1643cdbc98ff099d2daa6bc9f9f5b8886c49afdc60e19af + commit: e7f8d366f5264595bcc4cd4139af9973 + digest: shake256:e5e5f1c12f82e028ea696faa43b4f9dc6258a6d1226282962a8c8b282e10946281d815884f574bd279ebd9cd7588629beb3db17b892af6c33b56f92f8f67f509 - remote: buf.build owner: protocolbuffers repository: wellknowntypes diff --git a/voucher/types/v1/features/msg_create.feature b/voucher/types/v1/msg_create.feature similarity index 100% rename from voucher/types/v1/features/msg_create.feature rename to voucher/types/v1/msg_create.feature diff --git a/voucher/types/v1/msg_create_test.go b/voucher/types/v1/msg_create_test.go index b3d6595..b24c4d8 100644 --- a/voucher/types/v1/msg_create_test.go +++ b/voucher/types/v1/msg_create_test.go @@ -18,7 +18,7 @@ type msgCreate struct { func TestMsgCreate(t *testing.T) { gocuke.NewRunner(t, &msgCreate{}). - Path("./features/msg_create.feature"). + Path("./msg_create.feature"). Run() } diff --git a/voucher/types/v1/features/msg_issue.feature b/voucher/types/v1/msg_issue.feature similarity index 100% rename from voucher/types/v1/features/msg_issue.feature rename to voucher/types/v1/msg_issue.feature diff --git a/voucher/types/v1/msg_issue_test.go b/voucher/types/v1/msg_issue_test.go index f8bbbb6..7942d93 100644 --- a/voucher/types/v1/msg_issue_test.go +++ b/voucher/types/v1/msg_issue_test.go @@ -18,7 +18,7 @@ type msgIssue struct { func TestMsgIssue(t *testing.T) { gocuke.NewRunner(t, &msgIssue{}). - Path("./features/msg_issue.feature"). + Path("./msg_issue.feature"). Run() } diff --git a/voucher/types/v1/features/msg_update_issuer.feature b/voucher/types/v1/msg_update_issuer.feature similarity index 100% rename from voucher/types/v1/features/msg_update_issuer.feature rename to voucher/types/v1/msg_update_issuer.feature diff --git a/voucher/types/v1/msg_update_issuer_test.go b/voucher/types/v1/msg_update_issuer_test.go index c78619a..1a432e5 100644 --- a/voucher/types/v1/msg_update_issuer_test.go +++ b/voucher/types/v1/msg_update_issuer_test.go @@ -16,7 +16,7 @@ type msgUpdateIssuer struct { func TestMsgUpdateIssuer(t *testing.T) { gocuke.NewRunner(t, &msgUpdateIssuer{}). - Path("./features/msg_update_issuer.feature"). + Path("./msg_update_issuer.feature"). Run() } diff --git a/voucher/types/v1/features/msg_update_metadata.feature b/voucher/types/v1/msg_update_metadata.feature similarity index 100% rename from voucher/types/v1/features/msg_update_metadata.feature rename to voucher/types/v1/msg_update_metadata.feature diff --git a/voucher/types/v1/msg_update_metadata_test.go b/voucher/types/v1/msg_update_metadata_test.go index 536649a..b6eeee5 100644 --- a/voucher/types/v1/msg_update_metadata_test.go +++ b/voucher/types/v1/msg_update_metadata_test.go @@ -18,7 +18,7 @@ type msgUpdateMetadata struct { func TestMsgUpdateMetadata(t *testing.T) { gocuke.NewRunner(t, &msgUpdateMetadata{}). - Path("./features/msg_update_metadata.feature"). + Path("./msg_update_metadata.feature"). Run() } diff --git a/voucher/types/v1/features/state_balance.feature b/voucher/types/v1/state_balance.feature similarity index 100% rename from voucher/types/v1/features/state_balance.feature rename to voucher/types/v1/state_balance.feature diff --git a/voucher/types/v1/state_balance_test.go b/voucher/types/v1/state_balance_test.go index 7319d21..b8b2d52 100644 --- a/voucher/types/v1/state_balance_test.go +++ b/voucher/types/v1/state_balance_test.go @@ -16,7 +16,7 @@ type balance struct { func TestBalance(t *testing.T) { gocuke.NewRunner(t, &balance{}). - Path("./features/state_balance.feature"). + Path("./state_balance.feature"). Run() } diff --git a/voucher/types/v1/features/state_voucher.feature b/voucher/types/v1/state_voucher.feature similarity index 100% rename from voucher/types/v1/features/state_voucher.feature rename to voucher/types/v1/state_voucher.feature diff --git a/voucher/types/v1/state_voucher_test.go b/voucher/types/v1/state_voucher_test.go index 631a7ea..7fe8568 100644 --- a/voucher/types/v1/state_voucher_test.go +++ b/voucher/types/v1/state_voucher_test.go @@ -18,7 +18,7 @@ type voucher struct { func TestVoucher(t *testing.T) { gocuke.NewRunner(t, &voucher{}). - Path("./features/state_voucher.feature"). + Path("./state_voucher.feature"). Run() }