diff --git a/protos/.gitignore b/protos/.gitignore new file mode 100644 index 000000000..7104339d9 --- /dev/null +++ b/protos/.gitignore @@ -0,0 +1,2 @@ +src/services.rs +src/services_grpc.rs diff --git a/protos/src/services.rs b/protos/src/services.rs deleted file mode 100644 index 4273d9663..000000000 --- a/protos/src/services.rs +++ /dev/null @@ -1,1657 +0,0 @@ -// This file is generated by rust-protobuf 2.0.6. Do not edit -// @generated - -// https://github.com/Manishearth/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy)] - -#![cfg_attr(rustfmt, rustfmt_skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unsafe_code)] -#![allow(unused_imports)] -#![allow(unused_results)] - -use protobuf::Message as Message_imported_for_functions; -use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; - -#[derive(PartialEq,Clone,Default)] -pub struct BeaconBlock { - // message fields - pub slot: u64, - pub block_root: ::std::vec::Vec, - pub randao_reveal: ::std::vec::Vec, - pub signature: ::std::vec::Vec, - // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, -} - -impl BeaconBlock { - pub fn new() -> BeaconBlock { - ::std::default::Default::default() - } - - // uint64 slot = 1; - - pub fn clear_slot(&mut self) { - self.slot = 0; - } - - // Param is passed by value, moved - pub fn set_slot(&mut self, v: u64) { - self.slot = v; - } - - pub fn get_slot(&self) -> u64 { - self.slot - } - - // bytes block_root = 2; - - pub fn clear_block_root(&mut self) { - self.block_root.clear(); - } - - // Param is passed by value, moved - pub fn set_block_root(&mut self, v: ::std::vec::Vec) { - self.block_root = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_block_root(&mut self) -> &mut ::std::vec::Vec { - &mut self.block_root - } - - // Take field - pub fn take_block_root(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.block_root, ::std::vec::Vec::new()) - } - - pub fn get_block_root(&self) -> &[u8] { - &self.block_root - } - - // bytes randao_reveal = 3; - - pub fn clear_randao_reveal(&mut self) { - self.randao_reveal.clear(); - } - - // Param is passed by value, moved - pub fn set_randao_reveal(&mut self, v: ::std::vec::Vec) { - self.randao_reveal = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_randao_reveal(&mut self) -> &mut ::std::vec::Vec { - &mut self.randao_reveal - } - - // Take field - pub fn take_randao_reveal(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.randao_reveal, ::std::vec::Vec::new()) - } - - pub fn get_randao_reveal(&self) -> &[u8] { - &self.randao_reveal - } - - // bytes signature = 4; - - pub fn clear_signature(&mut self) { - self.signature.clear(); - } - - // Param is passed by value, moved - pub fn set_signature(&mut self, v: ::std::vec::Vec) { - self.signature = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_signature(&mut self) -> &mut ::std::vec::Vec { - &mut self.signature - } - - // Take field - pub fn take_signature(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.signature, ::std::vec::Vec::new()) - } - - pub fn get_signature(&self) -> &[u8] { - &self.signature - } -} - -impl ::protobuf::Message for BeaconBlock { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_uint64()?; - self.slot = tmp; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.block_root)?; - }, - 3 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.randao_reveal)?; - }, - 4 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.signature)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.slot != 0 { - my_size += ::protobuf::rt::value_size(1, self.slot, ::protobuf::wire_format::WireTypeVarint); - } - if !self.block_root.is_empty() { - my_size += ::protobuf::rt::bytes_size(2, &self.block_root); - } - if !self.randao_reveal.is_empty() { - my_size += ::protobuf::rt::bytes_size(3, &self.randao_reveal); - } - if !self.signature.is_empty() { - my_size += ::protobuf::rt::bytes_size(4, &self.signature); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { - if self.slot != 0 { - os.write_uint64(1, self.slot)?; - } - if !self.block_root.is_empty() { - os.write_bytes(2, &self.block_root)?; - } - if !self.randao_reveal.is_empty() { - os.write_bytes(3, &self.randao_reveal)?; - } - if !self.signature.is_empty() { - os.write_bytes(4, &self.signature)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any - } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any - } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> BeaconBlock { - BeaconBlock::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, - }; - unsafe { - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( - "slot", - |m: &BeaconBlock| { &m.slot }, - |m: &mut BeaconBlock| { &mut m.slot }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "block_root", - |m: &BeaconBlock| { &m.block_root }, - |m: &mut BeaconBlock| { &mut m.block_root }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "randao_reveal", - |m: &BeaconBlock| { &m.randao_reveal }, - |m: &mut BeaconBlock| { &mut m.randao_reveal }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "signature", - |m: &BeaconBlock| { &m.signature }, - |m: &mut BeaconBlock| { &mut m.signature }, - )); - ::protobuf::reflect::MessageDescriptor::new::( - "BeaconBlock", - fields, - file_descriptor_proto() - ) - }) - } - } - - fn default_instance() -> &'static BeaconBlock { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const BeaconBlock, - }; - unsafe { - instance.get(BeaconBlock::new) - } - } -} - -impl ::protobuf::Clear for BeaconBlock { - fn clear(&mut self) { - self.clear_slot(); - self.clear_block_root(); - self.clear_randao_reveal(); - self.clear_signature(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for BeaconBlock { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for BeaconBlock { - fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { - ::protobuf::reflect::ProtobufValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct ProduceBeaconBlockRequest { - // message fields - pub slot: u64, - // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, -} - -impl ProduceBeaconBlockRequest { - pub fn new() -> ProduceBeaconBlockRequest { - ::std::default::Default::default() - } - - // uint64 slot = 1; - - pub fn clear_slot(&mut self) { - self.slot = 0; - } - - // Param is passed by value, moved - pub fn set_slot(&mut self, v: u64) { - self.slot = v; - } - - pub fn get_slot(&self) -> u64 { - self.slot - } -} - -impl ::protobuf::Message for ProduceBeaconBlockRequest { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_uint64()?; - self.slot = tmp; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.slot != 0 { - my_size += ::protobuf::rt::value_size(1, self.slot, ::protobuf::wire_format::WireTypeVarint); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { - if self.slot != 0 { - os.write_uint64(1, self.slot)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any - } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any - } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> ProduceBeaconBlockRequest { - ProduceBeaconBlockRequest::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, - }; - unsafe { - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( - "slot", - |m: &ProduceBeaconBlockRequest| { &m.slot }, - |m: &mut ProduceBeaconBlockRequest| { &mut m.slot }, - )); - ::protobuf::reflect::MessageDescriptor::new::( - "ProduceBeaconBlockRequest", - fields, - file_descriptor_proto() - ) - }) - } - } - - fn default_instance() -> &'static ProduceBeaconBlockRequest { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ProduceBeaconBlockRequest, - }; - unsafe { - instance.get(ProduceBeaconBlockRequest::new) - } - } -} - -impl ::protobuf::Clear for ProduceBeaconBlockRequest { - fn clear(&mut self) { - self.clear_slot(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for ProduceBeaconBlockRequest { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for ProduceBeaconBlockRequest { - fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { - ::protobuf::reflect::ProtobufValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct ProduceBeaconBlockResponse { - // message fields - pub block: ::protobuf::SingularPtrField, - // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, -} - -impl ProduceBeaconBlockResponse { - pub fn new() -> ProduceBeaconBlockResponse { - ::std::default::Default::default() - } - - // .ethereum.beacon.rpc.v1.BeaconBlock block = 1; - - pub fn clear_block(&mut self) { - self.block.clear(); - } - - pub fn has_block(&self) -> bool { - self.block.is_some() - } - - // Param is passed by value, moved - pub fn set_block(&mut self, v: BeaconBlock) { - self.block = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_block(&mut self) -> &mut BeaconBlock { - if self.block.is_none() { - self.block.set_default(); - } - self.block.as_mut().unwrap() - } - - // Take field - pub fn take_block(&mut self) -> BeaconBlock { - self.block.take().unwrap_or_else(|| BeaconBlock::new()) - } - - pub fn get_block(&self) -> &BeaconBlock { - self.block.as_ref().unwrap_or_else(|| BeaconBlock::default_instance()) - } -} - -impl ::protobuf::Message for ProduceBeaconBlockResponse { - fn is_initialized(&self) -> bool { - for v in &self.block { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.block)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let Some(ref v) = self.block.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { - if let Some(ref v) = self.block.as_ref() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any - } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any - } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> ProduceBeaconBlockResponse { - ProduceBeaconBlockResponse::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, - }; - unsafe { - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "block", - |m: &ProduceBeaconBlockResponse| { &m.block }, - |m: &mut ProduceBeaconBlockResponse| { &mut m.block }, - )); - ::protobuf::reflect::MessageDescriptor::new::( - "ProduceBeaconBlockResponse", - fields, - file_descriptor_proto() - ) - }) - } - } - - fn default_instance() -> &'static ProduceBeaconBlockResponse { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ProduceBeaconBlockResponse, - }; - unsafe { - instance.get(ProduceBeaconBlockResponse::new) - } - } -} - -impl ::protobuf::Clear for ProduceBeaconBlockResponse { - fn clear(&mut self) { - self.clear_block(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for ProduceBeaconBlockResponse { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for ProduceBeaconBlockResponse { - fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { - ::protobuf::reflect::ProtobufValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct PublishBeaconBlockRequest { - // message fields - pub block: ::protobuf::SingularPtrField, - // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, -} - -impl PublishBeaconBlockRequest { - pub fn new() -> PublishBeaconBlockRequest { - ::std::default::Default::default() - } - - // .ethereum.beacon.rpc.v1.BeaconBlock block = 1; - - pub fn clear_block(&mut self) { - self.block.clear(); - } - - pub fn has_block(&self) -> bool { - self.block.is_some() - } - - // Param is passed by value, moved - pub fn set_block(&mut self, v: BeaconBlock) { - self.block = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_block(&mut self) -> &mut BeaconBlock { - if self.block.is_none() { - self.block.set_default(); - } - self.block.as_mut().unwrap() - } - - // Take field - pub fn take_block(&mut self) -> BeaconBlock { - self.block.take().unwrap_or_else(|| BeaconBlock::new()) - } - - pub fn get_block(&self) -> &BeaconBlock { - self.block.as_ref().unwrap_or_else(|| BeaconBlock::default_instance()) - } -} - -impl ::protobuf::Message for PublishBeaconBlockRequest { - fn is_initialized(&self) -> bool { - for v in &self.block { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.block)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let Some(ref v) = self.block.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { - if let Some(ref v) = self.block.as_ref() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any - } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any - } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> PublishBeaconBlockRequest { - PublishBeaconBlockRequest::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, - }; - unsafe { - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "block", - |m: &PublishBeaconBlockRequest| { &m.block }, - |m: &mut PublishBeaconBlockRequest| { &mut m.block }, - )); - ::protobuf::reflect::MessageDescriptor::new::( - "PublishBeaconBlockRequest", - fields, - file_descriptor_proto() - ) - }) - } - } - - fn default_instance() -> &'static PublishBeaconBlockRequest { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const PublishBeaconBlockRequest, - }; - unsafe { - instance.get(PublishBeaconBlockRequest::new) - } - } -} - -impl ::protobuf::Clear for PublishBeaconBlockRequest { - fn clear(&mut self) { - self.clear_block(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for PublishBeaconBlockRequest { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for PublishBeaconBlockRequest { - fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { - ::protobuf::reflect::ProtobufValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct PublishBeaconBlockResponse { - // message fields - pub success: bool, - pub msg: ::std::vec::Vec, - // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, -} - -impl PublishBeaconBlockResponse { - pub fn new() -> PublishBeaconBlockResponse { - ::std::default::Default::default() - } - - // bool success = 1; - - pub fn clear_success(&mut self) { - self.success = false; - } - - // Param is passed by value, moved - pub fn set_success(&mut self, v: bool) { - self.success = v; - } - - pub fn get_success(&self) -> bool { - self.success - } - - // bytes msg = 2; - - pub fn clear_msg(&mut self) { - self.msg.clear(); - } - - // Param is passed by value, moved - pub fn set_msg(&mut self, v: ::std::vec::Vec) { - self.msg = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_msg(&mut self) -> &mut ::std::vec::Vec { - &mut self.msg - } - - // Take field - pub fn take_msg(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.msg, ::std::vec::Vec::new()) - } - - pub fn get_msg(&self) -> &[u8] { - &self.msg - } -} - -impl ::protobuf::Message for PublishBeaconBlockResponse { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_bool()?; - self.success = tmp; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.msg)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.success != false { - my_size += 2; - } - if !self.msg.is_empty() { - my_size += ::protobuf::rt::bytes_size(2, &self.msg); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { - if self.success != false { - os.write_bool(1, self.success)?; - } - if !self.msg.is_empty() { - os.write_bytes(2, &self.msg)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any - } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any - } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> PublishBeaconBlockResponse { - PublishBeaconBlockResponse::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, - }; - unsafe { - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "success", - |m: &PublishBeaconBlockResponse| { &m.success }, - |m: &mut PublishBeaconBlockResponse| { &mut m.success }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "msg", - |m: &PublishBeaconBlockResponse| { &m.msg }, - |m: &mut PublishBeaconBlockResponse| { &mut m.msg }, - )); - ::protobuf::reflect::MessageDescriptor::new::( - "PublishBeaconBlockResponse", - fields, - file_descriptor_proto() - ) - }) - } - } - - fn default_instance() -> &'static PublishBeaconBlockResponse { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const PublishBeaconBlockResponse, - }; - unsafe { - instance.get(PublishBeaconBlockResponse::new) - } - } -} - -impl ::protobuf::Clear for PublishBeaconBlockResponse { - fn clear(&mut self) { - self.clear_success(); - self.clear_msg(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for PublishBeaconBlockResponse { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for PublishBeaconBlockResponse { - fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { - ::protobuf::reflect::ProtobufValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct ValidatorAssignment { - // message oneof groups - pub block_production_slot_oneof: ::std::option::Option, - // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, -} - -#[derive(Clone,PartialEq)] -pub enum ValidatorAssignment_oneof_block_production_slot_oneof { - block_production_slot_none(bool), - block_production_slot(u64), -} - -impl ValidatorAssignment { - pub fn new() -> ValidatorAssignment { - ::std::default::Default::default() - } - - // bool block_production_slot_none = 1; - - pub fn clear_block_production_slot_none(&mut self) { - self.block_production_slot_oneof = ::std::option::Option::None; - } - - pub fn has_block_production_slot_none(&self) -> bool { - match self.block_production_slot_oneof { - ::std::option::Option::Some(ValidatorAssignment_oneof_block_production_slot_oneof::block_production_slot_none(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_block_production_slot_none(&mut self, v: bool) { - self.block_production_slot_oneof = ::std::option::Option::Some(ValidatorAssignment_oneof_block_production_slot_oneof::block_production_slot_none(v)) - } - - pub fn get_block_production_slot_none(&self) -> bool { - match self.block_production_slot_oneof { - ::std::option::Option::Some(ValidatorAssignment_oneof_block_production_slot_oneof::block_production_slot_none(v)) => v, - _ => false, - } - } - - // uint64 block_production_slot = 2; - - pub fn clear_block_production_slot(&mut self) { - self.block_production_slot_oneof = ::std::option::Option::None; - } - - pub fn has_block_production_slot(&self) -> bool { - match self.block_production_slot_oneof { - ::std::option::Option::Some(ValidatorAssignment_oneof_block_production_slot_oneof::block_production_slot(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_block_production_slot(&mut self, v: u64) { - self.block_production_slot_oneof = ::std::option::Option::Some(ValidatorAssignment_oneof_block_production_slot_oneof::block_production_slot(v)) - } - - pub fn get_block_production_slot(&self) -> u64 { - match self.block_production_slot_oneof { - ::std::option::Option::Some(ValidatorAssignment_oneof_block_production_slot_oneof::block_production_slot(v)) => v, - _ => 0, - } - } -} - -impl ::protobuf::Message for ValidatorAssignment { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.block_production_slot_oneof = ::std::option::Option::Some(ValidatorAssignment_oneof_block_production_slot_oneof::block_production_slot_none(is.read_bool()?)); - }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.block_production_slot_oneof = ::std::option::Option::Some(ValidatorAssignment_oneof_block_production_slot_oneof::block_production_slot(is.read_uint64()?)); - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let ::std::option::Option::Some(ref v) = self.block_production_slot_oneof { - match v { - &ValidatorAssignment_oneof_block_production_slot_oneof::block_production_slot_none(v) => { - my_size += 2; - }, - &ValidatorAssignment_oneof_block_production_slot_oneof::block_production_slot(v) => { - my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint); - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { - if let ::std::option::Option::Some(ref v) = self.block_production_slot_oneof { - match v { - &ValidatorAssignment_oneof_block_production_slot_oneof::block_production_slot_none(v) => { - os.write_bool(1, v)?; - }, - &ValidatorAssignment_oneof_block_production_slot_oneof::block_production_slot(v) => { - os.write_uint64(2, v)?; - }, - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any - } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any - } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> ValidatorAssignment { - ValidatorAssignment::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, - }; - unsafe { - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor::<_>( - "block_production_slot_none", - ValidatorAssignment::has_block_production_slot_none, - ValidatorAssignment::get_block_production_slot_none, - )); - fields.push(::protobuf::reflect::accessor::make_singular_u64_accessor::<_>( - "block_production_slot", - ValidatorAssignment::has_block_production_slot, - ValidatorAssignment::get_block_production_slot, - )); - ::protobuf::reflect::MessageDescriptor::new::( - "ValidatorAssignment", - fields, - file_descriptor_proto() - ) - }) - } - } - - fn default_instance() -> &'static ValidatorAssignment { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ValidatorAssignment, - }; - unsafe { - instance.get(ValidatorAssignment::new) - } - } -} - -impl ::protobuf::Clear for ValidatorAssignment { - fn clear(&mut self) { - self.clear_block_production_slot_none(); - self.clear_block_production_slot(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for ValidatorAssignment { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for ValidatorAssignment { - fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { - ::protobuf::reflect::ProtobufValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct ValidatorAssignmentRequest { - // message fields - pub epoch: u64, - pub public_key: ::std::vec::Vec, - // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, -} - -impl ValidatorAssignmentRequest { - pub fn new() -> ValidatorAssignmentRequest { - ::std::default::Default::default() - } - - // uint64 epoch = 1; - - pub fn clear_epoch(&mut self) { - self.epoch = 0; - } - - // Param is passed by value, moved - pub fn set_epoch(&mut self, v: u64) { - self.epoch = v; - } - - pub fn get_epoch(&self) -> u64 { - self.epoch - } - - // bytes public_key = 2; - - pub fn clear_public_key(&mut self) { - self.public_key.clear(); - } - - // Param is passed by value, moved - pub fn set_public_key(&mut self, v: ::std::vec::Vec) { - self.public_key = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_public_key(&mut self) -> &mut ::std::vec::Vec { - &mut self.public_key - } - - // Take field - pub fn take_public_key(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.public_key, ::std::vec::Vec::new()) - } - - pub fn get_public_key(&self) -> &[u8] { - &self.public_key - } -} - -impl ::protobuf::Message for ValidatorAssignmentRequest { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_uint64()?; - self.epoch = tmp; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.public_key)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.epoch != 0 { - my_size += ::protobuf::rt::value_size(1, self.epoch, ::protobuf::wire_format::WireTypeVarint); - } - if !self.public_key.is_empty() { - my_size += ::protobuf::rt::bytes_size(2, &self.public_key); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { - if self.epoch != 0 { - os.write_uint64(1, self.epoch)?; - } - if !self.public_key.is_empty() { - os.write_bytes(2, &self.public_key)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any - } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any - } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> ValidatorAssignmentRequest { - ValidatorAssignmentRequest::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, - }; - unsafe { - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( - "epoch", - |m: &ValidatorAssignmentRequest| { &m.epoch }, - |m: &mut ValidatorAssignmentRequest| { &mut m.epoch }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "public_key", - |m: &ValidatorAssignmentRequest| { &m.public_key }, - |m: &mut ValidatorAssignmentRequest| { &mut m.public_key }, - )); - ::protobuf::reflect::MessageDescriptor::new::( - "ValidatorAssignmentRequest", - fields, - file_descriptor_proto() - ) - }) - } - } - - fn default_instance() -> &'static ValidatorAssignmentRequest { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ValidatorAssignmentRequest, - }; - unsafe { - instance.get(ValidatorAssignmentRequest::new) - } - } -} - -impl ::protobuf::Clear for ValidatorAssignmentRequest { - fn clear(&mut self) { - self.clear_epoch(); - self.clear_public_key(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for ValidatorAssignmentRequest { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for ValidatorAssignmentRequest { - fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { - ::protobuf::reflect::ProtobufValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct ValidatorAssignmentResponse { - // message fields - pub validator_assignment: ::protobuf::SingularPtrField, - // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, -} - -impl ValidatorAssignmentResponse { - pub fn new() -> ValidatorAssignmentResponse { - ::std::default::Default::default() - } - - // .ethereum.beacon.rpc.v1.ValidatorAssignment validator_assignment = 1; - - pub fn clear_validator_assignment(&mut self) { - self.validator_assignment.clear(); - } - - pub fn has_validator_assignment(&self) -> bool { - self.validator_assignment.is_some() - } - - // Param is passed by value, moved - pub fn set_validator_assignment(&mut self, v: ValidatorAssignment) { - self.validator_assignment = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_validator_assignment(&mut self) -> &mut ValidatorAssignment { - if self.validator_assignment.is_none() { - self.validator_assignment.set_default(); - } - self.validator_assignment.as_mut().unwrap() - } - - // Take field - pub fn take_validator_assignment(&mut self) -> ValidatorAssignment { - self.validator_assignment.take().unwrap_or_else(|| ValidatorAssignment::new()) - } - - pub fn get_validator_assignment(&self) -> &ValidatorAssignment { - self.validator_assignment.as_ref().unwrap_or_else(|| ValidatorAssignment::default_instance()) - } -} - -impl ::protobuf::Message for ValidatorAssignmentResponse { - fn is_initialized(&self) -> bool { - for v in &self.validator_assignment { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.validator_assignment)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let Some(ref v) = self.validator_assignment.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { - if let Some(ref v) = self.validator_assignment.as_ref() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any - } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any - } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> ValidatorAssignmentResponse { - ValidatorAssignmentResponse::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, - }; - unsafe { - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "validator_assignment", - |m: &ValidatorAssignmentResponse| { &m.validator_assignment }, - |m: &mut ValidatorAssignmentResponse| { &mut m.validator_assignment }, - )); - ::protobuf::reflect::MessageDescriptor::new::( - "ValidatorAssignmentResponse", - fields, - file_descriptor_proto() - ) - }) - } - } - - fn default_instance() -> &'static ValidatorAssignmentResponse { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ValidatorAssignmentResponse, - }; - unsafe { - instance.get(ValidatorAssignmentResponse::new) - } - } -} - -impl ::protobuf::Clear for ValidatorAssignmentResponse { - fn clear(&mut self) { - self.clear_validator_assignment(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for ValidatorAssignmentResponse { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for ValidatorAssignmentResponse { - fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { - ::protobuf::reflect::ProtobufValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x0eservices.proto\x12\x16ethereum.beacon.rpc.v1\"\x83\x01\n\x0bBeacon\ - Block\x12\x12\n\x04slot\x18\x01\x20\x01(\x04R\x04slot\x12\x1d\n\nblock_r\ - oot\x18\x02\x20\x01(\x0cR\tblockRoot\x12#\n\rrandao_reveal\x18\x03\x20\ - \x01(\x0cR\x0crandaoReveal\x12\x1c\n\tsignature\x18\x04\x20\x01(\x0cR\ts\ - ignature\"/\n\x19ProduceBeaconBlockRequest\x12\x12\n\x04slot\x18\x01\x20\ - \x01(\x04R\x04slot\"W\n\x1aProduceBeaconBlockResponse\x129\n\x05block\ - \x18\x01\x20\x01(\x0b2#.ethereum.beacon.rpc.v1.BeaconBlockR\x05block\"V\ - \n\x19PublishBeaconBlockRequest\x129\n\x05block\x18\x01\x20\x01(\x0b2#.e\ - thereum.beacon.rpc.v1.BeaconBlockR\x05block\"H\n\x1aPublishBeaconBlockRe\ - sponse\x12\x18\n\x07success\x18\x01\x20\x01(\x08R\x07success\x12\x10\n\ - \x03msg\x18\x02\x20\x01(\x0cR\x03msg\"\xa9\x01\n\x13ValidatorAssignment\ - \x12=\n\x1ablock_production_slot_none\x18\x01\x20\x01(\x08H\0R\x17blockP\ - roductionSlotNone\x124\n\x15block_production_slot\x18\x02\x20\x01(\x04H\ - \0R\x13blockProductionSlotB\x1d\n\x1bblock_production_slot_oneof\"Q\n\ - \x1aValidatorAssignmentRequest\x12\x14\n\x05epoch\x18\x01\x20\x01(\x04R\ - \x05epoch\x12\x1d\n\npublic_key\x18\x02\x20\x01(\x0cR\tpublicKey\"}\n\ - \x1bValidatorAssignmentResponse\x12^\n\x14validator_assignment\x18\x01\ - \x20\x01(\x0b2+.ethereum.beacon.rpc.v1.ValidatorAssignmentR\x13validator\ - Assignment2\x8e\x03\n\x12BeaconBlockService\x12{\n\x12ProduceBeaconBlock\ - \x121.ethereum.beacon.rpc.v1.ProduceBeaconBlockRequest\x1a2.ethereum.bea\ - con.rpc.v1.ProduceBeaconBlockResponse\x12{\n\x12PublishBeaconBlock\x121.\ - ethereum.beacon.rpc.v1.PublishBeaconBlockRequest\x1a2.ethereum.beacon.rp\ - c.v1.PublishBeaconBlockResponse\x12~\n\x13ValidatorAssignment\x122.ether\ - eum.beacon.rpc.v1.ValidatorAssignmentRequest\x1a3.ethereum.beacon.rpc.v1\ - .ValidatorAssignmentResponseb\x06proto3\ -"; - -static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, -}; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - unsafe { - file_descriptor_proto_lazy.get(|| { - parse_descriptor_proto() - }) - } -} diff --git a/protos/src/services_grpc.rs b/protos/src/services_grpc.rs deleted file mode 100644 index 2103f73c4..000000000 --- a/protos/src/services_grpc.rs +++ /dev/null @@ -1,127 +0,0 @@ -// This file is generated. Do not edit -// @generated - -// https://github.com/Manishearth/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy)] - -#![cfg_attr(rustfmt, rustfmt_skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unsafe_code)] -#![allow(unused_imports)] -#![allow(unused_results)] - -const METHOD_BEACON_BLOCK_SERVICE_PRODUCE_BEACON_BLOCK: ::grpcio::Method = ::grpcio::Method { - ty: ::grpcio::MethodType::Unary, - name: "/ethereum.beacon.rpc.v1.BeaconBlockService/ProduceBeaconBlock", - req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de }, - resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de }, -}; - -const METHOD_BEACON_BLOCK_SERVICE_PUBLISH_BEACON_BLOCK: ::grpcio::Method = ::grpcio::Method { - ty: ::grpcio::MethodType::Unary, - name: "/ethereum.beacon.rpc.v1.BeaconBlockService/PublishBeaconBlock", - req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de }, - resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de }, -}; - -const METHOD_BEACON_BLOCK_SERVICE_VALIDATOR_ASSIGNMENT: ::grpcio::Method = ::grpcio::Method { - ty: ::grpcio::MethodType::Unary, - name: "/ethereum.beacon.rpc.v1.BeaconBlockService/ValidatorAssignment", - req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de }, - resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de }, -}; - -#[derive(Clone)] -pub struct BeaconBlockServiceClient { - client: ::grpcio::Client, -} - -impl BeaconBlockServiceClient { - pub fn new(channel: ::grpcio::Channel) -> Self { - BeaconBlockServiceClient { - client: ::grpcio::Client::new(channel), - } - } - - pub fn produce_beacon_block_opt(&self, req: &super::services::ProduceBeaconBlockRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result { - self.client.unary_call(&METHOD_BEACON_BLOCK_SERVICE_PRODUCE_BEACON_BLOCK, req, opt) - } - - pub fn produce_beacon_block(&self, req: &super::services::ProduceBeaconBlockRequest) -> ::grpcio::Result { - self.produce_beacon_block_opt(req, ::grpcio::CallOption::default()) - } - - pub fn produce_beacon_block_async_opt(&self, req: &super::services::ProduceBeaconBlockRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { - self.client.unary_call_async(&METHOD_BEACON_BLOCK_SERVICE_PRODUCE_BEACON_BLOCK, req, opt) - } - - pub fn produce_beacon_block_async(&self, req: &super::services::ProduceBeaconBlockRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { - self.produce_beacon_block_async_opt(req, ::grpcio::CallOption::default()) - } - - pub fn publish_beacon_block_opt(&self, req: &super::services::PublishBeaconBlockRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result { - self.client.unary_call(&METHOD_BEACON_BLOCK_SERVICE_PUBLISH_BEACON_BLOCK, req, opt) - } - - pub fn publish_beacon_block(&self, req: &super::services::PublishBeaconBlockRequest) -> ::grpcio::Result { - self.publish_beacon_block_opt(req, ::grpcio::CallOption::default()) - } - - pub fn publish_beacon_block_async_opt(&self, req: &super::services::PublishBeaconBlockRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { - self.client.unary_call_async(&METHOD_BEACON_BLOCK_SERVICE_PUBLISH_BEACON_BLOCK, req, opt) - } - - pub fn publish_beacon_block_async(&self, req: &super::services::PublishBeaconBlockRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { - self.publish_beacon_block_async_opt(req, ::grpcio::CallOption::default()) - } - - pub fn validator_assignment_opt(&self, req: &super::services::ValidatorAssignmentRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result { - self.client.unary_call(&METHOD_BEACON_BLOCK_SERVICE_VALIDATOR_ASSIGNMENT, req, opt) - } - - pub fn validator_assignment(&self, req: &super::services::ValidatorAssignmentRequest) -> ::grpcio::Result { - self.validator_assignment_opt(req, ::grpcio::CallOption::default()) - } - - pub fn validator_assignment_async_opt(&self, req: &super::services::ValidatorAssignmentRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { - self.client.unary_call_async(&METHOD_BEACON_BLOCK_SERVICE_VALIDATOR_ASSIGNMENT, req, opt) - } - - pub fn validator_assignment_async(&self, req: &super::services::ValidatorAssignmentRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { - self.validator_assignment_async_opt(req, ::grpcio::CallOption::default()) - } - pub fn spawn(&self, f: F) where F: ::futures::Future + Send + 'static { - self.client.spawn(f) - } -} - -pub trait BeaconBlockService { - fn produce_beacon_block(&mut self, ctx: ::grpcio::RpcContext, req: super::services::ProduceBeaconBlockRequest, sink: ::grpcio::UnarySink); - fn publish_beacon_block(&mut self, ctx: ::grpcio::RpcContext, req: super::services::PublishBeaconBlockRequest, sink: ::grpcio::UnarySink); - fn validator_assignment(&mut self, ctx: ::grpcio::RpcContext, req: super::services::ValidatorAssignmentRequest, sink: ::grpcio::UnarySink); -} - -pub fn create_beacon_block_service(s: S) -> ::grpcio::Service { - let mut builder = ::grpcio::ServiceBuilder::new(); - let mut instance = s.clone(); - builder = builder.add_unary_handler(&METHOD_BEACON_BLOCK_SERVICE_PRODUCE_BEACON_BLOCK, move |ctx, req, resp| { - instance.produce_beacon_block(ctx, req, resp) - }); - let mut instance = s.clone(); - builder = builder.add_unary_handler(&METHOD_BEACON_BLOCK_SERVICE_PUBLISH_BEACON_BLOCK, move |ctx, req, resp| { - instance.publish_beacon_block(ctx, req, resp) - }); - let mut instance = s.clone(); - builder = builder.add_unary_handler(&METHOD_BEACON_BLOCK_SERVICE_VALIDATOR_ASSIGNMENT, move |ctx, req, resp| { - instance.validator_assignment(ctx, req, resp) - }); - builder.build() -}