From 271253a44a90109113cd3d3849d2d5a5e4b32007 Mon Sep 17 00:00:00 2001 From: Anmol1696 Date: Mon, 7 Aug 2023 19:17:10 +0530 Subject: [PATCH 1/5] use generic struct instead of genesis message --- exposer/BUILD.bazel | 1 + exposer/handler.go | 16 ++++++++++++---- proto/exposer/BUILD.bazel | 1 - proto/exposer/genesis.proto | 17 ----------------- proto/exposer/service.proto | 3 +-- 5 files changed, 14 insertions(+), 24 deletions(-) delete mode 100644 proto/exposer/genesis.proto diff --git a/exposer/BUILD.bazel b/exposer/BUILD.bazel index a883ef21..c7f7e2fd 100644 --- a/exposer/BUILD.bazel +++ b/exposer/BUILD.bazel @@ -31,6 +31,7 @@ go_library( "@org_golang_google_grpc//codes", "@org_golang_google_grpc//status", "@org_golang_google_protobuf//types/known/emptypb", + "@org_golang_google_protobuf//types/known/structpb", "@org_uber_go_zap//:zap", ], ) diff --git a/exposer/handler.go b/exposer/handler.go index 481da62f..a48e0c2c 100644 --- a/exposer/handler.go +++ b/exposer/handler.go @@ -5,12 +5,14 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "net/http" "os" "github.com/golang/protobuf/jsonpb" "go.uber.org/zap" "google.golang.org/protobuf/types/known/emptypb" + "google.golang.org/protobuf/types/known/structpb" pb "github.com/cosmology-tech/starship/exposer/exposer" ) @@ -66,19 +68,25 @@ func (a *AppServer) GetPubKey(ctx context.Context, _ *emptypb.Empty) (*pb.Respon return resPubKey, nil } -func (a *AppServer) GetGenesisFile(ctx context.Context, _ *emptypb.Empty) (*pb.GenesisState, error) { +func (a *AppServer) GetGenesisFile(ctx context.Context, _ *emptypb.Empty) (*structpb.Struct, error) { jsonFile, err := os.Open(a.config.GenesisFile) if err != nil { return nil, err } - state := &pb.GenesisState{} - err = jsonpb.Unmarshal(jsonFile, state) + byteValue, err := ioutil.ReadAll(jsonFile) if err != nil { return nil, err } - return state, nil + state := map[string]interface{}{} + + err = json.Unmarshal(byteValue, &state) + if err != nil { + return nil, err + } + + return structpb.NewStruct(state) } func (a *AppServer) GetKeys(ctx context.Context, _ *emptypb.Empty) (*pb.Keys, error) { diff --git a/proto/exposer/BUILD.bazel b/proto/exposer/BUILD.bazel index f6fa9a92..99abd819 100644 --- a/proto/exposer/BUILD.bazel +++ b/proto/exposer/BUILD.bazel @@ -4,7 +4,6 @@ load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") proto_library( name = "exposer_proto", srcs = [ - "genesis.proto", "mnemonic.proto", "node.proto", "service.proto", diff --git a/proto/exposer/genesis.proto b/proto/exposer/genesis.proto deleted file mode 100644 index 03e04fda..00000000 --- a/proto/exposer/genesis.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package exposer; - -import "google/protobuf/timestamp.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/struct.proto"; - -option go_package = "github.com/cosmology-tech/starship/exposer/exposer"; - -message GenesisState { - google.protobuf.Timestamp genesis_time = 1 [ json_name = "genesis_time" ]; - string chain_id = 2 [ json_name = "chain_id" ]; - string initial_height = 3 [ json_name = "initial_height" ]; - google.protobuf.Struct consensus_params = 4 [ json_name = "consensus_params" ]; - string app_hash = 5 [ json_name = "app_hash" ]; - google.protobuf.Struct app_state = 6 [ json_name = "app_state" ]; -} diff --git a/proto/exposer/service.proto b/proto/exposer/service.proto index 41f87760..a8ae4816 100644 --- a/proto/exposer/service.proto +++ b/proto/exposer/service.proto @@ -7,7 +7,6 @@ import "google/protobuf/any.proto"; import "google/protobuf/descriptor.proto"; import "proto/exposer/mnemonic.proto"; -import "proto/exposer/genesis.proto"; option go_package = "github.com/cosmology-tech/starship/exposer/exposer"; @@ -22,7 +21,7 @@ service Exposer { option (google.api.http) = { get: "/pub_key" }; } // GetGenesisFile returns the genesis file of the node - rpc GetGenesisFile(google.protobuf.Empty) returns (GenesisState) { + rpc GetGenesisFile(google.protobuf.Empty) returns (google.protobuf.Struct) { option (google.api.http) = { get: "/genesis" }; } // GetKeysFile returns the keys of the node From 735385d5d224d25d3b2e21d6ff81587a74362bcb Mon Sep 17 00:00:00 2001 From: Anmol1696 Date: Mon, 7 Aug 2023 20:37:02 +0530 Subject: [PATCH 2/5] add pb struct to proto --- proto/exposer/service.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/proto/exposer/service.proto b/proto/exposer/service.proto index a8ae4816..2f67722c 100644 --- a/proto/exposer/service.proto +++ b/proto/exposer/service.proto @@ -3,6 +3,7 @@ package exposer; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; +import "google/protobuf/struct.proto"; import "google/protobuf/any.proto"; import "google/protobuf/descriptor.proto"; From b593ee8eea35cc8ba2fa7af634666a0f75ee90f6 Mon Sep 17 00:00:00 2001 From: Anmol1696 Date: Tue, 8 Aug 2023 15:09:08 +0530 Subject: [PATCH 3/5] Remove unused genesis protos, remove buf from proto, update exposer tests --- exposer/exposer/genesis.pb.go | 601 ------------------------------- exposer/exposer/genesis.pb.gw.go | 3 - exposer/exposer/service.pb.go | 106 +++--- proto/Makefile | 8 +- proto/buf.gen.yaml | 19 - proto/buf.lock | 11 - proto/buf.yaml | 13 - tests/Makefile | 2 +- tests/e2e_test.go | 4 + tests/exposer_test.go | 5 +- 10 files changed, 67 insertions(+), 705 deletions(-) delete mode 100755 exposer/exposer/genesis.pb.go delete mode 100755 exposer/exposer/genesis.pb.gw.go delete mode 100644 proto/buf.gen.yaml delete mode 100644 proto/buf.lock delete mode 100644 proto/buf.yaml diff --git a/exposer/exposer/genesis.pb.go b/exposer/exposer/genesis.pb.go deleted file mode 100755 index e2bb34a2..00000000 --- a/exposer/exposer/genesis.pb.go +++ /dev/null @@ -1,601 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.29.1 -// protoc v3.15.5 -// source: proto/exposer/genesis.proto - -package exposer - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - _ "google.golang.org/protobuf/types/known/anypb" - structpb "google.golang.org/protobuf/types/known/structpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GenesisState struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GenesisTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=genesis_time,proto3" json:"genesis_time,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,proto3" json:"chain_id,omitempty"` - InitialHeight string `protobuf:"bytes,3,opt,name=initial_height,proto3" json:"initial_height,omitempty"` - ConsensusParams *GenesisState_ConsensusParams `protobuf:"bytes,4,opt,name=consensus_params,proto3" json:"consensus_params,omitempty"` - AppHash string `protobuf:"bytes,5,opt,name=app_hash,proto3" json:"app_hash,omitempty"` - AppState *structpb.Struct `protobuf:"bytes,6,opt,name=app_state,proto3" json:"app_state,omitempty"` -} - -func (x *GenesisState) Reset() { - *x = GenesisState{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_exposer_genesis_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenesisState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenesisState) ProtoMessage() {} - -func (x *GenesisState) ProtoReflect() protoreflect.Message { - mi := &file_proto_exposer_genesis_proto_msgTypes[0] - 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) -} - -// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. -func (*GenesisState) Descriptor() ([]byte, []int) { - return file_proto_exposer_genesis_proto_rawDescGZIP(), []int{0} -} - -func (x *GenesisState) GetGenesisTime() *timestamppb.Timestamp { - if x != nil { - return x.GenesisTime - } - return nil -} - -func (x *GenesisState) GetChainId() string { - if x != nil { - return x.ChainId - } - return "" -} - -func (x *GenesisState) GetInitialHeight() string { - if x != nil { - return x.InitialHeight - } - return "" -} - -func (x *GenesisState) GetConsensusParams() *GenesisState_ConsensusParams { - if x != nil { - return x.ConsensusParams - } - return nil -} - -func (x *GenesisState) GetAppHash() string { - if x != nil { - return x.AppHash - } - return "" -} - -func (x *GenesisState) GetAppState() *structpb.Struct { - if x != nil { - return x.AppState - } - return nil -} - -type GenesisState_Block struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - MaxBytes string `protobuf:"bytes,1,opt,name=max_bytes,proto3" json:"max_bytes,omitempty"` - MaxGas string `protobuf:"bytes,2,opt,name=max_gas,proto3" json:"max_gas,omitempty"` - TimeIotaMs string `protobuf:"bytes,3,opt,name=time_iota_ms,proto3" json:"time_iota_ms,omitempty"` -} - -func (x *GenesisState_Block) Reset() { - *x = GenesisState_Block{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_exposer_genesis_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenesisState_Block) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenesisState_Block) ProtoMessage() {} - -func (x *GenesisState_Block) ProtoReflect() protoreflect.Message { - mi := &file_proto_exposer_genesis_proto_msgTypes[1] - 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) -} - -// Deprecated: Use GenesisState_Block.ProtoReflect.Descriptor instead. -func (*GenesisState_Block) Descriptor() ([]byte, []int) { - return file_proto_exposer_genesis_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *GenesisState_Block) GetMaxBytes() string { - if x != nil { - return x.MaxBytes - } - return "" -} - -func (x *GenesisState_Block) GetMaxGas() string { - if x != nil { - return x.MaxGas - } - return "" -} - -func (x *GenesisState_Block) GetTimeIotaMs() string { - if x != nil { - return x.TimeIotaMs - } - return "" -} - -type GenesisState_Evidence struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - MaxAgeNumBlocks string `protobuf:"bytes,1,opt,name=max_age_num_blocks,proto3" json:"max_age_num_blocks,omitempty"` - MaxAgeDuration string `protobuf:"bytes,2,opt,name=max_age_duration,proto3" json:"max_age_duration,omitempty"` - MaxBytes string `protobuf:"bytes,3,opt,name=max_bytes,proto3" json:"max_bytes,omitempty"` -} - -func (x *GenesisState_Evidence) Reset() { - *x = GenesisState_Evidence{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_exposer_genesis_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenesisState_Evidence) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenesisState_Evidence) ProtoMessage() {} - -func (x *GenesisState_Evidence) ProtoReflect() protoreflect.Message { - mi := &file_proto_exposer_genesis_proto_msgTypes[2] - 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) -} - -// Deprecated: Use GenesisState_Evidence.ProtoReflect.Descriptor instead. -func (*GenesisState_Evidence) Descriptor() ([]byte, []int) { - return file_proto_exposer_genesis_proto_rawDescGZIP(), []int{0, 1} -} - -func (x *GenesisState_Evidence) GetMaxAgeNumBlocks() string { - if x != nil { - return x.MaxAgeNumBlocks - } - return "" -} - -func (x *GenesisState_Evidence) GetMaxAgeDuration() string { - if x != nil { - return x.MaxAgeDuration - } - return "" -} - -func (x *GenesisState_Evidence) GetMaxBytes() string { - if x != nil { - return x.MaxBytes - } - return "" -} - -type GenesisState_Validator struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PubKeyTypes []string `protobuf:"bytes,1,rep,name=pub_key_types,proto3" json:"pub_key_types,omitempty"` -} - -func (x *GenesisState_Validator) Reset() { - *x = GenesisState_Validator{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_exposer_genesis_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenesisState_Validator) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenesisState_Validator) ProtoMessage() {} - -func (x *GenesisState_Validator) ProtoReflect() protoreflect.Message { - mi := &file_proto_exposer_genesis_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) -} - -// Deprecated: Use GenesisState_Validator.ProtoReflect.Descriptor instead. -func (*GenesisState_Validator) Descriptor() ([]byte, []int) { - return file_proto_exposer_genesis_proto_rawDescGZIP(), []int{0, 2} -} - -func (x *GenesisState_Validator) GetPubKeyTypes() []string { - if x != nil { - return x.PubKeyTypes - } - return nil -} - -type GenesisState_Version struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *GenesisState_Version) Reset() { - *x = GenesisState_Version{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_exposer_genesis_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenesisState_Version) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenesisState_Version) ProtoMessage() {} - -func (x *GenesisState_Version) ProtoReflect() protoreflect.Message { - mi := &file_proto_exposer_genesis_proto_msgTypes[4] - 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) -} - -// Deprecated: Use GenesisState_Version.ProtoReflect.Descriptor instead. -func (*GenesisState_Version) Descriptor() ([]byte, []int) { - return file_proto_exposer_genesis_proto_rawDescGZIP(), []int{0, 3} -} - -type GenesisState_ConsensusParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Block *GenesisState_Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` - Evidence *GenesisState_Evidence `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"` - Validator *GenesisState_Validator `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator,omitempty"` - Version *GenesisState_Version `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *GenesisState_ConsensusParams) Reset() { - *x = GenesisState_ConsensusParams{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_exposer_genesis_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenesisState_ConsensusParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenesisState_ConsensusParams) ProtoMessage() {} - -func (x *GenesisState_ConsensusParams) ProtoReflect() protoreflect.Message { - mi := &file_proto_exposer_genesis_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) -} - -// Deprecated: Use GenesisState_ConsensusParams.ProtoReflect.Descriptor instead. -func (*GenesisState_ConsensusParams) Descriptor() ([]byte, []int) { - return file_proto_exposer_genesis_proto_rawDescGZIP(), []int{0, 4} -} - -func (x *GenesisState_ConsensusParams) GetBlock() *GenesisState_Block { - if x != nil { - return x.Block - } - return nil -} - -func (x *GenesisState_ConsensusParams) GetEvidence() *GenesisState_Evidence { - if x != nil { - return x.Evidence - } - return nil -} - -func (x *GenesisState_ConsensusParams) GetValidator() *GenesisState_Validator { - if x != nil { - return x.Validator - } - return nil -} - -func (x *GenesisState_ConsensusParams) GetVersion() *GenesisState_Version { - if x != nil { - return x.Version - } - return nil -} - -var File_proto_exposer_genesis_proto protoreflect.FileDescriptor - -var file_proto_exposer_genesis_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, - 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x65, - 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xdf, 0x06, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x12, 0x26, 0x0a, - 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x68, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x52, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x26, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, - 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x70, 0x70, - 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, - 0x5f, 0x68, 0x61, 0x73, 0x68, 0x12, 0x35, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x52, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x63, 0x0a, 0x05, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, 0x74, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x67, 0x61, 0x73, 0x12, 0x22, 0x0a, - 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x69, 0x6f, 0x74, 0x61, 0x5f, 0x6d, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x69, 0x6f, 0x74, 0x61, 0x5f, 0x6d, - 0x73, 0x1a, 0x84, 0x01, 0x0a, 0x08, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2e, - 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x5f, - 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x2a, - 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x67, - 0x65, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, - 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, - 0x61, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x1a, 0x31, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x75, - 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x09, 0x0a, 0x07, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0xf9, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x31, 0x0a, 0x05, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x78, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3a, - 0x0a, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1e, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, - 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, - 0x52, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x09, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, - 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x09, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x37, 0x0a, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x65, 0x78, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2d, 0x74, 0x65, 0x63, 0x68, 0x2f, - 0x73, 0x74, 0x61, 0x72, 0x73, 0x68, 0x69, 0x70, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proto_exposer_genesis_proto_rawDescOnce sync.Once - file_proto_exposer_genesis_proto_rawDescData = file_proto_exposer_genesis_proto_rawDesc -) - -func file_proto_exposer_genesis_proto_rawDescGZIP() []byte { - file_proto_exposer_genesis_proto_rawDescOnce.Do(func() { - file_proto_exposer_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_exposer_genesis_proto_rawDescData) - }) - return file_proto_exposer_genesis_proto_rawDescData -} - -var file_proto_exposer_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_proto_exposer_genesis_proto_goTypes = []interface{}{ - (*GenesisState)(nil), // 0: exposer.GenesisState - (*GenesisState_Block)(nil), // 1: exposer.GenesisState.Block - (*GenesisState_Evidence)(nil), // 2: exposer.GenesisState.Evidence - (*GenesisState_Validator)(nil), // 3: exposer.GenesisState.Validator - (*GenesisState_Version)(nil), // 4: exposer.GenesisState.Version - (*GenesisState_ConsensusParams)(nil), // 5: exposer.GenesisState.Consensus_params - (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp - (*structpb.Struct)(nil), // 7: google.protobuf.Struct -} -var file_proto_exposer_genesis_proto_depIdxs = []int32{ - 6, // 0: exposer.GenesisState.genesis_time:type_name -> google.protobuf.Timestamp - 5, // 1: exposer.GenesisState.consensus_params:type_name -> exposer.GenesisState.Consensus_params - 7, // 2: exposer.GenesisState.app_state:type_name -> google.protobuf.Struct - 1, // 3: exposer.GenesisState.Consensus_params.block:type_name -> exposer.GenesisState.Block - 2, // 4: exposer.GenesisState.Consensus_params.evidence:type_name -> exposer.GenesisState.Evidence - 3, // 5: exposer.GenesisState.Consensus_params.validator:type_name -> exposer.GenesisState.Validator - 4, // 6: exposer.GenesisState.Consensus_params.version:type_name -> exposer.GenesisState.Version - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_proto_exposer_genesis_proto_init() } -func file_proto_exposer_genesis_proto_init() { - if File_proto_exposer_genesis_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proto_exposer_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_exposer_genesis_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisState_Block); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_exposer_genesis_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisState_Evidence); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_exposer_genesis_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisState_Validator); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_exposer_genesis_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisState_Version); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_exposer_genesis_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisState_ConsensusParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proto_exposer_genesis_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proto_exposer_genesis_proto_goTypes, - DependencyIndexes: file_proto_exposer_genesis_proto_depIdxs, - MessageInfos: file_proto_exposer_genesis_proto_msgTypes, - }.Build() - File_proto_exposer_genesis_proto = out.File - file_proto_exposer_genesis_proto_rawDesc = nil - file_proto_exposer_genesis_proto_goTypes = nil - file_proto_exposer_genesis_proto_depIdxs = nil -} diff --git a/exposer/exposer/genesis.pb.gw.go b/exposer/exposer/genesis.pb.gw.go deleted file mode 100755 index b76fb609..00000000 --- a/exposer/exposer/genesis.pb.gw.go +++ /dev/null @@ -1,3 +0,0 @@ -// +build ignore - -package ignore \ No newline at end of file diff --git a/exposer/exposer/service.pb.go b/exposer/exposer/service.pb.go index 0055349d..57eed685 100755 --- a/exposer/exposer/service.pb.go +++ b/exposer/exposer/service.pb.go @@ -17,6 +17,7 @@ import ( _ "google.golang.org/protobuf/types/descriptorpb" _ "google.golang.org/protobuf/types/known/anypb" emptypb "google.golang.org/protobuf/types/known/emptypb" + structpb "google.golang.org/protobuf/types/known/structpb" reflect "reflect" sync "sync" ) @@ -186,52 +187,52 @@ var file_proto_exposer_service_proto_rawDesc = []byte{ 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, 0x6d, 0x6e, - 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x6e, 0x65, - 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2a, 0x0a, 0x0e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x6e, - 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, - 0x64, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x36, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x26, 0x0a, - 0x10, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x61, 0x74, - 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x97, 0x03, 0x0a, 0x07, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x12, 0x4e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x12, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x22, - 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, - 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x22, - 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, - 0x79, 0x12, 0x51, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x46, - 0x69, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x15, 0x2e, 0x65, 0x78, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x67, 0x65, 0x6e, - 0x65, 0x73, 0x69, 0x73, 0x12, 0x3f, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x12, + 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, 0x6d, 0x6e, 0x65, 0x6d, + 0x6f, 0x6e, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2a, 0x0a, 0x0e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, + 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, + 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x36, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x26, + 0x0a, 0x10, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x99, 0x03, 0x0a, 0x07, 0x45, 0x78, 0x70, 0x6f, 0x73, + 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0d, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x07, 0x12, 0x05, - 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x76, - 0x4b, 0x65, 0x79, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x1a, 0x19, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x4b, 0x65, 0x79, 0x22, 0x12, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x42, - 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2d, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x73, 0x74, 0x61, - 0x72, 0x73, 0x68, 0x69, 0x70, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, 0x65, 0x78, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x44, + 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, + 0x69, 0x64, 0x12, 0x4e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, + 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x70, 0x75, 0x62, 0x5f, 0x6b, + 0x65, 0x79, 0x12, 0x53, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x46, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, + 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x12, 0x3f, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4b, 0x65, + 0x79, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0d, 0x2e, 0x65, 0x78, 0x70, + 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x07, 0x12, 0x05, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, + 0x72, 0x69, 0x76, 0x4b, 0x65, 0x79, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2e, 0x50, 0x72, + 0x69, 0x76, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x4b, 0x65, 0x79, 0x22, 0x12, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x5f, 0x6b, 0x65, + 0x79, 0x73, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2d, 0x74, 0x65, 0x63, 0x68, 0x2f, + 0x73, 0x74, 0x61, 0x72, 0x73, 0x68, 0x69, 0x70, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, + 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -252,7 +253,7 @@ var file_proto_exposer_service_proto_goTypes = []interface{}{ (*ResponsePubKey)(nil), // 1: exposer.ResponsePubKey (*ResponseFileData)(nil), // 2: exposer.ResponseFileData (*emptypb.Empty)(nil), // 3: google.protobuf.Empty - (*GenesisState)(nil), // 4: exposer.GenesisState + (*structpb.Struct)(nil), // 4: google.protobuf.Struct (*Keys)(nil), // 5: exposer.Keys (*PrivValidatorKey)(nil), // 6: exposer.PrivValidatorKey } @@ -264,7 +265,7 @@ var file_proto_exposer_service_proto_depIdxs = []int32{ 3, // 4: exposer.Exposer.GetPrivKeysFile:input_type -> google.protobuf.Empty 0, // 5: exposer.Exposer.GetNodeID:output_type -> exposer.ResponseNodeID 1, // 6: exposer.Exposer.GetPubKey:output_type -> exposer.ResponsePubKey - 4, // 7: exposer.Exposer.GetGenesisFile:output_type -> exposer.GenesisState + 4, // 7: exposer.Exposer.GetGenesisFile:output_type -> google.protobuf.Struct 5, // 8: exposer.Exposer.GetKeys:output_type -> exposer.Keys 6, // 9: exposer.Exposer.GetPrivKeysFile:output_type -> exposer.PrivValidatorKey 5, // [5:10] is the sub-list for method output_type @@ -280,7 +281,6 @@ func file_proto_exposer_service_proto_init() { return } file_proto_exposer_mnemonic_proto_init() - file_proto_exposer_genesis_proto_init() if !protoimpl.UnsafeEnabled { file_proto_exposer_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ResponseNodeID); i { @@ -353,7 +353,7 @@ const _ = grpc.SupportPackageIsVersion6 type ExposerClient interface { GetNodeID(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ResponseNodeID, error) GetPubKey(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ResponsePubKey, error) - GetGenesisFile(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GenesisState, error) + GetGenesisFile(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*structpb.Struct, error) GetKeys(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Keys, error) GetPrivKeysFile(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PrivValidatorKey, error) } @@ -384,8 +384,8 @@ func (c *exposerClient) GetPubKey(ctx context.Context, in *emptypb.Empty, opts . return out, nil } -func (c *exposerClient) GetGenesisFile(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GenesisState, error) { - out := new(GenesisState) +func (c *exposerClient) GetGenesisFile(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*structpb.Struct, error) { + out := new(structpb.Struct) err := c.cc.Invoke(ctx, "/exposer.Exposer/GetGenesisFile", in, out, opts...) if err != nil { return nil, err @@ -415,7 +415,7 @@ func (c *exposerClient) GetPrivKeysFile(ctx context.Context, in *emptypb.Empty, type ExposerServer interface { GetNodeID(context.Context, *emptypb.Empty) (*ResponseNodeID, error) GetPubKey(context.Context, *emptypb.Empty) (*ResponsePubKey, error) - GetGenesisFile(context.Context, *emptypb.Empty) (*GenesisState, error) + GetGenesisFile(context.Context, *emptypb.Empty) (*structpb.Struct, error) GetKeys(context.Context, *emptypb.Empty) (*Keys, error) GetPrivKeysFile(context.Context, *emptypb.Empty) (*PrivValidatorKey, error) } @@ -430,7 +430,7 @@ func (*UnimplementedExposerServer) GetNodeID(context.Context, *emptypb.Empty) (* func (*UnimplementedExposerServer) GetPubKey(context.Context, *emptypb.Empty) (*ResponsePubKey, error) { return nil, status.Errorf(codes.Unimplemented, "method GetPubKey not implemented") } -func (*UnimplementedExposerServer) GetGenesisFile(context.Context, *emptypb.Empty) (*GenesisState, error) { +func (*UnimplementedExposerServer) GetGenesisFile(context.Context, *emptypb.Empty) (*structpb.Struct, error) { return nil, status.Errorf(codes.Unimplemented, "method GetGenesisFile not implemented") } func (*UnimplementedExposerServer) GetKeys(context.Context, *emptypb.Empty) (*Keys, error) { diff --git a/proto/Makefile b/proto/Makefile index de40961b..cbac255c 100644 --- a/proto/Makefile +++ b/proto/Makefile @@ -3,8 +3,12 @@ build-proto: build-exposer build-registry .PHONY: build-registry build-registry: - buf generate --path $(CURDIR)/registry/ --output $(CURDIR)/../registry + bazel build //proto/registry:registry_go_proto .PHONY: build-exposer build-exposer: - buf generate --path $(CURDIR)/exposer/ --output $(CURDIR)/../exposer \ No newline at end of file + bazel build //proto/exposer:exposer_go_proto + +.PHONY: update-go-pbs +update-go-pbs: + cd $(CURDIR)/../ && bash scripts/update-go-pbs.sh diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml deleted file mode 100644 index 67b39abc..00000000 --- a/proto/buf.gen.yaml +++ /dev/null @@ -1,19 +0,0 @@ -version: v1 -managed: - enabled: true - go_package_prefix: - default: github.com/cosmology-tech/starship - except: - - buf.build/googleapis/googleapis -plugins: - - plugin: buf.build/protocolbuffers/go - out: . - opt: paths=source_relative - - plugin: buf.build/grpc/go - out: . - opt: paths=source_relative - - plugin: buf.build/grpc-ecosystem/gateway - out: . - opt: - - paths=source_relative - - generate_unbound_methods=true diff --git a/proto/buf.lock b/proto/buf.lock deleted file mode 100644 index 6aaf62f8..00000000 --- a/proto/buf.lock +++ /dev/null @@ -1,11 +0,0 @@ -# Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: googleapis - repository: googleapis - commit: c0ec788bbbb747fca594a1e2347edd4e - - remote: buf.build - owner: grpc-ecosystem - repository: grpc-gateway - commit: a1ecdc58eccd49aa8bea2a7a9022dc27 diff --git a/proto/buf.yaml b/proto/buf.yaml deleted file mode 100644 index 5ec04eb4..00000000 --- a/proto/buf.yaml +++ /dev/null @@ -1,13 +0,0 @@ -version: v1 -name: buf.build/anmol1696/starship -deps: - - buf.build/googleapis/googleapis - - buf.build/grpc-ecosystem/grpc-gateway -breaking: - use: - - FILE -lint: - use: - - DEFAULT - - COMMENTS - - FILE_LOWER_SNAKE_CASE diff --git a/tests/Makefile b/tests/Makefile index 70a1cbc4..c339dab8 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -19,7 +19,7 @@ stop: stop-forward delete ############################################################################### install: - helm install -f $(HELM_FILE) $(HELM_NAME) ../charts/$(HELM_CHART) --wait --debug + helm install -f $(HELM_FILE) $(HELM_NAME) ../charts/$(HELM_CHART) upgrade: helm upgrade --debug $(HELM_NAME) ../charts/$(HELM_CHART) -f $(HELM_FILE) diff --git a/tests/e2e_test.go b/tests/e2e_test.go index 35ca471e..5851ed36 100644 --- a/tests/e2e_test.go +++ b/tests/e2e_test.go @@ -33,6 +33,10 @@ func (s *TestSuite) SetupTest() { // read config file from yaml configFile := os.Getenv(configEnvKey) + if configFile == "" { + s.T().Log(fmt.Errorf("env var %s not set, using default value", configEnvKey)) + configFile = "configs/two-chain.yaml" + } configFile = strings.Replace(configFile, "tests/", "", -1) yamlFile, err := os.ReadFile(configFile) s.Require().NoError(err) diff --git a/tests/exposer_test.go b/tests/exposer_test.go index 14c24b29..fe5deaaf 100644 --- a/tests/exposer_test.go +++ b/tests/exposer_test.go @@ -7,6 +7,7 @@ import ( "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/types/known/structpb" pb "github.com/cosmology-tech/starship/exposer/exposer" ) @@ -48,12 +49,12 @@ func (s *TestSuite) TestExposer_GetGenesisFile() { s.Require().NoError(err) // todo: fix unmarshalling of genesis into proto - resp := &pb.GenesisState{} + resp := &structpb.Struct{} s.MakeExposerRequest(chain, req, resp) // assert results to expected values s.Assert().NotNil(resp) - s.Assert().Equal(chain.Name, resp.ChainId) + s.Assert().Equal(chain.Name, resp.AsMap()["chain_id"]) } func (s *TestSuite) TestExposer_GetPubKey() { From dcc2be8520dcad905ad8b31ec7d26fe35fdf9a23 Mon Sep 17 00:00:00 2001 From: Anmol1696 Date: Tue, 8 Aug 2023 15:11:19 +0530 Subject: [PATCH 4/5] Remove make command for protos --- Makefile | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Makefile b/Makefile index 4508da2c..b124679d 100644 --- a/Makefile +++ b/Makefile @@ -8,13 +8,6 @@ endif KEYS_CONFIG = charts/$(HELM_CHART)/configs/keys.json VALUES_FILE = charts/$(HELM_CHART)/values.yaml -############################################################################### -### Proto commands ### -############################################################################### -.PHONY: proto -proto: - (cd proto/ && make build-proto) - ############################################################################### ### Helm commands ### ############################################################################### From 1cd4472084ab2947362751a66910d367d4c0ff8e Mon Sep 17 00:00:00 2001 From: Anmol1696 Date: Tue, 8 Aug 2023 15:32:54 +0530 Subject: [PATCH 5/5] add dependencies to bazel tests --- tests/BUILD.bazel | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel index 29ee04de..020f3cc7 100644 --- a/tests/BUILD.bazel +++ b/tests/BUILD.bazel @@ -38,25 +38,7 @@ go_test( "@com_github_json_iterator_go//:go", "@com_github_stretchr_testify//suite", "@in_gopkg_yaml_v3//:yaml_v3", - "@org_uber_go_zap//:zap", - ], -) - -go_test( - name = "tests_test", - srcs = [ - "e2e_test.go", - "exposer_test.go", - "registry_test.go", - ], - embed = [":tests"], - deps = [ - "//proto/exposer:exposer_go_proto", - "//proto/registry:registry_go_proto", - "@com_github_golang_protobuf//jsonpb", - "@com_github_golang_protobuf//proto", - "@com_github_stretchr_testify//suite", - "@in_gopkg_yaml_v3//:yaml_v3", + "@org_golang_google_protobuf//types/known/structpb", "@org_uber_go_zap//:zap", ], )