diff --git a/grpc-server.go b/grpc-server.go index db4814a6..c5155a6f 100644 --- a/grpc-server.go +++ b/grpc-server.go @@ -618,6 +618,6 @@ func (multi *MultiEpoch) GetBlockTime(ctx context.Context, params *old_faithful_ } return &old_faithful_grpc.BlockTimeResponse{ - BlockTime: uint64(blocktime), + BlockTime: int64(blocktime), }, nil } diff --git a/old-faithful-proto/old-faithful-grpc/old-faithful.pb.go b/old-faithful-proto/old-faithful-grpc/old-faithful.pb.go index 058d0e26..6bb1ede0 100644 --- a/old-faithful-proto/old-faithful-grpc/old-faithful.pb.go +++ b/old-faithful-proto/old-faithful-grpc/old-faithful.pb.go @@ -151,7 +151,7 @@ func (x *VersionResponse) GetVersion() string { return "" } -type BlockTimeRequest struct { +type BlockRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -159,8 +159,8 @@ type BlockTimeRequest struct { Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"` } -func (x *BlockTimeRequest) Reset() { - *x = BlockTimeRequest{} +func (x *BlockRequest) Reset() { + *x = BlockRequest{} if protoimpl.UnsafeEnabled { mi := &file_old_faithful_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -168,13 +168,13 @@ func (x *BlockTimeRequest) Reset() { } } -func (x *BlockTimeRequest) String() string { +func (x *BlockRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BlockTimeRequest) ProtoMessage() {} +func (*BlockRequest) ProtoMessage() {} -func (x *BlockTimeRequest) ProtoReflect() protoreflect.Message { +func (x *BlockRequest) ProtoReflect() protoreflect.Message { mi := &file_old_faithful_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -186,28 +186,35 @@ func (x *BlockTimeRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BlockTimeRequest.ProtoReflect.Descriptor instead. -func (*BlockTimeRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use BlockRequest.ProtoReflect.Descriptor instead. +func (*BlockRequest) Descriptor() ([]byte, []int) { return file_old_faithful_proto_rawDescGZIP(), []int{2} } -func (x *BlockTimeRequest) GetSlot() uint64 { +func (x *BlockRequest) GetSlot() uint64 { if x != nil { return x.Slot } return 0 } -type BlockTimeResponse struct { +type BlockResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BlockTime uint64 `protobuf:"varint,1,opt,name=block_time,json=blockTime,proto3" json:"block_time,omitempty"` + PreviousBlockhash []byte `protobuf:"bytes,1,opt,name=previous_blockhash,json=previousBlockhash,proto3" json:"previous_blockhash,omitempty"` + Blockhash []byte `protobuf:"bytes,2,opt,name=blockhash,proto3" json:"blockhash,omitempty"` + ParentSlot uint64 `protobuf:"varint,3,opt,name=parent_slot,json=parentSlot,proto3" json:"parent_slot,omitempty"` + Slot uint64 `protobuf:"varint,4,opt,name=slot,proto3" json:"slot,omitempty"` + BlockTime int64 `protobuf:"varint,5,opt,name=block_time,json=blockTime,proto3" json:"block_time,omitempty"` + BlockHeight uint64 `protobuf:"varint,6,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + Transactions []*Transaction `protobuf:"bytes,7,rep,name=transactions,proto3" json:"transactions,omitempty"` + Rewards []byte `protobuf:"bytes,8,opt,name=rewards,proto3" json:"rewards,omitempty"` // protobuf or bincode (or empty) } -func (x *BlockTimeResponse) Reset() { - *x = BlockTimeResponse{} +func (x *BlockResponse) Reset() { + *x = BlockResponse{} if protoimpl.UnsafeEnabled { mi := &file_old_faithful_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -215,13 +222,13 @@ func (x *BlockTimeResponse) Reset() { } } -func (x *BlockTimeResponse) String() string { +func (x *BlockResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BlockTimeResponse) ProtoMessage() {} +func (*BlockResponse) ProtoMessage() {} -func (x *BlockTimeResponse) ProtoReflect() protoreflect.Message { +func (x *BlockResponse) ProtoReflect() protoreflect.Message { mi := &file_old_faithful_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -233,19 +240,68 @@ func (x *BlockTimeResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BlockTimeResponse.ProtoReflect.Descriptor instead. -func (*BlockTimeResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use BlockResponse.ProtoReflect.Descriptor instead. +func (*BlockResponse) Descriptor() ([]byte, []int) { return file_old_faithful_proto_rawDescGZIP(), []int{3} } -func (x *BlockTimeResponse) GetBlockTime() uint64 { +func (x *BlockResponse) GetPreviousBlockhash() []byte { + if x != nil { + return x.PreviousBlockhash + } + return nil +} + +func (x *BlockResponse) GetBlockhash() []byte { + if x != nil { + return x.Blockhash + } + return nil +} + +func (x *BlockResponse) GetParentSlot() uint64 { + if x != nil { + return x.ParentSlot + } + return 0 +} + +func (x *BlockResponse) GetSlot() uint64 { + if x != nil { + return x.Slot + } + return 0 +} + +func (x *BlockResponse) GetBlockTime() int64 { if x != nil { return x.BlockTime } return 0 } -type BlockRequest struct { +func (x *BlockResponse) GetBlockHeight() uint64 { + if x != nil { + return x.BlockHeight + } + return 0 +} + +func (x *BlockResponse) GetTransactions() []*Transaction { + if x != nil { + return x.Transactions + } + return nil +} + +func (x *BlockResponse) GetRewards() []byte { + if x != nil { + return x.Rewards + } + return nil +} + +type BlockTimeRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -253,8 +309,8 @@ type BlockRequest struct { Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"` } -func (x *BlockRequest) Reset() { - *x = BlockRequest{} +func (x *BlockTimeRequest) Reset() { + *x = BlockTimeRequest{} if protoimpl.UnsafeEnabled { mi := &file_old_faithful_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -262,13 +318,13 @@ func (x *BlockRequest) Reset() { } } -func (x *BlockRequest) String() string { +func (x *BlockTimeRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BlockRequest) ProtoMessage() {} +func (*BlockTimeRequest) ProtoMessage() {} -func (x *BlockRequest) ProtoReflect() protoreflect.Message { +func (x *BlockTimeRequest) ProtoReflect() protoreflect.Message { mi := &file_old_faithful_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -280,35 +336,28 @@ func (x *BlockRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BlockRequest.ProtoReflect.Descriptor instead. -func (*BlockRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use BlockTimeRequest.ProtoReflect.Descriptor instead. +func (*BlockTimeRequest) Descriptor() ([]byte, []int) { return file_old_faithful_proto_rawDescGZIP(), []int{4} } -func (x *BlockRequest) GetSlot() uint64 { +func (x *BlockTimeRequest) GetSlot() uint64 { if x != nil { return x.Slot } return 0 } -type BlockResponse struct { +type BlockTimeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - PreviousBlockhash []byte `protobuf:"bytes,1,opt,name=previous_blockhash,json=previousBlockhash,proto3" json:"previous_blockhash,omitempty"` - Blockhash []byte `protobuf:"bytes,2,opt,name=blockhash,proto3" json:"blockhash,omitempty"` - ParentSlot uint64 `protobuf:"varint,3,opt,name=parent_slot,json=parentSlot,proto3" json:"parent_slot,omitempty"` - Slot uint64 `protobuf:"varint,4,opt,name=slot,proto3" json:"slot,omitempty"` - BlockTime int64 `protobuf:"varint,5,opt,name=block_time,json=blockTime,proto3" json:"block_time,omitempty"` - BlockHeight uint64 `protobuf:"varint,6,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` - Transactions []*Transaction `protobuf:"bytes,7,rep,name=transactions,proto3" json:"transactions,omitempty"` - Rewards []byte `protobuf:"bytes,8,opt,name=rewards,proto3" json:"rewards,omitempty"` // protobuf or bincode (or empty) + BlockTime int64 `protobuf:"varint,1,opt,name=block_time,json=blockTime,proto3" json:"block_time,omitempty"` } -func (x *BlockResponse) Reset() { - *x = BlockResponse{} +func (x *BlockTimeResponse) Reset() { + *x = BlockTimeResponse{} if protoimpl.UnsafeEnabled { mi := &file_old_faithful_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -316,13 +365,13 @@ func (x *BlockResponse) Reset() { } } -func (x *BlockResponse) String() string { +func (x *BlockTimeResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BlockResponse) ProtoMessage() {} +func (*BlockTimeResponse) ProtoMessage() {} -func (x *BlockResponse) ProtoReflect() protoreflect.Message { +func (x *BlockTimeResponse) ProtoReflect() protoreflect.Message { mi := &file_old_faithful_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -334,67 +383,18 @@ func (x *BlockResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BlockResponse.ProtoReflect.Descriptor instead. -func (*BlockResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use BlockTimeResponse.ProtoReflect.Descriptor instead. +func (*BlockTimeResponse) Descriptor() ([]byte, []int) { return file_old_faithful_proto_rawDescGZIP(), []int{5} } -func (x *BlockResponse) GetPreviousBlockhash() []byte { - if x != nil { - return x.PreviousBlockhash - } - return nil -} - -func (x *BlockResponse) GetBlockhash() []byte { - if x != nil { - return x.Blockhash - } - return nil -} - -func (x *BlockResponse) GetParentSlot() uint64 { - if x != nil { - return x.ParentSlot - } - return 0 -} - -func (x *BlockResponse) GetSlot() uint64 { - if x != nil { - return x.Slot - } - return 0 -} - -func (x *BlockResponse) GetBlockTime() int64 { +func (x *BlockTimeResponse) GetBlockTime() int64 { if x != nil { return x.BlockTime } return 0 } -func (x *BlockResponse) GetBlockHeight() uint64 { - if x != nil { - return x.BlockHeight - } - return 0 -} - -func (x *BlockResponse) GetTransactions() []*Transaction { - if x != nil { - return x.Transactions - } - return nil -} - -func (x *BlockResponse) GetRewards() []byte { - if x != nil { - return x.Rewards - } - return nil -} - type TransactionRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -888,33 +888,33 @@ var file_old_faithful_proto_rawDesc = []byte{ 0x65, 0x73, 0x74, 0x22, 0x2b, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x22, 0x26, 0x0a, 0x10, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x22, 0x32, 0x0a, 0x11, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x22, 0x0a, 0x0c, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, - 0x22, 0xab, 0x02, 0x0a, 0x0d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, - 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x68, 0x61, 0x73, - 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x68, 0x61, 0x73, 0x68, 0x12, - 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x6c, 0x6f, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, - 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x4f, - 0x6c, 0x64, 0x46, 0x61, 0x69, 0x74, 0x68, 0x66, 0x75, 0x6c, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x22, 0x32, + 0x22, 0x22, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, + 0x73, 0x6c, 0x6f, 0x74, 0x22, 0xab, 0x02, 0x0a, 0x0d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, + 0x75, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x11, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x68, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x68, + 0x61, 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x6c, + 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x4f, 0x6c, 0x64, 0x46, 0x61, 0x69, 0x74, 0x68, 0x66, 0x75, 0x6c, 0x2e, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x22, 0x26, 0x0a, 0x10, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x22, 0x32, 0x0a, 0x11, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x32, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, @@ -989,16 +989,16 @@ var file_old_faithful_proto_rawDesc = []byte{ 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x2e, 0x4f, 0x6c, 0x64, 0x46, 0x61, 0x69, 0x74, 0x68, 0x66, 0x75, 0x6c, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x4f, 0x6c, 0x64, 0x46, 0x61, 0x69, 0x74, 0x68, 0x66, 0x75, 0x6c, 0x2e, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, - 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1d, - 0x2e, 0x4f, 0x6c, 0x64, 0x46, 0x61, 0x69, 0x74, 0x68, 0x66, 0x75, 0x6c, 0x2e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, - 0x4f, 0x6c, 0x64, 0x46, 0x61, 0x69, 0x74, 0x68, 0x66, 0x75, 0x6c, 0x2e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, - 0x08, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x19, 0x2e, 0x4f, 0x6c, 0x64, 0x46, - 0x61, 0x69, 0x74, 0x68, 0x66, 0x75, 0x6c, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x4f, 0x6c, 0x64, 0x46, 0x61, 0x69, 0x74, 0x68, 0x66, - 0x75, 0x6c, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, + 0x0a, 0x08, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x19, 0x2e, 0x4f, 0x6c, 0x64, + 0x46, 0x61, 0x69, 0x74, 0x68, 0x66, 0x75, 0x6c, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x4f, 0x6c, 0x64, 0x46, 0x61, 0x69, 0x74, 0x68, + 0x66, 0x75, 0x6c, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x1d, 0x2e, 0x4f, 0x6c, 0x64, 0x46, 0x61, 0x69, 0x74, 0x68, 0x66, 0x75, 0x6c, 0x2e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1e, 0x2e, 0x4f, 0x6c, 0x64, 0x46, 0x61, 0x69, 0x74, 0x68, 0x66, 0x75, 0x6c, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x4f, 0x6c, 0x64, 0x46, 0x61, 0x69, 0x74, 0x68, 0x66, 0x75, 0x6c, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, @@ -1034,10 +1034,10 @@ var file_old_faithful_proto_goTypes = []any{ (GetResponseErrorCode)(0), // 0: OldFaithful.GetResponseErrorCode (*VersionRequest)(nil), // 1: OldFaithful.VersionRequest (*VersionResponse)(nil), // 2: OldFaithful.VersionResponse - (*BlockTimeRequest)(nil), // 3: OldFaithful.BlockTimeRequest - (*BlockTimeResponse)(nil), // 4: OldFaithful.BlockTimeResponse - (*BlockRequest)(nil), // 5: OldFaithful.BlockRequest - (*BlockResponse)(nil), // 6: OldFaithful.BlockResponse + (*BlockRequest)(nil), // 3: OldFaithful.BlockRequest + (*BlockResponse)(nil), // 4: OldFaithful.BlockResponse + (*BlockTimeRequest)(nil), // 5: OldFaithful.BlockTimeRequest + (*BlockTimeResponse)(nil), // 6: OldFaithful.BlockTimeResponse (*TransactionRequest)(nil), // 7: OldFaithful.TransactionRequest (*TransactionResponse)(nil), // 8: OldFaithful.TransactionResponse (*Transaction)(nil), // 9: OldFaithful.Transaction @@ -1049,23 +1049,23 @@ var file_old_faithful_proto_depIdxs = []int32{ 9, // 0: OldFaithful.BlockResponse.transactions:type_name -> OldFaithful.Transaction 9, // 1: OldFaithful.TransactionResponse.transaction:type_name -> OldFaithful.Transaction 1, // 2: OldFaithful.GetRequest.version:type_name -> OldFaithful.VersionRequest - 3, // 3: OldFaithful.GetRequest.block_time:type_name -> OldFaithful.BlockTimeRequest - 5, // 4: OldFaithful.GetRequest.block:type_name -> OldFaithful.BlockRequest + 5, // 3: OldFaithful.GetRequest.block_time:type_name -> OldFaithful.BlockTimeRequest + 3, // 4: OldFaithful.GetRequest.block:type_name -> OldFaithful.BlockRequest 7, // 5: OldFaithful.GetRequest.transaction:type_name -> OldFaithful.TransactionRequest 12, // 6: OldFaithful.GetResponse.error:type_name -> OldFaithful.GetResponseError 2, // 7: OldFaithful.GetResponse.version:type_name -> OldFaithful.VersionResponse - 4, // 8: OldFaithful.GetResponse.block_time:type_name -> OldFaithful.BlockTimeResponse - 6, // 9: OldFaithful.GetResponse.block:type_name -> OldFaithful.BlockResponse + 6, // 8: OldFaithful.GetResponse.block_time:type_name -> OldFaithful.BlockTimeResponse + 4, // 9: OldFaithful.GetResponse.block:type_name -> OldFaithful.BlockResponse 8, // 10: OldFaithful.GetResponse.transaction:type_name -> OldFaithful.TransactionResponse 0, // 11: OldFaithful.GetResponseError.code:type_name -> OldFaithful.GetResponseErrorCode 1, // 12: OldFaithful.OldFaithful.GetVersion:input_type -> OldFaithful.VersionRequest - 3, // 13: OldFaithful.OldFaithful.GetBlockTime:input_type -> OldFaithful.BlockTimeRequest - 5, // 14: OldFaithful.OldFaithful.GetBlock:input_type -> OldFaithful.BlockRequest + 3, // 13: OldFaithful.OldFaithful.GetBlock:input_type -> OldFaithful.BlockRequest + 5, // 14: OldFaithful.OldFaithful.GetBlockTime:input_type -> OldFaithful.BlockTimeRequest 7, // 15: OldFaithful.OldFaithful.GetTransaction:input_type -> OldFaithful.TransactionRequest 10, // 16: OldFaithful.OldFaithful.Get:input_type -> OldFaithful.GetRequest 2, // 17: OldFaithful.OldFaithful.GetVersion:output_type -> OldFaithful.VersionResponse - 4, // 18: OldFaithful.OldFaithful.GetBlockTime:output_type -> OldFaithful.BlockTimeResponse - 6, // 19: OldFaithful.OldFaithful.GetBlock:output_type -> OldFaithful.BlockResponse + 4, // 18: OldFaithful.OldFaithful.GetBlock:output_type -> OldFaithful.BlockResponse + 6, // 19: OldFaithful.OldFaithful.GetBlockTime:output_type -> OldFaithful.BlockTimeResponse 8, // 20: OldFaithful.OldFaithful.GetTransaction:output_type -> OldFaithful.TransactionResponse 11, // 21: OldFaithful.OldFaithful.Get:output_type -> OldFaithful.GetResponse 17, // [17:22] is the sub-list for method output_type @@ -1106,7 +1106,7 @@ func file_old_faithful_proto_init() { } } file_old_faithful_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*BlockTimeRequest); i { + switch v := v.(*BlockRequest); i { case 0: return &v.state case 1: @@ -1118,7 +1118,7 @@ func file_old_faithful_proto_init() { } } file_old_faithful_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*BlockTimeResponse); i { + switch v := v.(*BlockResponse); i { case 0: return &v.state case 1: @@ -1130,7 +1130,7 @@ func file_old_faithful_proto_init() { } } file_old_faithful_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*BlockRequest); i { + switch v := v.(*BlockTimeRequest); i { case 0: return &v.state case 1: @@ -1142,7 +1142,7 @@ func file_old_faithful_proto_init() { } } file_old_faithful_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*BlockResponse); i { + switch v := v.(*BlockTimeResponse); i { case 0: return &v.state case 1: diff --git a/old-faithful-proto/old-faithful-grpc/old-faithful_grpc.pb.go b/old-faithful-proto/old-faithful-grpc/old-faithful_grpc.pb.go index 3176a1dc..29351c4c 100644 --- a/old-faithful-proto/old-faithful-grpc/old-faithful_grpc.pb.go +++ b/old-faithful-proto/old-faithful-grpc/old-faithful_grpc.pb.go @@ -20,8 +20,8 @@ const _ = grpc.SupportPackageIsVersion8 const ( OldFaithful_GetVersion_FullMethodName = "/OldFaithful.OldFaithful/GetVersion" - OldFaithful_GetBlockTime_FullMethodName = "/OldFaithful.OldFaithful/GetBlockTime" OldFaithful_GetBlock_FullMethodName = "/OldFaithful.OldFaithful/GetBlock" + OldFaithful_GetBlockTime_FullMethodName = "/OldFaithful.OldFaithful/GetBlockTime" OldFaithful_GetTransaction_FullMethodName = "/OldFaithful.OldFaithful/GetTransaction" OldFaithful_Get_FullMethodName = "/OldFaithful.OldFaithful/Get" ) @@ -31,8 +31,8 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type OldFaithfulClient interface { GetVersion(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) - GetBlockTime(ctx context.Context, in *BlockTimeRequest, opts ...grpc.CallOption) (*BlockTimeResponse, error) GetBlock(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*BlockResponse, error) + GetBlockTime(ctx context.Context, in *BlockTimeRequest, opts ...grpc.CallOption) (*BlockTimeResponse, error) GetTransaction(ctx context.Context, in *TransactionRequest, opts ...grpc.CallOption) (*TransactionResponse, error) Get(ctx context.Context, opts ...grpc.CallOption) (OldFaithful_GetClient, error) } @@ -55,20 +55,20 @@ func (c *oldFaithfulClient) GetVersion(ctx context.Context, in *VersionRequest, return out, nil } -func (c *oldFaithfulClient) GetBlockTime(ctx context.Context, in *BlockTimeRequest, opts ...grpc.CallOption) (*BlockTimeResponse, error) { +func (c *oldFaithfulClient) GetBlock(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*BlockResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(BlockTimeResponse) - err := c.cc.Invoke(ctx, OldFaithful_GetBlockTime_FullMethodName, in, out, cOpts...) + out := new(BlockResponse) + err := c.cc.Invoke(ctx, OldFaithful_GetBlock_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *oldFaithfulClient) GetBlock(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*BlockResponse, error) { +func (c *oldFaithfulClient) GetBlockTime(ctx context.Context, in *BlockTimeRequest, opts ...grpc.CallOption) (*BlockTimeResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(BlockResponse) - err := c.cc.Invoke(ctx, OldFaithful_GetBlock_FullMethodName, in, out, cOpts...) + out := new(BlockTimeResponse) + err := c.cc.Invoke(ctx, OldFaithful_GetBlockTime_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -122,8 +122,8 @@ func (x *oldFaithfulGetClient) Recv() (*GetResponse, error) { // for forward compatibility type OldFaithfulServer interface { GetVersion(context.Context, *VersionRequest) (*VersionResponse, error) - GetBlockTime(context.Context, *BlockTimeRequest) (*BlockTimeResponse, error) GetBlock(context.Context, *BlockRequest) (*BlockResponse, error) + GetBlockTime(context.Context, *BlockTimeRequest) (*BlockTimeResponse, error) GetTransaction(context.Context, *TransactionRequest) (*TransactionResponse, error) Get(OldFaithful_GetServer) error mustEmbedUnimplementedOldFaithfulServer() @@ -136,12 +136,12 @@ type UnimplementedOldFaithfulServer struct { func (UnimplementedOldFaithfulServer) GetVersion(context.Context, *VersionRequest) (*VersionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented") } -func (UnimplementedOldFaithfulServer) GetBlockTime(context.Context, *BlockTimeRequest) (*BlockTimeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBlockTime not implemented") -} func (UnimplementedOldFaithfulServer) GetBlock(context.Context, *BlockRequest) (*BlockResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetBlock not implemented") } +func (UnimplementedOldFaithfulServer) GetBlockTime(context.Context, *BlockTimeRequest) (*BlockTimeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBlockTime not implemented") +} func (UnimplementedOldFaithfulServer) GetTransaction(context.Context, *TransactionRequest) (*TransactionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetTransaction not implemented") } @@ -179,38 +179,38 @@ func _OldFaithful_GetVersion_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } -func _OldFaithful_GetBlockTime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BlockTimeRequest) +func _OldFaithful_GetBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(OldFaithfulServer).GetBlockTime(ctx, in) + return srv.(OldFaithfulServer).GetBlock(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: OldFaithful_GetBlockTime_FullMethodName, + FullMethod: OldFaithful_GetBlock_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OldFaithfulServer).GetBlockTime(ctx, req.(*BlockTimeRequest)) + return srv.(OldFaithfulServer).GetBlock(ctx, req.(*BlockRequest)) } return interceptor(ctx, in, info, handler) } -func _OldFaithful_GetBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BlockRequest) +func _OldFaithful_GetBlockTime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockTimeRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(OldFaithfulServer).GetBlock(ctx, in) + return srv.(OldFaithfulServer).GetBlockTime(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: OldFaithful_GetBlock_FullMethodName, + FullMethod: OldFaithful_GetBlockTime_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OldFaithfulServer).GetBlock(ctx, req.(*BlockRequest)) + return srv.(OldFaithfulServer).GetBlockTime(ctx, req.(*BlockTimeRequest)) } return interceptor(ctx, in, info, handler) } @@ -270,14 +270,14 @@ var OldFaithful_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetVersion", Handler: _OldFaithful_GetVersion_Handler, }, - { - MethodName: "GetBlockTime", - Handler: _OldFaithful_GetBlockTime_Handler, - }, { MethodName: "GetBlock", Handler: _OldFaithful_GetBlock_Handler, }, + { + MethodName: "GetBlockTime", + Handler: _OldFaithful_GetBlockTime_Handler, + }, { MethodName: "GetTransaction", Handler: _OldFaithful_GetTransaction_Handler, diff --git a/old-faithful-proto/proto/old-faithful.proto b/old-faithful-proto/proto/old-faithful.proto index c79f98e3..0985d679 100644 --- a/old-faithful-proto/proto/old-faithful.proto +++ b/old-faithful-proto/proto/old-faithful.proto @@ -6,8 +6,8 @@ option go_package = "github.com/rpcpool/yellowstone-faithful/old-faithful-proto; service OldFaithful { rpc GetVersion(VersionRequest) returns (VersionResponse); - rpc GetBlockTime(BlockTimeRequest) returns (BlockTimeResponse); rpc GetBlock(BlockRequest) returns (BlockResponse); + rpc GetBlockTime(BlockTimeRequest) returns (BlockTimeResponse); rpc GetTransaction(TransactionRequest) returns (TransactionResponse); rpc Get(stream GetRequest) returns (stream GetResponse); @@ -19,14 +19,6 @@ message VersionResponse { string version = 1; } -message BlockTimeRequest { - uint64 slot = 1; -} - -message BlockTimeResponse { - uint64 block_time = 1; -} - message BlockRequest { uint64 slot = 1; } @@ -42,6 +34,14 @@ message BlockResponse { bytes rewards = 8; // protobuf or bincode (or empty) } +message BlockTimeRequest { + uint64 slot = 1; +} + +message BlockTimeResponse { + int64 block_time = 1; +} + message TransactionRequest { bytes signature = 1; }