catalyst_protocol_sdk_rust/
Network.rs1#![allow(unknown_lints)]
6#![allow(clippy::all)]
7
8#![cfg_attr(rustfmt, rustfmt_skip)]
9
10#![allow(box_pointers)]
11#![allow(dead_code)]
12#![allow(missing_docs)]
13#![allow(non_camel_case_types)]
14#![allow(non_snake_case)]
15#![allow(non_upper_case_globals)]
16#![allow(trivial_casts)]
17#![allow(unsafe_code)]
18#![allow(unused_imports)]
19#![allow(unused_results)]
20use protobuf::Message as Message_imported_for_functions;
23use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
24
25const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_10_0;
28
29#[derive(Clone,PartialEq,Eq,Debug,Hash)]
30pub enum NetworkType {
31 NETWORK_TYPE_UNKNOWN = 0,
32 MAINNET = 1,
33 DEVNET = 2,
34 TESTNET = 3,
35}
36
37impl ::protobuf::ProtobufEnum for NetworkType {
38 fn value(&self) -> i32 {
39 *self as i32
40 }
41
42 fn from_i32(value: i32) -> ::std::option::Option<NetworkType> {
43 match value {
44 0 => ::std::option::Option::Some(NetworkType::NETWORK_TYPE_UNKNOWN),
45 1 => ::std::option::Option::Some(NetworkType::MAINNET),
46 2 => ::std::option::Option::Some(NetworkType::DEVNET),
47 3 => ::std::option::Option::Some(NetworkType::TESTNET),
48 _ => ::std::option::Option::None
49 }
50 }
51
52 fn values() -> &'static [Self] {
53 static values: &'static [NetworkType] = &[
54 NetworkType::NETWORK_TYPE_UNKNOWN,
55 NetworkType::MAINNET,
56 NetworkType::DEVNET,
57 NetworkType::TESTNET,
58 ];
59 values
60 }
61
62 fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
63 static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
64 lock: ::protobuf::lazy::ONCE_INIT,
65 ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
66 };
67 unsafe {
68 descriptor.get(|| {
69 ::protobuf::reflect::EnumDescriptor::new("NetworkType", file_descriptor_proto())
70 })
71 }
72 }
73}
74
75impl ::std::marker::Copy for NetworkType {
76}
77
78impl ::std::default::Default for NetworkType {
79 fn default() -> Self {
80 NetworkType::NETWORK_TYPE_UNKNOWN
81 }
82}
83
84impl ::protobuf::reflect::ProtobufValue for NetworkType {
85 fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
86 ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
87 }
88}
89
90static file_descriptor_proto_data: &'static [u8] = b"\
91 \n\rNetwork.proto\x12\x19Catalyst.Protocol.Network*M\n\x0bNetworkType\
92 \x12\x18\n\x14NETWORK_TYPE_UNKNOWN\x10\0\x12\x0b\n\x07MAINNET\x10\x01\
93 \x12\n\n\x06DEVNET\x10\x02\x12\x0b\n\x07TESTNET\x10\x03B\x02P\x01J\xcd\t\
94 \n\x06\x12\x04\x13\0\x1e\x01\n\xdf\x06\n\x01\x0c\x12\x03\x13\0\x122\xd4\
95 \x06*\n\x20Copyright\x20(c)\x202019\x20Catalyst\x20Network\n\n\x20This\
96 \x20file\x20is\x20part\x20of\x20Catalyst.Network.Protocol.Protobuffs\x20\
97 <https://github.com/catalyst-network/protocol-protobuffs>\n\n\x20Catalys\
98 t.Network.Protocol.Protobuffs\x20is\x20free\x20software:\x20you\x20can\
99 \x20redistribute\x20it\x20and/or\x20modify\n\x20it\x20under\x20the\x20te\
100 rms\x20of\x20the\x20GNU\x20General\x20Public\x20License\x20as\x20publish\
101 ed\x20by\n\x20the\x20Free\x20Software\x20Foundation,\x20either\x20versio\
102 n\x202\x20of\x20the\x20License,\x20or\n\x20(at\x20your\x20option)\x20any\
103 \x20later\x20version.\n\x20\n\x20Catalyst.Network.Protocol.Protobuffs\
104 \x20is\x20distributed\x20in\x20the\x20hope\x20that\x20it\x20will\x20be\
105 \x20useful,\n\x20but\x20WITHOUT\x20ANY\x20WARRANTY;\x20without\x20even\
106 \x20the\x20implied\x20warranty\x20of\n\x20MERCHANTABILITY\x20or\x20FITNE\
107 SS\x20FOR\x20A\x20PARTICULAR\x20PURPOSE.\x20See\x20the\n\x20GNU\x20Gener\
108 al\x20Public\x20License\x20for\x20more\x20details.\n\x20\n\x20You\x20sho\
109 uld\x20have\x20received\x20a\x20copy\x20of\x20the\x20GNU\x20General\x20P\
110 ublic\x20License\n\x20along\x20with\x20Catalyst.Network.Protocol.Protobu\
111 ffs\x20If\x20not,\x20see\x20<https://www.gnu.org/licenses/>.\n\n\x08\n\
112 \x01\x08\x12\x03\x15\0\"\n\x0b\n\x04\x08\xe7\x07\0\x12\x03\x15\0\"\n\x0c\
113 \n\x05\x08\xe7\x07\0\x02\x12\x03\x15\x07\x1a\n\r\n\x06\x08\xe7\x07\0\x02\
114 \0\x12\x03\x15\x07\x1a\n\x0e\n\x07\x08\xe7\x07\0\x02\0\x01\x12\x03\x15\
115 \x07\x1a\n\x0c\n\x05\x08\xe7\x07\0\x03\x12\x03\x15\x1d!\n\x08\n\x01\x02\
116 \x12\x03\x17\x08!\n\n\n\x02\x05\0\x12\x04\x19\0\x1e\x01\n\n\n\x03\x05\0\
117 \x01\x12\x03\x19\x05\x10\n\x1f\n\x04\x05\0\x02\0\x12\x03\x1a\x04\x1d\"\
118 \x12\x20un-known\x20network\n\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x1a\
119 \x04\x18\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x1a\x1b\x1c\n\x20\n\x04\x05\
120 \0\x02\x01\x12\x03\x1b\x04\x10\"\x13\x20main\x20live\x20network\n\n\x0c\
121 \n\x05\x05\0\x02\x01\x01\x12\x03\x1b\x04\x0b\n\x0c\n\x05\x05\0\x02\x01\
122 \x02\x12\x03\x1b\x0e\x0f\n\x1b\n\x04\x05\0\x02\x02\x12\x03\x1c\x04\x0f\"\
123 \x0e\x20local\x20devnet\n\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\x1c\x04\
124 \n\n\x0c\n\x05\x05\0\x02\x02\x02\x12\x03\x1c\r\x0e\n\x1d\n\x04\x05\0\x02\
125 \x03\x12\x03\x1d\x04\x10\"\x10\x20public\x20testnet\n\n\x0c\n\x05\x05\0\
126 \x02\x03\x01\x12\x03\x1d\x04\x0b\n\x0c\n\x05\x05\0\x02\x03\x02\x12\x03\
127 \x1d\x0e\x0fb\x06proto3\
128";
129
130static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
131 lock: ::protobuf::lazy::ONCE_INIT,
132 ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
133};
134
135fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
136 ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
137}
138
139pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
140 unsafe {
141 file_descriptor_proto_lazy.get(|| {
142 parse_descriptor_proto()
143 })
144 }
145}