github.com/igggame/nebulas-go@v2.1.0+incompatible/nbre/fs/proto/block.pb.cc (about) 1 // Generated by the protocol buffer compiler. DO NOT EDIT! 2 // source: block.proto 3 4 #include "block.pb.h" 5 6 #include <algorithm> 7 8 #include <google/protobuf/stubs/common.h> 9 #include <google/protobuf/stubs/port.h> 10 #include <google/protobuf/io/coded_stream.h> 11 #include <google/protobuf/wire_format_lite_inl.h> 12 #include <google/protobuf/descriptor.h> 13 #include <google/protobuf/generated_message_reflection.h> 14 #include <google/protobuf/reflection_ops.h> 15 #include <google/protobuf/wire_format.h> 16 // This is a temporary google only hack 17 #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS 18 #include "third_party/protobuf/version.h" 19 #endif 20 // @@protoc_insertion_point(includes) 21 22 namespace protobuf_block_2eproto { 23 extern PROTOBUF_INTERNAL_EXPORT_protobuf_block_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ContractMeta; 24 extern PROTOBUF_INTERNAL_EXPORT_protobuf_block_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Data; 25 extern PROTOBUF_INTERNAL_EXPORT_protobuf_block_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Random; 26 extern PROTOBUF_INTERNAL_EXPORT_protobuf_block_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Transaction; 27 extern PROTOBUF_INTERNAL_EXPORT_protobuf_block_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_BlockHeader; 28 extern PROTOBUF_INTERNAL_EXPORT_protobuf_block_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_Block; 29 } // namespace protobuf_block_2eproto 30 namespace protobuf_dag_2eproto { 31 extern PROTOBUF_INTERNAL_EXPORT_protobuf_dag_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Dag; 32 } // namespace protobuf_dag_2eproto 33 namespace protobuf_state_2eproto { 34 extern PROTOBUF_INTERNAL_EXPORT_protobuf_state_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ConsensusRoot; 35 } // namespace protobuf_state_2eproto 36 namespace corepb { 37 class AccountDefaultTypeInternal { 38 public: 39 ::google::protobuf::internal::ExplicitlyConstructed<Account> 40 _instance; 41 } _Account_default_instance_; 42 class ContractMetaDefaultTypeInternal { 43 public: 44 ::google::protobuf::internal::ExplicitlyConstructed<ContractMeta> 45 _instance; 46 } _ContractMeta_default_instance_; 47 class DataDefaultTypeInternal { 48 public: 49 ::google::protobuf::internal::ExplicitlyConstructed<Data> 50 _instance; 51 } _Data_default_instance_; 52 class TransactionDefaultTypeInternal { 53 public: 54 ::google::protobuf::internal::ExplicitlyConstructed<Transaction> 55 _instance; 56 } _Transaction_default_instance_; 57 class BlockHeaderDefaultTypeInternal { 58 public: 59 ::google::protobuf::internal::ExplicitlyConstructed<BlockHeader> 60 _instance; 61 } _BlockHeader_default_instance_; 62 class BlockDefaultTypeInternal { 63 public: 64 ::google::protobuf::internal::ExplicitlyConstructed<Block> 65 _instance; 66 } _Block_default_instance_; 67 class NetBlocksDefaultTypeInternal { 68 public: 69 ::google::protobuf::internal::ExplicitlyConstructed<NetBlocks> 70 _instance; 71 } _NetBlocks_default_instance_; 72 class NetBlockDefaultTypeInternal { 73 public: 74 ::google::protobuf::internal::ExplicitlyConstructed<NetBlock> 75 _instance; 76 } _NetBlock_default_instance_; 77 class DownloadBlockDefaultTypeInternal { 78 public: 79 ::google::protobuf::internal::ExplicitlyConstructed<DownloadBlock> 80 _instance; 81 } _DownloadBlock_default_instance_; 82 class RandomDefaultTypeInternal { 83 public: 84 ::google::protobuf::internal::ExplicitlyConstructed<Random> 85 _instance; 86 } _Random_default_instance_; 87 } // namespace corepb 88 namespace protobuf_block_2eproto { 89 static void InitDefaultsAccount() { 90 GOOGLE_PROTOBUF_VERIFY_VERSION; 91 92 { 93 void* ptr = &::corepb::_Account_default_instance_; 94 new (ptr) ::corepb::Account(); 95 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); 96 } 97 ::corepb::Account::InitAsDefaultInstance(); 98 } 99 100 ::google::protobuf::internal::SCCInfo<1> scc_info_Account = 101 {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsAccount}, { 102 &protobuf_block_2eproto::scc_info_ContractMeta.base,}}; 103 104 static void InitDefaultsContractMeta() { 105 GOOGLE_PROTOBUF_VERIFY_VERSION; 106 107 { 108 void* ptr = &::corepb::_ContractMeta_default_instance_; 109 new (ptr) ::corepb::ContractMeta(); 110 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); 111 } 112 ::corepb::ContractMeta::InitAsDefaultInstance(); 113 } 114 115 ::google::protobuf::internal::SCCInfo<0> scc_info_ContractMeta = 116 {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsContractMeta}, {}}; 117 118 static void InitDefaultsData() { 119 GOOGLE_PROTOBUF_VERIFY_VERSION; 120 121 { 122 void* ptr = &::corepb::_Data_default_instance_; 123 new (ptr) ::corepb::Data(); 124 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); 125 } 126 ::corepb::Data::InitAsDefaultInstance(); 127 } 128 129 ::google::protobuf::internal::SCCInfo<0> scc_info_Data = 130 {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsData}, {}}; 131 132 static void InitDefaultsTransaction() { 133 GOOGLE_PROTOBUF_VERIFY_VERSION; 134 135 { 136 void* ptr = &::corepb::_Transaction_default_instance_; 137 new (ptr) ::corepb::Transaction(); 138 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); 139 } 140 ::corepb::Transaction::InitAsDefaultInstance(); 141 } 142 143 ::google::protobuf::internal::SCCInfo<1> scc_info_Transaction = 144 {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTransaction}, { 145 &protobuf_block_2eproto::scc_info_Data.base,}}; 146 147 static void InitDefaultsBlockHeader() { 148 GOOGLE_PROTOBUF_VERIFY_VERSION; 149 150 { 151 void* ptr = &::corepb::_BlockHeader_default_instance_; 152 new (ptr) ::corepb::BlockHeader(); 153 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); 154 } 155 ::corepb::BlockHeader::InitAsDefaultInstance(); 156 } 157 158 ::google::protobuf::internal::SCCInfo<2> scc_info_BlockHeader = 159 {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsBlockHeader}, { 160 &protobuf_state_2eproto::scc_info_ConsensusRoot.base, 161 &protobuf_block_2eproto::scc_info_Random.base,}}; 162 163 static void InitDefaultsBlock() { 164 GOOGLE_PROTOBUF_VERIFY_VERSION; 165 166 { 167 void* ptr = &::corepb::_Block_default_instance_; 168 new (ptr) ::corepb::Block(); 169 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); 170 } 171 ::corepb::Block::InitAsDefaultInstance(); 172 } 173 174 ::google::protobuf::internal::SCCInfo<3> scc_info_Block = 175 {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsBlock}, { 176 &protobuf_block_2eproto::scc_info_BlockHeader.base, 177 &protobuf_block_2eproto::scc_info_Transaction.base, 178 &protobuf_dag_2eproto::scc_info_Dag.base,}}; 179 180 static void InitDefaultsNetBlocks() { 181 GOOGLE_PROTOBUF_VERIFY_VERSION; 182 183 { 184 void* ptr = &::corepb::_NetBlocks_default_instance_; 185 new (ptr) ::corepb::NetBlocks(); 186 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); 187 } 188 ::corepb::NetBlocks::InitAsDefaultInstance(); 189 } 190 191 ::google::protobuf::internal::SCCInfo<1> scc_info_NetBlocks = 192 {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsNetBlocks}, { 193 &protobuf_block_2eproto::scc_info_Block.base,}}; 194 195 static void InitDefaultsNetBlock() { 196 GOOGLE_PROTOBUF_VERIFY_VERSION; 197 198 { 199 void* ptr = &::corepb::_NetBlock_default_instance_; 200 new (ptr) ::corepb::NetBlock(); 201 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); 202 } 203 ::corepb::NetBlock::InitAsDefaultInstance(); 204 } 205 206 ::google::protobuf::internal::SCCInfo<1> scc_info_NetBlock = 207 {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsNetBlock}, { 208 &protobuf_block_2eproto::scc_info_Block.base,}}; 209 210 static void InitDefaultsDownloadBlock() { 211 GOOGLE_PROTOBUF_VERIFY_VERSION; 212 213 { 214 void* ptr = &::corepb::_DownloadBlock_default_instance_; 215 new (ptr) ::corepb::DownloadBlock(); 216 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); 217 } 218 ::corepb::DownloadBlock::InitAsDefaultInstance(); 219 } 220 221 ::google::protobuf::internal::SCCInfo<0> scc_info_DownloadBlock = 222 {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDownloadBlock}, {}}; 223 224 static void InitDefaultsRandom() { 225 GOOGLE_PROTOBUF_VERIFY_VERSION; 226 227 { 228 void* ptr = &::corepb::_Random_default_instance_; 229 new (ptr) ::corepb::Random(); 230 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); 231 } 232 ::corepb::Random::InitAsDefaultInstance(); 233 } 234 235 ::google::protobuf::internal::SCCInfo<0> scc_info_Random = 236 {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsRandom}, {}}; 237 238 void InitDefaults() { 239 ::google::protobuf::internal::InitSCC(&scc_info_Account.base); 240 ::google::protobuf::internal::InitSCC(&scc_info_ContractMeta.base); 241 ::google::protobuf::internal::InitSCC(&scc_info_Data.base); 242 ::google::protobuf::internal::InitSCC(&scc_info_Transaction.base); 243 ::google::protobuf::internal::InitSCC(&scc_info_BlockHeader.base); 244 ::google::protobuf::internal::InitSCC(&scc_info_Block.base); 245 ::google::protobuf::internal::InitSCC(&scc_info_NetBlocks.base); 246 ::google::protobuf::internal::InitSCC(&scc_info_NetBlock.base); 247 ::google::protobuf::internal::InitSCC(&scc_info_DownloadBlock.base); 248 ::google::protobuf::internal::InitSCC(&scc_info_Random.base); 249 } 250 251 ::google::protobuf::Metadata file_level_metadata[10]; 252 253 const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { 254 ~0u, // no _has_bits_ 255 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Account, _internal_metadata_), 256 ~0u, // no _extensions_ 257 ~0u, // no _oneof_case_ 258 ~0u, // no _weak_field_map_ 259 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Account, address_), 260 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Account, balance_), 261 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Account, nonce_), 262 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Account, vars_hash_), 263 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Account, birth_place_), 264 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Account, contract_meta_), 265 ~0u, // no _has_bits_ 266 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::ContractMeta, _internal_metadata_), 267 ~0u, // no _extensions_ 268 ~0u, // no _oneof_case_ 269 ~0u, // no _weak_field_map_ 270 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::ContractMeta, version_), 271 ~0u, // no _has_bits_ 272 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Data, _internal_metadata_), 273 ~0u, // no _extensions_ 274 ~0u, // no _oneof_case_ 275 ~0u, // no _weak_field_map_ 276 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Data, type_), 277 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Data, payload_), 278 ~0u, // no _has_bits_ 279 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Transaction, _internal_metadata_), 280 ~0u, // no _extensions_ 281 ~0u, // no _oneof_case_ 282 ~0u, // no _weak_field_map_ 283 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Transaction, hash_), 284 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Transaction, from_), 285 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Transaction, to_), 286 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Transaction, value_), 287 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Transaction, nonce_), 288 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Transaction, timestamp_), 289 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Transaction, data_), 290 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Transaction, chain_id_), 291 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Transaction, gas_price_), 292 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Transaction, gas_limit_), 293 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Transaction, alg_), 294 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Transaction, sign_), 295 ~0u, // no _has_bits_ 296 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::BlockHeader, _internal_metadata_), 297 ~0u, // no _extensions_ 298 ~0u, // no _oneof_case_ 299 ~0u, // no _weak_field_map_ 300 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::BlockHeader, hash_), 301 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::BlockHeader, parent_hash_), 302 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::BlockHeader, coinbase_), 303 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::BlockHeader, timestamp_), 304 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::BlockHeader, chain_id_), 305 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::BlockHeader, alg_), 306 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::BlockHeader, sign_), 307 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::BlockHeader, state_root_), 308 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::BlockHeader, txs_root_), 309 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::BlockHeader, events_root_), 310 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::BlockHeader, consensus_root_), 311 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::BlockHeader, random_), 312 ~0u, // no _has_bits_ 313 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Block, _internal_metadata_), 314 ~0u, // no _extensions_ 315 ~0u, // no _oneof_case_ 316 ~0u, // no _weak_field_map_ 317 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Block, header_), 318 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Block, transactions_), 319 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Block, dependency_), 320 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Block, height_), 321 ~0u, // no _has_bits_ 322 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::NetBlocks, _internal_metadata_), 323 ~0u, // no _extensions_ 324 ~0u, // no _oneof_case_ 325 ~0u, // no _weak_field_map_ 326 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::NetBlocks, from_), 327 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::NetBlocks, batch_), 328 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::NetBlocks, blocks_), 329 ~0u, // no _has_bits_ 330 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::NetBlock, _internal_metadata_), 331 ~0u, // no _extensions_ 332 ~0u, // no _oneof_case_ 333 ~0u, // no _weak_field_map_ 334 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::NetBlock, from_), 335 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::NetBlock, batch_), 336 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::NetBlock, block_), 337 ~0u, // no _has_bits_ 338 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::DownloadBlock, _internal_metadata_), 339 ~0u, // no _extensions_ 340 ~0u, // no _oneof_case_ 341 ~0u, // no _weak_field_map_ 342 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::DownloadBlock, hash_), 343 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::DownloadBlock, sign_), 344 ~0u, // no _has_bits_ 345 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Random, _internal_metadata_), 346 ~0u, // no _extensions_ 347 ~0u, // no _oneof_case_ 348 ~0u, // no _weak_field_map_ 349 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Random, vrf_seed_), 350 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::corepb::Random, vrf_proof_), 351 }; 352 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { 353 { 0, -1, sizeof(::corepb::Account)}, 354 { 11, -1, sizeof(::corepb::ContractMeta)}, 355 { 17, -1, sizeof(::corepb::Data)}, 356 { 24, -1, sizeof(::corepb::Transaction)}, 357 { 41, -1, sizeof(::corepb::BlockHeader)}, 358 { 58, -1, sizeof(::corepb::Block)}, 359 { 67, -1, sizeof(::corepb::NetBlocks)}, 360 { 75, -1, sizeof(::corepb::NetBlock)}, 361 { 83, -1, sizeof(::corepb::DownloadBlock)}, 362 { 90, -1, sizeof(::corepb::Random)}, 363 }; 364 365 static ::google::protobuf::Message const * const file_default_instances[] = { 366 reinterpret_cast<const ::google::protobuf::Message*>(&::corepb::_Account_default_instance_), 367 reinterpret_cast<const ::google::protobuf::Message*>(&::corepb::_ContractMeta_default_instance_), 368 reinterpret_cast<const ::google::protobuf::Message*>(&::corepb::_Data_default_instance_), 369 reinterpret_cast<const ::google::protobuf::Message*>(&::corepb::_Transaction_default_instance_), 370 reinterpret_cast<const ::google::protobuf::Message*>(&::corepb::_BlockHeader_default_instance_), 371 reinterpret_cast<const ::google::protobuf::Message*>(&::corepb::_Block_default_instance_), 372 reinterpret_cast<const ::google::protobuf::Message*>(&::corepb::_NetBlocks_default_instance_), 373 reinterpret_cast<const ::google::protobuf::Message*>(&::corepb::_NetBlock_default_instance_), 374 reinterpret_cast<const ::google::protobuf::Message*>(&::corepb::_DownloadBlock_default_instance_), 375 reinterpret_cast<const ::google::protobuf::Message*>(&::corepb::_Random_default_instance_), 376 }; 377 378 void protobuf_AssignDescriptors() { 379 AddDescriptors(); 380 AssignDescriptors( 381 "block.proto", schemas, file_default_instances, TableStruct::offsets, 382 file_level_metadata, NULL, NULL); 383 } 384 385 void protobuf_AssignDescriptorsOnce() { 386 static ::google::protobuf::internal::once_flag once; 387 ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); 388 } 389 390 void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; 391 void protobuf_RegisterTypes(const ::std::string&) { 392 protobuf_AssignDescriptorsOnce(); 393 ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 10); 394 } 395 396 void AddDescriptorsImpl() { 397 InitDefaults(); 398 static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { 399 "\n\013block.proto\022\006corepb\032\tdag.proto\032\013state." 400 "proto\"\217\001\n\007Account\022\017\n\007address\030\001 \001(\014\022\017\n\007ba" 401 "lance\030\002 \001(\014\022\r\n\005nonce\030\003 \001(\004\022\021\n\tvars_hash\030" 402 "\004 \001(\014\022\023\n\013birth_place\030\005 \001(\014\022+\n\rcontract_m" 403 "eta\030\006 \001(\0132\024.corepb.ContractMeta\"\037\n\014Contr" 404 "actMeta\022\017\n\007version\030\001 \001(\t\"%\n\004Data\022\014\n\004type" 405 "\030\001 \001(\t\022\017\n\007payload\030\002 \001(\014\"\325\001\n\013Transaction\022" 406 "\014\n\004hash\030\001 \001(\014\022\014\n\004from\030\002 \001(\014\022\n\n\002to\030\003 \001(\014\022" 407 "\r\n\005value\030\004 \001(\014\022\r\n\005nonce\030\005 \001(\004\022\021\n\ttimesta" 408 "mp\030\006 \001(\003\022\032\n\004data\030\007 \001(\0132\014.corepb.Data\022\020\n\010" 409 "chain_id\030\010 \001(\r\022\021\n\tgas_price\030\t \001(\014\022\021\n\tgas" 410 "_limit\030\n \001(\014\022\013\n\003alg\030\013 \001(\r\022\014\n\004sign\030\014 \001(\014\"" 411 "\227\002\n\013BlockHeader\022\014\n\004hash\030\001 \001(\014\022\023\n\013parent_" 412 "hash\030\002 \001(\014\022\020\n\010coinbase\030\004 \001(\014\022\021\n\ttimestam" 413 "p\030\005 \001(\003\022\020\n\010chain_id\030\006 \001(\r\022\013\n\003alg\030\007 \001(\r\022\014" 414 "\n\004sign\030\010 \001(\014\022\022\n\nstate_root\030\t \001(\014\022\020\n\010txs_" 415 "root\030\n \001(\014\022\023\n\013events_root\030\013 \001(\014\0222\n\016conse" 416 "nsus_root\030\014 \001(\0132\032.consensuspb.ConsensusR" 417 "oot\022\036\n\006random\030\r \001(\0132\016.corepb.RandomJ\004\010\003\020" 418 "\004\"\207\001\n\005Block\022#\n\006header\030\001 \001(\0132\023.corepb.Blo" 419 "ckHeader\022)\n\014transactions\030\002 \003(\0132\023.corepb." 420 "Transaction\022\036\n\ndependency\030\003 \001(\0132\n.dagpb." 421 "Dag\022\016\n\006height\030\004 \001(\004\"G\n\tNetBlocks\022\014\n\004from" 422 "\030\001 \001(\t\022\r\n\005batch\030\002 \001(\004\022\035\n\006blocks\030\003 \003(\0132\r." 423 "corepb.Block\"E\n\010NetBlock\022\014\n\004from\030\001 \001(\t\022\r" 424 "\n\005batch\030\002 \001(\004\022\034\n\005block\030\003 \001(\0132\r.corepb.Bl" 425 "ock\"+\n\rDownloadBlock\022\014\n\004hash\030\001 \001(\014\022\014\n\004si" 426 "gn\030\002 \001(\014\"-\n\006Random\022\020\n\010vrf_seed\030\001 \001(\014\022\021\n\t" 427 "vrf_proof\030\002 \001(\014b\006proto3" 428 }; 429 ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( 430 descriptor, 1143); 431 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( 432 "block.proto", &protobuf_RegisterTypes); 433 ::protobuf_dag_2eproto::AddDescriptors(); 434 ::protobuf_state_2eproto::AddDescriptors(); 435 } 436 437 void AddDescriptors() { 438 static ::google::protobuf::internal::once_flag once; 439 ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); 440 } 441 // Force AddDescriptors() to be called at dynamic initialization time. 442 struct StaticDescriptorInitializer { 443 StaticDescriptorInitializer() { 444 AddDescriptors(); 445 } 446 } static_descriptor_initializer; 447 } // namespace protobuf_block_2eproto 448 namespace corepb { 449 450 // =================================================================== 451 452 void Account::InitAsDefaultInstance() { 453 ::corepb::_Account_default_instance_._instance.get_mutable()->contract_meta_ = const_cast< ::corepb::ContractMeta*>( 454 ::corepb::ContractMeta::internal_default_instance()); 455 } 456 #if !defined(_MSC_VER) || _MSC_VER >= 1900 457 const int Account::kAddressFieldNumber; 458 const int Account::kBalanceFieldNumber; 459 const int Account::kNonceFieldNumber; 460 const int Account::kVarsHashFieldNumber; 461 const int Account::kBirthPlaceFieldNumber; 462 const int Account::kContractMetaFieldNumber; 463 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 464 465 Account::Account() 466 : ::google::protobuf::Message(), _internal_metadata_(NULL) { 467 ::google::protobuf::internal::InitSCC( 468 &protobuf_block_2eproto::scc_info_Account.base); 469 SharedCtor(); 470 // @@protoc_insertion_point(constructor:corepb.Account) 471 } 472 Account::Account(const Account& from) 473 : ::google::protobuf::Message(), 474 _internal_metadata_(NULL) { 475 _internal_metadata_.MergeFrom(from._internal_metadata_); 476 address_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 477 if (from.address().size() > 0) { 478 address_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.address_); 479 } 480 balance_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 481 if (from.balance().size() > 0) { 482 balance_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.balance_); 483 } 484 vars_hash_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 485 if (from.vars_hash().size() > 0) { 486 vars_hash_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.vars_hash_); 487 } 488 birth_place_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 489 if (from.birth_place().size() > 0) { 490 birth_place_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.birth_place_); 491 } 492 if (from.has_contract_meta()) { 493 contract_meta_ = new ::corepb::ContractMeta(*from.contract_meta_); 494 } else { 495 contract_meta_ = NULL; 496 } 497 nonce_ = from.nonce_; 498 // @@protoc_insertion_point(copy_constructor:corepb.Account) 499 } 500 501 void Account::SharedCtor() { 502 address_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 503 balance_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 504 vars_hash_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 505 birth_place_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 506 ::memset(&contract_meta_, 0, static_cast<size_t>( 507 reinterpret_cast<char*>(&nonce_) - 508 reinterpret_cast<char*>(&contract_meta_)) + sizeof(nonce_)); 509 } 510 511 Account::~Account() { 512 // @@protoc_insertion_point(destructor:corepb.Account) 513 SharedDtor(); 514 } 515 516 void Account::SharedDtor() { 517 address_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 518 balance_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 519 vars_hash_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 520 birth_place_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 521 if (this != internal_default_instance()) delete contract_meta_; 522 } 523 524 void Account::SetCachedSize(int size) const { 525 _cached_size_.Set(size); 526 } 527 const ::google::protobuf::Descriptor* Account::descriptor() { 528 ::protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 529 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; 530 } 531 532 const Account& Account::default_instance() { 533 ::google::protobuf::internal::InitSCC(&protobuf_block_2eproto::scc_info_Account.base); 534 return *internal_default_instance(); 535 } 536 537 538 void Account::Clear() { 539 // @@protoc_insertion_point(message_clear_start:corepb.Account) 540 ::google::protobuf::uint32 cached_has_bits = 0; 541 // Prevent compiler warnings about cached_has_bits being unused 542 (void) cached_has_bits; 543 544 address_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 545 balance_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 546 vars_hash_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 547 birth_place_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 548 if (GetArenaNoVirtual() == NULL && contract_meta_ != NULL) { 549 delete contract_meta_; 550 } 551 contract_meta_ = NULL; 552 nonce_ = GOOGLE_ULONGLONG(0); 553 _internal_metadata_.Clear(); 554 } 555 556 bool Account::MergePartialFromCodedStream( 557 ::google::protobuf::io::CodedInputStream* input) { 558 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 559 ::google::protobuf::uint32 tag; 560 // @@protoc_insertion_point(parse_start:corepb.Account) 561 for (;;) { 562 ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); 563 tag = p.first; 564 if (!p.second) goto handle_unusual; 565 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 566 // bytes address = 1; 567 case 1: { 568 if (static_cast< ::google::protobuf::uint8>(tag) == 569 static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { 570 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 571 input, this->mutable_address())); 572 } else { 573 goto handle_unusual; 574 } 575 break; 576 } 577 578 // bytes balance = 2; 579 case 2: { 580 if (static_cast< ::google::protobuf::uint8>(tag) == 581 static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { 582 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 583 input, this->mutable_balance())); 584 } else { 585 goto handle_unusual; 586 } 587 break; 588 } 589 590 // uint64 nonce = 3; 591 case 3: { 592 if (static_cast< ::google::protobuf::uint8>(tag) == 593 static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { 594 595 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 596 ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( 597 input, &nonce_))); 598 } else { 599 goto handle_unusual; 600 } 601 break; 602 } 603 604 // bytes vars_hash = 4; 605 case 4: { 606 if (static_cast< ::google::protobuf::uint8>(tag) == 607 static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { 608 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 609 input, this->mutable_vars_hash())); 610 } else { 611 goto handle_unusual; 612 } 613 break; 614 } 615 616 // bytes birth_place = 5; 617 case 5: { 618 if (static_cast< ::google::protobuf::uint8>(tag) == 619 static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { 620 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 621 input, this->mutable_birth_place())); 622 } else { 623 goto handle_unusual; 624 } 625 break; 626 } 627 628 // .corepb.ContractMeta contract_meta = 6; 629 case 6: { 630 if (static_cast< ::google::protobuf::uint8>(tag) == 631 static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { 632 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( 633 input, mutable_contract_meta())); 634 } else { 635 goto handle_unusual; 636 } 637 break; 638 } 639 640 default: { 641 handle_unusual: 642 if (tag == 0) { 643 goto success; 644 } 645 DO_(::google::protobuf::internal::WireFormat::SkipField( 646 input, tag, _internal_metadata_.mutable_unknown_fields())); 647 break; 648 } 649 } 650 } 651 success: 652 // @@protoc_insertion_point(parse_success:corepb.Account) 653 return true; 654 failure: 655 // @@protoc_insertion_point(parse_failure:corepb.Account) 656 return false; 657 #undef DO_ 658 } 659 660 void Account::SerializeWithCachedSizes( 661 ::google::protobuf::io::CodedOutputStream* output) const { 662 // @@protoc_insertion_point(serialize_start:corepb.Account) 663 ::google::protobuf::uint32 cached_has_bits = 0; 664 (void) cached_has_bits; 665 666 // bytes address = 1; 667 if (this->address().size() > 0) { 668 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 669 1, this->address(), output); 670 } 671 672 // bytes balance = 2; 673 if (this->balance().size() > 0) { 674 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 675 2, this->balance(), output); 676 } 677 678 // uint64 nonce = 3; 679 if (this->nonce() != 0) { 680 ::google::protobuf::internal::WireFormatLite::WriteUInt64(3, this->nonce(), output); 681 } 682 683 // bytes vars_hash = 4; 684 if (this->vars_hash().size() > 0) { 685 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 686 4, this->vars_hash(), output); 687 } 688 689 // bytes birth_place = 5; 690 if (this->birth_place().size() > 0) { 691 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 692 5, this->birth_place(), output); 693 } 694 695 // .corepb.ContractMeta contract_meta = 6; 696 if (this->has_contract_meta()) { 697 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 698 6, this->_internal_contract_meta(), output); 699 } 700 701 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 702 ::google::protobuf::internal::WireFormat::SerializeUnknownFields( 703 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); 704 } 705 // @@protoc_insertion_point(serialize_end:corepb.Account) 706 } 707 708 ::google::protobuf::uint8* Account::InternalSerializeWithCachedSizesToArray( 709 bool deterministic, ::google::protobuf::uint8* target) const { 710 (void)deterministic; // Unused 711 // @@protoc_insertion_point(serialize_to_array_start:corepb.Account) 712 ::google::protobuf::uint32 cached_has_bits = 0; 713 (void) cached_has_bits; 714 715 // bytes address = 1; 716 if (this->address().size() > 0) { 717 target = 718 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 719 1, this->address(), target); 720 } 721 722 // bytes balance = 2; 723 if (this->balance().size() > 0) { 724 target = 725 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 726 2, this->balance(), target); 727 } 728 729 // uint64 nonce = 3; 730 if (this->nonce() != 0) { 731 target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(3, this->nonce(), target); 732 } 733 734 // bytes vars_hash = 4; 735 if (this->vars_hash().size() > 0) { 736 target = 737 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 738 4, this->vars_hash(), target); 739 } 740 741 // bytes birth_place = 5; 742 if (this->birth_place().size() > 0) { 743 target = 744 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 745 5, this->birth_place(), target); 746 } 747 748 // .corepb.ContractMeta contract_meta = 6; 749 if (this->has_contract_meta()) { 750 target = ::google::protobuf::internal::WireFormatLite:: 751 InternalWriteMessageToArray( 752 6, this->_internal_contract_meta(), deterministic, target); 753 } 754 755 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 756 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( 757 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); 758 } 759 // @@protoc_insertion_point(serialize_to_array_end:corepb.Account) 760 return target; 761 } 762 763 size_t Account::ByteSizeLong() const { 764 // @@protoc_insertion_point(message_byte_size_start:corepb.Account) 765 size_t total_size = 0; 766 767 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 768 total_size += 769 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( 770 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); 771 } 772 // bytes address = 1; 773 if (this->address().size() > 0) { 774 total_size += 1 + 775 ::google::protobuf::internal::WireFormatLite::BytesSize( 776 this->address()); 777 } 778 779 // bytes balance = 2; 780 if (this->balance().size() > 0) { 781 total_size += 1 + 782 ::google::protobuf::internal::WireFormatLite::BytesSize( 783 this->balance()); 784 } 785 786 // bytes vars_hash = 4; 787 if (this->vars_hash().size() > 0) { 788 total_size += 1 + 789 ::google::protobuf::internal::WireFormatLite::BytesSize( 790 this->vars_hash()); 791 } 792 793 // bytes birth_place = 5; 794 if (this->birth_place().size() > 0) { 795 total_size += 1 + 796 ::google::protobuf::internal::WireFormatLite::BytesSize( 797 this->birth_place()); 798 } 799 800 // .corepb.ContractMeta contract_meta = 6; 801 if (this->has_contract_meta()) { 802 total_size += 1 + 803 ::google::protobuf::internal::WireFormatLite::MessageSize( 804 *contract_meta_); 805 } 806 807 // uint64 nonce = 3; 808 if (this->nonce() != 0) { 809 total_size += 1 + 810 ::google::protobuf::internal::WireFormatLite::UInt64Size( 811 this->nonce()); 812 } 813 814 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 815 SetCachedSize(cached_size); 816 return total_size; 817 } 818 819 void Account::MergeFrom(const ::google::protobuf::Message& from) { 820 // @@protoc_insertion_point(generalized_merge_from_start:corepb.Account) 821 GOOGLE_DCHECK_NE(&from, this); 822 const Account* source = 823 ::google::protobuf::internal::DynamicCastToGenerated<const Account>( 824 &from); 825 if (source == NULL) { 826 // @@protoc_insertion_point(generalized_merge_from_cast_fail:corepb.Account) 827 ::google::protobuf::internal::ReflectionOps::Merge(from, this); 828 } else { 829 // @@protoc_insertion_point(generalized_merge_from_cast_success:corepb.Account) 830 MergeFrom(*source); 831 } 832 } 833 834 void Account::MergeFrom(const Account& from) { 835 // @@protoc_insertion_point(class_specific_merge_from_start:corepb.Account) 836 GOOGLE_DCHECK_NE(&from, this); 837 _internal_metadata_.MergeFrom(from._internal_metadata_); 838 ::google::protobuf::uint32 cached_has_bits = 0; 839 (void) cached_has_bits; 840 841 if (from.address().size() > 0) { 842 843 address_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.address_); 844 } 845 if (from.balance().size() > 0) { 846 847 balance_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.balance_); 848 } 849 if (from.vars_hash().size() > 0) { 850 851 vars_hash_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.vars_hash_); 852 } 853 if (from.birth_place().size() > 0) { 854 855 birth_place_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.birth_place_); 856 } 857 if (from.has_contract_meta()) { 858 mutable_contract_meta()->::corepb::ContractMeta::MergeFrom(from.contract_meta()); 859 } 860 if (from.nonce() != 0) { 861 set_nonce(from.nonce()); 862 } 863 } 864 865 void Account::CopyFrom(const ::google::protobuf::Message& from) { 866 // @@protoc_insertion_point(generalized_copy_from_start:corepb.Account) 867 if (&from == this) return; 868 Clear(); 869 MergeFrom(from); 870 } 871 872 void Account::CopyFrom(const Account& from) { 873 // @@protoc_insertion_point(class_specific_copy_from_start:corepb.Account) 874 if (&from == this) return; 875 Clear(); 876 MergeFrom(from); 877 } 878 879 bool Account::IsInitialized() const { 880 return true; 881 } 882 883 void Account::Swap(Account* other) { 884 if (other == this) return; 885 InternalSwap(other); 886 } 887 void Account::InternalSwap(Account* other) { 888 using std::swap; 889 address_.Swap(&other->address_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 890 GetArenaNoVirtual()); 891 balance_.Swap(&other->balance_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 892 GetArenaNoVirtual()); 893 vars_hash_.Swap(&other->vars_hash_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 894 GetArenaNoVirtual()); 895 birth_place_.Swap(&other->birth_place_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 896 GetArenaNoVirtual()); 897 swap(contract_meta_, other->contract_meta_); 898 swap(nonce_, other->nonce_); 899 _internal_metadata_.Swap(&other->_internal_metadata_); 900 } 901 902 ::google::protobuf::Metadata Account::GetMetadata() const { 903 protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 904 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages]; 905 } 906 907 908 // =================================================================== 909 910 void ContractMeta::InitAsDefaultInstance() { 911 } 912 #if !defined(_MSC_VER) || _MSC_VER >= 1900 913 const int ContractMeta::kVersionFieldNumber; 914 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 915 916 ContractMeta::ContractMeta() 917 : ::google::protobuf::Message(), _internal_metadata_(NULL) { 918 ::google::protobuf::internal::InitSCC( 919 &protobuf_block_2eproto::scc_info_ContractMeta.base); 920 SharedCtor(); 921 // @@protoc_insertion_point(constructor:corepb.ContractMeta) 922 } 923 ContractMeta::ContractMeta(const ContractMeta& from) 924 : ::google::protobuf::Message(), 925 _internal_metadata_(NULL) { 926 _internal_metadata_.MergeFrom(from._internal_metadata_); 927 version_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 928 if (from.version().size() > 0) { 929 version_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.version_); 930 } 931 // @@protoc_insertion_point(copy_constructor:corepb.ContractMeta) 932 } 933 934 void ContractMeta::SharedCtor() { 935 version_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 936 } 937 938 ContractMeta::~ContractMeta() { 939 // @@protoc_insertion_point(destructor:corepb.ContractMeta) 940 SharedDtor(); 941 } 942 943 void ContractMeta::SharedDtor() { 944 version_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 945 } 946 947 void ContractMeta::SetCachedSize(int size) const { 948 _cached_size_.Set(size); 949 } 950 const ::google::protobuf::Descriptor* ContractMeta::descriptor() { 951 ::protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 952 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; 953 } 954 955 const ContractMeta& ContractMeta::default_instance() { 956 ::google::protobuf::internal::InitSCC(&protobuf_block_2eproto::scc_info_ContractMeta.base); 957 return *internal_default_instance(); 958 } 959 960 961 void ContractMeta::Clear() { 962 // @@protoc_insertion_point(message_clear_start:corepb.ContractMeta) 963 ::google::protobuf::uint32 cached_has_bits = 0; 964 // Prevent compiler warnings about cached_has_bits being unused 965 (void) cached_has_bits; 966 967 version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 968 _internal_metadata_.Clear(); 969 } 970 971 bool ContractMeta::MergePartialFromCodedStream( 972 ::google::protobuf::io::CodedInputStream* input) { 973 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 974 ::google::protobuf::uint32 tag; 975 // @@protoc_insertion_point(parse_start:corepb.ContractMeta) 976 for (;;) { 977 ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); 978 tag = p.first; 979 if (!p.second) goto handle_unusual; 980 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 981 // string version = 1; 982 case 1: { 983 if (static_cast< ::google::protobuf::uint8>(tag) == 984 static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { 985 DO_(::google::protobuf::internal::WireFormatLite::ReadString( 986 input, this->mutable_version())); 987 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 988 this->version().data(), static_cast<int>(this->version().length()), 989 ::google::protobuf::internal::WireFormatLite::PARSE, 990 "corepb.ContractMeta.version")); 991 } else { 992 goto handle_unusual; 993 } 994 break; 995 } 996 997 default: { 998 handle_unusual: 999 if (tag == 0) { 1000 goto success; 1001 } 1002 DO_(::google::protobuf::internal::WireFormat::SkipField( 1003 input, tag, _internal_metadata_.mutable_unknown_fields())); 1004 break; 1005 } 1006 } 1007 } 1008 success: 1009 // @@protoc_insertion_point(parse_success:corepb.ContractMeta) 1010 return true; 1011 failure: 1012 // @@protoc_insertion_point(parse_failure:corepb.ContractMeta) 1013 return false; 1014 #undef DO_ 1015 } 1016 1017 void ContractMeta::SerializeWithCachedSizes( 1018 ::google::protobuf::io::CodedOutputStream* output) const { 1019 // @@protoc_insertion_point(serialize_start:corepb.ContractMeta) 1020 ::google::protobuf::uint32 cached_has_bits = 0; 1021 (void) cached_has_bits; 1022 1023 // string version = 1; 1024 if (this->version().size() > 0) { 1025 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 1026 this->version().data(), static_cast<int>(this->version().length()), 1027 ::google::protobuf::internal::WireFormatLite::SERIALIZE, 1028 "corepb.ContractMeta.version"); 1029 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1030 1, this->version(), output); 1031 } 1032 1033 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 1034 ::google::protobuf::internal::WireFormat::SerializeUnknownFields( 1035 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); 1036 } 1037 // @@protoc_insertion_point(serialize_end:corepb.ContractMeta) 1038 } 1039 1040 ::google::protobuf::uint8* ContractMeta::InternalSerializeWithCachedSizesToArray( 1041 bool deterministic, ::google::protobuf::uint8* target) const { 1042 (void)deterministic; // Unused 1043 // @@protoc_insertion_point(serialize_to_array_start:corepb.ContractMeta) 1044 ::google::protobuf::uint32 cached_has_bits = 0; 1045 (void) cached_has_bits; 1046 1047 // string version = 1; 1048 if (this->version().size() > 0) { 1049 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 1050 this->version().data(), static_cast<int>(this->version().length()), 1051 ::google::protobuf::internal::WireFormatLite::SERIALIZE, 1052 "corepb.ContractMeta.version"); 1053 target = 1054 ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1055 1, this->version(), target); 1056 } 1057 1058 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 1059 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( 1060 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); 1061 } 1062 // @@protoc_insertion_point(serialize_to_array_end:corepb.ContractMeta) 1063 return target; 1064 } 1065 1066 size_t ContractMeta::ByteSizeLong() const { 1067 // @@protoc_insertion_point(message_byte_size_start:corepb.ContractMeta) 1068 size_t total_size = 0; 1069 1070 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 1071 total_size += 1072 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( 1073 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); 1074 } 1075 // string version = 1; 1076 if (this->version().size() > 0) { 1077 total_size += 1 + 1078 ::google::protobuf::internal::WireFormatLite::StringSize( 1079 this->version()); 1080 } 1081 1082 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 1083 SetCachedSize(cached_size); 1084 return total_size; 1085 } 1086 1087 void ContractMeta::MergeFrom(const ::google::protobuf::Message& from) { 1088 // @@protoc_insertion_point(generalized_merge_from_start:corepb.ContractMeta) 1089 GOOGLE_DCHECK_NE(&from, this); 1090 const ContractMeta* source = 1091 ::google::protobuf::internal::DynamicCastToGenerated<const ContractMeta>( 1092 &from); 1093 if (source == NULL) { 1094 // @@protoc_insertion_point(generalized_merge_from_cast_fail:corepb.ContractMeta) 1095 ::google::protobuf::internal::ReflectionOps::Merge(from, this); 1096 } else { 1097 // @@protoc_insertion_point(generalized_merge_from_cast_success:corepb.ContractMeta) 1098 MergeFrom(*source); 1099 } 1100 } 1101 1102 void ContractMeta::MergeFrom(const ContractMeta& from) { 1103 // @@protoc_insertion_point(class_specific_merge_from_start:corepb.ContractMeta) 1104 GOOGLE_DCHECK_NE(&from, this); 1105 _internal_metadata_.MergeFrom(from._internal_metadata_); 1106 ::google::protobuf::uint32 cached_has_bits = 0; 1107 (void) cached_has_bits; 1108 1109 if (from.version().size() > 0) { 1110 1111 version_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.version_); 1112 } 1113 } 1114 1115 void ContractMeta::CopyFrom(const ::google::protobuf::Message& from) { 1116 // @@protoc_insertion_point(generalized_copy_from_start:corepb.ContractMeta) 1117 if (&from == this) return; 1118 Clear(); 1119 MergeFrom(from); 1120 } 1121 1122 void ContractMeta::CopyFrom(const ContractMeta& from) { 1123 // @@protoc_insertion_point(class_specific_copy_from_start:corepb.ContractMeta) 1124 if (&from == this) return; 1125 Clear(); 1126 MergeFrom(from); 1127 } 1128 1129 bool ContractMeta::IsInitialized() const { 1130 return true; 1131 } 1132 1133 void ContractMeta::Swap(ContractMeta* other) { 1134 if (other == this) return; 1135 InternalSwap(other); 1136 } 1137 void ContractMeta::InternalSwap(ContractMeta* other) { 1138 using std::swap; 1139 version_.Swap(&other->version_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 1140 GetArenaNoVirtual()); 1141 _internal_metadata_.Swap(&other->_internal_metadata_); 1142 } 1143 1144 ::google::protobuf::Metadata ContractMeta::GetMetadata() const { 1145 protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 1146 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages]; 1147 } 1148 1149 1150 // =================================================================== 1151 1152 void Data::InitAsDefaultInstance() { 1153 } 1154 #if !defined(_MSC_VER) || _MSC_VER >= 1900 1155 const int Data::kTypeFieldNumber; 1156 const int Data::kPayloadFieldNumber; 1157 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 1158 1159 Data::Data() 1160 : ::google::protobuf::Message(), _internal_metadata_(NULL) { 1161 ::google::protobuf::internal::InitSCC( 1162 &protobuf_block_2eproto::scc_info_Data.base); 1163 SharedCtor(); 1164 // @@protoc_insertion_point(constructor:corepb.Data) 1165 } 1166 Data::Data(const Data& from) 1167 : ::google::protobuf::Message(), 1168 _internal_metadata_(NULL) { 1169 _internal_metadata_.MergeFrom(from._internal_metadata_); 1170 type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1171 if (from.type().size() > 0) { 1172 type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_); 1173 } 1174 payload_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1175 if (from.payload().size() > 0) { 1176 payload_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.payload_); 1177 } 1178 // @@protoc_insertion_point(copy_constructor:corepb.Data) 1179 } 1180 1181 void Data::SharedCtor() { 1182 type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1183 payload_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1184 } 1185 1186 Data::~Data() { 1187 // @@protoc_insertion_point(destructor:corepb.Data) 1188 SharedDtor(); 1189 } 1190 1191 void Data::SharedDtor() { 1192 type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1193 payload_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1194 } 1195 1196 void Data::SetCachedSize(int size) const { 1197 _cached_size_.Set(size); 1198 } 1199 const ::google::protobuf::Descriptor* Data::descriptor() { 1200 ::protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 1201 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; 1202 } 1203 1204 const Data& Data::default_instance() { 1205 ::google::protobuf::internal::InitSCC(&protobuf_block_2eproto::scc_info_Data.base); 1206 return *internal_default_instance(); 1207 } 1208 1209 1210 void Data::Clear() { 1211 // @@protoc_insertion_point(message_clear_start:corepb.Data) 1212 ::google::protobuf::uint32 cached_has_bits = 0; 1213 // Prevent compiler warnings about cached_has_bits being unused 1214 (void) cached_has_bits; 1215 1216 type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1217 payload_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1218 _internal_metadata_.Clear(); 1219 } 1220 1221 bool Data::MergePartialFromCodedStream( 1222 ::google::protobuf::io::CodedInputStream* input) { 1223 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 1224 ::google::protobuf::uint32 tag; 1225 // @@protoc_insertion_point(parse_start:corepb.Data) 1226 for (;;) { 1227 ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); 1228 tag = p.first; 1229 if (!p.second) goto handle_unusual; 1230 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 1231 // string type = 1; 1232 case 1: { 1233 if (static_cast< ::google::protobuf::uint8>(tag) == 1234 static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { 1235 DO_(::google::protobuf::internal::WireFormatLite::ReadString( 1236 input, this->mutable_type())); 1237 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 1238 this->type().data(), static_cast<int>(this->type().length()), 1239 ::google::protobuf::internal::WireFormatLite::PARSE, 1240 "corepb.Data.type")); 1241 } else { 1242 goto handle_unusual; 1243 } 1244 break; 1245 } 1246 1247 // bytes payload = 2; 1248 case 2: { 1249 if (static_cast< ::google::protobuf::uint8>(tag) == 1250 static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { 1251 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 1252 input, this->mutable_payload())); 1253 } else { 1254 goto handle_unusual; 1255 } 1256 break; 1257 } 1258 1259 default: { 1260 handle_unusual: 1261 if (tag == 0) { 1262 goto success; 1263 } 1264 DO_(::google::protobuf::internal::WireFormat::SkipField( 1265 input, tag, _internal_metadata_.mutable_unknown_fields())); 1266 break; 1267 } 1268 } 1269 } 1270 success: 1271 // @@protoc_insertion_point(parse_success:corepb.Data) 1272 return true; 1273 failure: 1274 // @@protoc_insertion_point(parse_failure:corepb.Data) 1275 return false; 1276 #undef DO_ 1277 } 1278 1279 void Data::SerializeWithCachedSizes( 1280 ::google::protobuf::io::CodedOutputStream* output) const { 1281 // @@protoc_insertion_point(serialize_start:corepb.Data) 1282 ::google::protobuf::uint32 cached_has_bits = 0; 1283 (void) cached_has_bits; 1284 1285 // string type = 1; 1286 if (this->type().size() > 0) { 1287 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 1288 this->type().data(), static_cast<int>(this->type().length()), 1289 ::google::protobuf::internal::WireFormatLite::SERIALIZE, 1290 "corepb.Data.type"); 1291 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1292 1, this->type(), output); 1293 } 1294 1295 // bytes payload = 2; 1296 if (this->payload().size() > 0) { 1297 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 1298 2, this->payload(), output); 1299 } 1300 1301 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 1302 ::google::protobuf::internal::WireFormat::SerializeUnknownFields( 1303 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); 1304 } 1305 // @@protoc_insertion_point(serialize_end:corepb.Data) 1306 } 1307 1308 ::google::protobuf::uint8* Data::InternalSerializeWithCachedSizesToArray( 1309 bool deterministic, ::google::protobuf::uint8* target) const { 1310 (void)deterministic; // Unused 1311 // @@protoc_insertion_point(serialize_to_array_start:corepb.Data) 1312 ::google::protobuf::uint32 cached_has_bits = 0; 1313 (void) cached_has_bits; 1314 1315 // string type = 1; 1316 if (this->type().size() > 0) { 1317 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 1318 this->type().data(), static_cast<int>(this->type().length()), 1319 ::google::protobuf::internal::WireFormatLite::SERIALIZE, 1320 "corepb.Data.type"); 1321 target = 1322 ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1323 1, this->type(), target); 1324 } 1325 1326 // bytes payload = 2; 1327 if (this->payload().size() > 0) { 1328 target = 1329 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 1330 2, this->payload(), target); 1331 } 1332 1333 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 1334 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( 1335 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); 1336 } 1337 // @@protoc_insertion_point(serialize_to_array_end:corepb.Data) 1338 return target; 1339 } 1340 1341 size_t Data::ByteSizeLong() const { 1342 // @@protoc_insertion_point(message_byte_size_start:corepb.Data) 1343 size_t total_size = 0; 1344 1345 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 1346 total_size += 1347 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( 1348 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); 1349 } 1350 // string type = 1; 1351 if (this->type().size() > 0) { 1352 total_size += 1 + 1353 ::google::protobuf::internal::WireFormatLite::StringSize( 1354 this->type()); 1355 } 1356 1357 // bytes payload = 2; 1358 if (this->payload().size() > 0) { 1359 total_size += 1 + 1360 ::google::protobuf::internal::WireFormatLite::BytesSize( 1361 this->payload()); 1362 } 1363 1364 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 1365 SetCachedSize(cached_size); 1366 return total_size; 1367 } 1368 1369 void Data::MergeFrom(const ::google::protobuf::Message& from) { 1370 // @@protoc_insertion_point(generalized_merge_from_start:corepb.Data) 1371 GOOGLE_DCHECK_NE(&from, this); 1372 const Data* source = 1373 ::google::protobuf::internal::DynamicCastToGenerated<const Data>( 1374 &from); 1375 if (source == NULL) { 1376 // @@protoc_insertion_point(generalized_merge_from_cast_fail:corepb.Data) 1377 ::google::protobuf::internal::ReflectionOps::Merge(from, this); 1378 } else { 1379 // @@protoc_insertion_point(generalized_merge_from_cast_success:corepb.Data) 1380 MergeFrom(*source); 1381 } 1382 } 1383 1384 void Data::MergeFrom(const Data& from) { 1385 // @@protoc_insertion_point(class_specific_merge_from_start:corepb.Data) 1386 GOOGLE_DCHECK_NE(&from, this); 1387 _internal_metadata_.MergeFrom(from._internal_metadata_); 1388 ::google::protobuf::uint32 cached_has_bits = 0; 1389 (void) cached_has_bits; 1390 1391 if (from.type().size() > 0) { 1392 1393 type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_); 1394 } 1395 if (from.payload().size() > 0) { 1396 1397 payload_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.payload_); 1398 } 1399 } 1400 1401 void Data::CopyFrom(const ::google::protobuf::Message& from) { 1402 // @@protoc_insertion_point(generalized_copy_from_start:corepb.Data) 1403 if (&from == this) return; 1404 Clear(); 1405 MergeFrom(from); 1406 } 1407 1408 void Data::CopyFrom(const Data& from) { 1409 // @@protoc_insertion_point(class_specific_copy_from_start:corepb.Data) 1410 if (&from == this) return; 1411 Clear(); 1412 MergeFrom(from); 1413 } 1414 1415 bool Data::IsInitialized() const { 1416 return true; 1417 } 1418 1419 void Data::Swap(Data* other) { 1420 if (other == this) return; 1421 InternalSwap(other); 1422 } 1423 void Data::InternalSwap(Data* other) { 1424 using std::swap; 1425 type_.Swap(&other->type_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 1426 GetArenaNoVirtual()); 1427 payload_.Swap(&other->payload_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 1428 GetArenaNoVirtual()); 1429 _internal_metadata_.Swap(&other->_internal_metadata_); 1430 } 1431 1432 ::google::protobuf::Metadata Data::GetMetadata() const { 1433 protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 1434 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages]; 1435 } 1436 1437 1438 // =================================================================== 1439 1440 void Transaction::InitAsDefaultInstance() { 1441 ::corepb::_Transaction_default_instance_._instance.get_mutable()->data_ = const_cast< ::corepb::Data*>( 1442 ::corepb::Data::internal_default_instance()); 1443 } 1444 #if !defined(_MSC_VER) || _MSC_VER >= 1900 1445 const int Transaction::kHashFieldNumber; 1446 const int Transaction::kFromFieldNumber; 1447 const int Transaction::kToFieldNumber; 1448 const int Transaction::kValueFieldNumber; 1449 const int Transaction::kNonceFieldNumber; 1450 const int Transaction::kTimestampFieldNumber; 1451 const int Transaction::kDataFieldNumber; 1452 const int Transaction::kChainIdFieldNumber; 1453 const int Transaction::kGasPriceFieldNumber; 1454 const int Transaction::kGasLimitFieldNumber; 1455 const int Transaction::kAlgFieldNumber; 1456 const int Transaction::kSignFieldNumber; 1457 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 1458 1459 Transaction::Transaction() 1460 : ::google::protobuf::Message(), _internal_metadata_(NULL) { 1461 ::google::protobuf::internal::InitSCC( 1462 &protobuf_block_2eproto::scc_info_Transaction.base); 1463 SharedCtor(); 1464 // @@protoc_insertion_point(constructor:corepb.Transaction) 1465 } 1466 Transaction::Transaction(const Transaction& from) 1467 : ::google::protobuf::Message(), 1468 _internal_metadata_(NULL) { 1469 _internal_metadata_.MergeFrom(from._internal_metadata_); 1470 hash_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1471 if (from.hash().size() > 0) { 1472 hash_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.hash_); 1473 } 1474 from_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1475 if (from.from().size() > 0) { 1476 from_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.from_); 1477 } 1478 to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1479 if (from.to().size() > 0) { 1480 to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.to_); 1481 } 1482 value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1483 if (from.value().size() > 0) { 1484 value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_); 1485 } 1486 gas_price_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1487 if (from.gas_price().size() > 0) { 1488 gas_price_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.gas_price_); 1489 } 1490 gas_limit_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1491 if (from.gas_limit().size() > 0) { 1492 gas_limit_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.gas_limit_); 1493 } 1494 sign_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1495 if (from.sign().size() > 0) { 1496 sign_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.sign_); 1497 } 1498 if (from.has_data()) { 1499 data_ = new ::corepb::Data(*from.data_); 1500 } else { 1501 data_ = NULL; 1502 } 1503 ::memcpy(&nonce_, &from.nonce_, 1504 static_cast<size_t>(reinterpret_cast<char*>(&alg_) - 1505 reinterpret_cast<char*>(&nonce_)) + sizeof(alg_)); 1506 // @@protoc_insertion_point(copy_constructor:corepb.Transaction) 1507 } 1508 1509 void Transaction::SharedCtor() { 1510 hash_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1511 from_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1512 to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1513 value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1514 gas_price_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1515 gas_limit_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1516 sign_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1517 ::memset(&data_, 0, static_cast<size_t>( 1518 reinterpret_cast<char*>(&alg_) - 1519 reinterpret_cast<char*>(&data_)) + sizeof(alg_)); 1520 } 1521 1522 Transaction::~Transaction() { 1523 // @@protoc_insertion_point(destructor:corepb.Transaction) 1524 SharedDtor(); 1525 } 1526 1527 void Transaction::SharedDtor() { 1528 hash_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1529 from_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1530 to_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1531 value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1532 gas_price_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1533 gas_limit_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1534 sign_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1535 if (this != internal_default_instance()) delete data_; 1536 } 1537 1538 void Transaction::SetCachedSize(int size) const { 1539 _cached_size_.Set(size); 1540 } 1541 const ::google::protobuf::Descriptor* Transaction::descriptor() { 1542 ::protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 1543 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; 1544 } 1545 1546 const Transaction& Transaction::default_instance() { 1547 ::google::protobuf::internal::InitSCC(&protobuf_block_2eproto::scc_info_Transaction.base); 1548 return *internal_default_instance(); 1549 } 1550 1551 1552 void Transaction::Clear() { 1553 // @@protoc_insertion_point(message_clear_start:corepb.Transaction) 1554 ::google::protobuf::uint32 cached_has_bits = 0; 1555 // Prevent compiler warnings about cached_has_bits being unused 1556 (void) cached_has_bits; 1557 1558 hash_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1559 from_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1560 to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1561 value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1562 gas_price_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1563 gas_limit_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1564 sign_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1565 if (GetArenaNoVirtual() == NULL && data_ != NULL) { 1566 delete data_; 1567 } 1568 data_ = NULL; 1569 ::memset(&nonce_, 0, static_cast<size_t>( 1570 reinterpret_cast<char*>(&alg_) - 1571 reinterpret_cast<char*>(&nonce_)) + sizeof(alg_)); 1572 _internal_metadata_.Clear(); 1573 } 1574 1575 bool Transaction::MergePartialFromCodedStream( 1576 ::google::protobuf::io::CodedInputStream* input) { 1577 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 1578 ::google::protobuf::uint32 tag; 1579 // @@protoc_insertion_point(parse_start:corepb.Transaction) 1580 for (;;) { 1581 ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); 1582 tag = p.first; 1583 if (!p.second) goto handle_unusual; 1584 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 1585 // bytes hash = 1; 1586 case 1: { 1587 if (static_cast< ::google::protobuf::uint8>(tag) == 1588 static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { 1589 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 1590 input, this->mutable_hash())); 1591 } else { 1592 goto handle_unusual; 1593 } 1594 break; 1595 } 1596 1597 // bytes from = 2; 1598 case 2: { 1599 if (static_cast< ::google::protobuf::uint8>(tag) == 1600 static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { 1601 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 1602 input, this->mutable_from())); 1603 } else { 1604 goto handle_unusual; 1605 } 1606 break; 1607 } 1608 1609 // bytes to = 3; 1610 case 3: { 1611 if (static_cast< ::google::protobuf::uint8>(tag) == 1612 static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { 1613 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 1614 input, this->mutable_to())); 1615 } else { 1616 goto handle_unusual; 1617 } 1618 break; 1619 } 1620 1621 // bytes value = 4; 1622 case 4: { 1623 if (static_cast< ::google::protobuf::uint8>(tag) == 1624 static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { 1625 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 1626 input, this->mutable_value())); 1627 } else { 1628 goto handle_unusual; 1629 } 1630 break; 1631 } 1632 1633 // uint64 nonce = 5; 1634 case 5: { 1635 if (static_cast< ::google::protobuf::uint8>(tag) == 1636 static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { 1637 1638 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 1639 ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( 1640 input, &nonce_))); 1641 } else { 1642 goto handle_unusual; 1643 } 1644 break; 1645 } 1646 1647 // int64 timestamp = 6; 1648 case 6: { 1649 if (static_cast< ::google::protobuf::uint8>(tag) == 1650 static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { 1651 1652 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 1653 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( 1654 input, ×tamp_))); 1655 } else { 1656 goto handle_unusual; 1657 } 1658 break; 1659 } 1660 1661 // .corepb.Data data = 7; 1662 case 7: { 1663 if (static_cast< ::google::protobuf::uint8>(tag) == 1664 static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { 1665 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( 1666 input, mutable_data())); 1667 } else { 1668 goto handle_unusual; 1669 } 1670 break; 1671 } 1672 1673 // uint32 chain_id = 8; 1674 case 8: { 1675 if (static_cast< ::google::protobuf::uint8>(tag) == 1676 static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) { 1677 1678 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 1679 ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( 1680 input, &chain_id_))); 1681 } else { 1682 goto handle_unusual; 1683 } 1684 break; 1685 } 1686 1687 // bytes gas_price = 9; 1688 case 9: { 1689 if (static_cast< ::google::protobuf::uint8>(tag) == 1690 static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { 1691 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 1692 input, this->mutable_gas_price())); 1693 } else { 1694 goto handle_unusual; 1695 } 1696 break; 1697 } 1698 1699 // bytes gas_limit = 10; 1700 case 10: { 1701 if (static_cast< ::google::protobuf::uint8>(tag) == 1702 static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { 1703 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 1704 input, this->mutable_gas_limit())); 1705 } else { 1706 goto handle_unusual; 1707 } 1708 break; 1709 } 1710 1711 // uint32 alg = 11; 1712 case 11: { 1713 if (static_cast< ::google::protobuf::uint8>(tag) == 1714 static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) { 1715 1716 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 1717 ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( 1718 input, &alg_))); 1719 } else { 1720 goto handle_unusual; 1721 } 1722 break; 1723 } 1724 1725 // bytes sign = 12; 1726 case 12: { 1727 if (static_cast< ::google::protobuf::uint8>(tag) == 1728 static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) { 1729 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 1730 input, this->mutable_sign())); 1731 } else { 1732 goto handle_unusual; 1733 } 1734 break; 1735 } 1736 1737 default: { 1738 handle_unusual: 1739 if (tag == 0) { 1740 goto success; 1741 } 1742 DO_(::google::protobuf::internal::WireFormat::SkipField( 1743 input, tag, _internal_metadata_.mutable_unknown_fields())); 1744 break; 1745 } 1746 } 1747 } 1748 success: 1749 // @@protoc_insertion_point(parse_success:corepb.Transaction) 1750 return true; 1751 failure: 1752 // @@protoc_insertion_point(parse_failure:corepb.Transaction) 1753 return false; 1754 #undef DO_ 1755 } 1756 1757 void Transaction::SerializeWithCachedSizes( 1758 ::google::protobuf::io::CodedOutputStream* output) const { 1759 // @@protoc_insertion_point(serialize_start:corepb.Transaction) 1760 ::google::protobuf::uint32 cached_has_bits = 0; 1761 (void) cached_has_bits; 1762 1763 // bytes hash = 1; 1764 if (this->hash().size() > 0) { 1765 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 1766 1, this->hash(), output); 1767 } 1768 1769 // bytes from = 2; 1770 if (this->from().size() > 0) { 1771 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 1772 2, this->from(), output); 1773 } 1774 1775 // bytes to = 3; 1776 if (this->to().size() > 0) { 1777 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 1778 3, this->to(), output); 1779 } 1780 1781 // bytes value = 4; 1782 if (this->value().size() > 0) { 1783 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 1784 4, this->value(), output); 1785 } 1786 1787 // uint64 nonce = 5; 1788 if (this->nonce() != 0) { 1789 ::google::protobuf::internal::WireFormatLite::WriteUInt64(5, this->nonce(), output); 1790 } 1791 1792 // int64 timestamp = 6; 1793 if (this->timestamp() != 0) { 1794 ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->timestamp(), output); 1795 } 1796 1797 // .corepb.Data data = 7; 1798 if (this->has_data()) { 1799 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 1800 7, this->_internal_data(), output); 1801 } 1802 1803 // uint32 chain_id = 8; 1804 if (this->chain_id() != 0) { 1805 ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->chain_id(), output); 1806 } 1807 1808 // bytes gas_price = 9; 1809 if (this->gas_price().size() > 0) { 1810 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 1811 9, this->gas_price(), output); 1812 } 1813 1814 // bytes gas_limit = 10; 1815 if (this->gas_limit().size() > 0) { 1816 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 1817 10, this->gas_limit(), output); 1818 } 1819 1820 // uint32 alg = 11; 1821 if (this->alg() != 0) { 1822 ::google::protobuf::internal::WireFormatLite::WriteUInt32(11, this->alg(), output); 1823 } 1824 1825 // bytes sign = 12; 1826 if (this->sign().size() > 0) { 1827 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 1828 12, this->sign(), output); 1829 } 1830 1831 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 1832 ::google::protobuf::internal::WireFormat::SerializeUnknownFields( 1833 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); 1834 } 1835 // @@protoc_insertion_point(serialize_end:corepb.Transaction) 1836 } 1837 1838 ::google::protobuf::uint8* Transaction::InternalSerializeWithCachedSizesToArray( 1839 bool deterministic, ::google::protobuf::uint8* target) const { 1840 (void)deterministic; // Unused 1841 // @@protoc_insertion_point(serialize_to_array_start:corepb.Transaction) 1842 ::google::protobuf::uint32 cached_has_bits = 0; 1843 (void) cached_has_bits; 1844 1845 // bytes hash = 1; 1846 if (this->hash().size() > 0) { 1847 target = 1848 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 1849 1, this->hash(), target); 1850 } 1851 1852 // bytes from = 2; 1853 if (this->from().size() > 0) { 1854 target = 1855 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 1856 2, this->from(), target); 1857 } 1858 1859 // bytes to = 3; 1860 if (this->to().size() > 0) { 1861 target = 1862 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 1863 3, this->to(), target); 1864 } 1865 1866 // bytes value = 4; 1867 if (this->value().size() > 0) { 1868 target = 1869 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 1870 4, this->value(), target); 1871 } 1872 1873 // uint64 nonce = 5; 1874 if (this->nonce() != 0) { 1875 target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(5, this->nonce(), target); 1876 } 1877 1878 // int64 timestamp = 6; 1879 if (this->timestamp() != 0) { 1880 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(6, this->timestamp(), target); 1881 } 1882 1883 // .corepb.Data data = 7; 1884 if (this->has_data()) { 1885 target = ::google::protobuf::internal::WireFormatLite:: 1886 InternalWriteMessageToArray( 1887 7, this->_internal_data(), deterministic, target); 1888 } 1889 1890 // uint32 chain_id = 8; 1891 if (this->chain_id() != 0) { 1892 target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->chain_id(), target); 1893 } 1894 1895 // bytes gas_price = 9; 1896 if (this->gas_price().size() > 0) { 1897 target = 1898 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 1899 9, this->gas_price(), target); 1900 } 1901 1902 // bytes gas_limit = 10; 1903 if (this->gas_limit().size() > 0) { 1904 target = 1905 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 1906 10, this->gas_limit(), target); 1907 } 1908 1909 // uint32 alg = 11; 1910 if (this->alg() != 0) { 1911 target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(11, this->alg(), target); 1912 } 1913 1914 // bytes sign = 12; 1915 if (this->sign().size() > 0) { 1916 target = 1917 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 1918 12, this->sign(), target); 1919 } 1920 1921 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 1922 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( 1923 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); 1924 } 1925 // @@protoc_insertion_point(serialize_to_array_end:corepb.Transaction) 1926 return target; 1927 } 1928 1929 size_t Transaction::ByteSizeLong() const { 1930 // @@protoc_insertion_point(message_byte_size_start:corepb.Transaction) 1931 size_t total_size = 0; 1932 1933 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 1934 total_size += 1935 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( 1936 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); 1937 } 1938 // bytes hash = 1; 1939 if (this->hash().size() > 0) { 1940 total_size += 1 + 1941 ::google::protobuf::internal::WireFormatLite::BytesSize( 1942 this->hash()); 1943 } 1944 1945 // bytes from = 2; 1946 if (this->from().size() > 0) { 1947 total_size += 1 + 1948 ::google::protobuf::internal::WireFormatLite::BytesSize( 1949 this->from()); 1950 } 1951 1952 // bytes to = 3; 1953 if (this->to().size() > 0) { 1954 total_size += 1 + 1955 ::google::protobuf::internal::WireFormatLite::BytesSize( 1956 this->to()); 1957 } 1958 1959 // bytes value = 4; 1960 if (this->value().size() > 0) { 1961 total_size += 1 + 1962 ::google::protobuf::internal::WireFormatLite::BytesSize( 1963 this->value()); 1964 } 1965 1966 // bytes gas_price = 9; 1967 if (this->gas_price().size() > 0) { 1968 total_size += 1 + 1969 ::google::protobuf::internal::WireFormatLite::BytesSize( 1970 this->gas_price()); 1971 } 1972 1973 // bytes gas_limit = 10; 1974 if (this->gas_limit().size() > 0) { 1975 total_size += 1 + 1976 ::google::protobuf::internal::WireFormatLite::BytesSize( 1977 this->gas_limit()); 1978 } 1979 1980 // bytes sign = 12; 1981 if (this->sign().size() > 0) { 1982 total_size += 1 + 1983 ::google::protobuf::internal::WireFormatLite::BytesSize( 1984 this->sign()); 1985 } 1986 1987 // .corepb.Data data = 7; 1988 if (this->has_data()) { 1989 total_size += 1 + 1990 ::google::protobuf::internal::WireFormatLite::MessageSize( 1991 *data_); 1992 } 1993 1994 // uint64 nonce = 5; 1995 if (this->nonce() != 0) { 1996 total_size += 1 + 1997 ::google::protobuf::internal::WireFormatLite::UInt64Size( 1998 this->nonce()); 1999 } 2000 2001 // int64 timestamp = 6; 2002 if (this->timestamp() != 0) { 2003 total_size += 1 + 2004 ::google::protobuf::internal::WireFormatLite::Int64Size( 2005 this->timestamp()); 2006 } 2007 2008 // uint32 chain_id = 8; 2009 if (this->chain_id() != 0) { 2010 total_size += 1 + 2011 ::google::protobuf::internal::WireFormatLite::UInt32Size( 2012 this->chain_id()); 2013 } 2014 2015 // uint32 alg = 11; 2016 if (this->alg() != 0) { 2017 total_size += 1 + 2018 ::google::protobuf::internal::WireFormatLite::UInt32Size( 2019 this->alg()); 2020 } 2021 2022 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 2023 SetCachedSize(cached_size); 2024 return total_size; 2025 } 2026 2027 void Transaction::MergeFrom(const ::google::protobuf::Message& from) { 2028 // @@protoc_insertion_point(generalized_merge_from_start:corepb.Transaction) 2029 GOOGLE_DCHECK_NE(&from, this); 2030 const Transaction* source = 2031 ::google::protobuf::internal::DynamicCastToGenerated<const Transaction>( 2032 &from); 2033 if (source == NULL) { 2034 // @@protoc_insertion_point(generalized_merge_from_cast_fail:corepb.Transaction) 2035 ::google::protobuf::internal::ReflectionOps::Merge(from, this); 2036 } else { 2037 // @@protoc_insertion_point(generalized_merge_from_cast_success:corepb.Transaction) 2038 MergeFrom(*source); 2039 } 2040 } 2041 2042 void Transaction::MergeFrom(const Transaction& from) { 2043 // @@protoc_insertion_point(class_specific_merge_from_start:corepb.Transaction) 2044 GOOGLE_DCHECK_NE(&from, this); 2045 _internal_metadata_.MergeFrom(from._internal_metadata_); 2046 ::google::protobuf::uint32 cached_has_bits = 0; 2047 (void) cached_has_bits; 2048 2049 if (from.hash().size() > 0) { 2050 2051 hash_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.hash_); 2052 } 2053 if (from.from().size() > 0) { 2054 2055 from_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.from_); 2056 } 2057 if (from.to().size() > 0) { 2058 2059 to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.to_); 2060 } 2061 if (from.value().size() > 0) { 2062 2063 value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_); 2064 } 2065 if (from.gas_price().size() > 0) { 2066 2067 gas_price_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.gas_price_); 2068 } 2069 if (from.gas_limit().size() > 0) { 2070 2071 gas_limit_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.gas_limit_); 2072 } 2073 if (from.sign().size() > 0) { 2074 2075 sign_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.sign_); 2076 } 2077 if (from.has_data()) { 2078 mutable_data()->::corepb::Data::MergeFrom(from.data()); 2079 } 2080 if (from.nonce() != 0) { 2081 set_nonce(from.nonce()); 2082 } 2083 if (from.timestamp() != 0) { 2084 set_timestamp(from.timestamp()); 2085 } 2086 if (from.chain_id() != 0) { 2087 set_chain_id(from.chain_id()); 2088 } 2089 if (from.alg() != 0) { 2090 set_alg(from.alg()); 2091 } 2092 } 2093 2094 void Transaction::CopyFrom(const ::google::protobuf::Message& from) { 2095 // @@protoc_insertion_point(generalized_copy_from_start:corepb.Transaction) 2096 if (&from == this) return; 2097 Clear(); 2098 MergeFrom(from); 2099 } 2100 2101 void Transaction::CopyFrom(const Transaction& from) { 2102 // @@protoc_insertion_point(class_specific_copy_from_start:corepb.Transaction) 2103 if (&from == this) return; 2104 Clear(); 2105 MergeFrom(from); 2106 } 2107 2108 bool Transaction::IsInitialized() const { 2109 return true; 2110 } 2111 2112 void Transaction::Swap(Transaction* other) { 2113 if (other == this) return; 2114 InternalSwap(other); 2115 } 2116 void Transaction::InternalSwap(Transaction* other) { 2117 using std::swap; 2118 hash_.Swap(&other->hash_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 2119 GetArenaNoVirtual()); 2120 from_.Swap(&other->from_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 2121 GetArenaNoVirtual()); 2122 to_.Swap(&other->to_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 2123 GetArenaNoVirtual()); 2124 value_.Swap(&other->value_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 2125 GetArenaNoVirtual()); 2126 gas_price_.Swap(&other->gas_price_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 2127 GetArenaNoVirtual()); 2128 gas_limit_.Swap(&other->gas_limit_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 2129 GetArenaNoVirtual()); 2130 sign_.Swap(&other->sign_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 2131 GetArenaNoVirtual()); 2132 swap(data_, other->data_); 2133 swap(nonce_, other->nonce_); 2134 swap(timestamp_, other->timestamp_); 2135 swap(chain_id_, other->chain_id_); 2136 swap(alg_, other->alg_); 2137 _internal_metadata_.Swap(&other->_internal_metadata_); 2138 } 2139 2140 ::google::protobuf::Metadata Transaction::GetMetadata() const { 2141 protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 2142 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages]; 2143 } 2144 2145 2146 // =================================================================== 2147 2148 void BlockHeader::InitAsDefaultInstance() { 2149 ::corepb::_BlockHeader_default_instance_._instance.get_mutable()->consensus_root_ = const_cast< ::consensuspb::ConsensusRoot*>( 2150 ::consensuspb::ConsensusRoot::internal_default_instance()); 2151 ::corepb::_BlockHeader_default_instance_._instance.get_mutable()->random_ = const_cast< ::corepb::Random*>( 2152 ::corepb::Random::internal_default_instance()); 2153 } 2154 void BlockHeader::clear_consensus_root() { 2155 if (GetArenaNoVirtual() == NULL && consensus_root_ != NULL) { 2156 delete consensus_root_; 2157 } 2158 consensus_root_ = NULL; 2159 } 2160 #if !defined(_MSC_VER) || _MSC_VER >= 1900 2161 const int BlockHeader::kHashFieldNumber; 2162 const int BlockHeader::kParentHashFieldNumber; 2163 const int BlockHeader::kCoinbaseFieldNumber; 2164 const int BlockHeader::kTimestampFieldNumber; 2165 const int BlockHeader::kChainIdFieldNumber; 2166 const int BlockHeader::kAlgFieldNumber; 2167 const int BlockHeader::kSignFieldNumber; 2168 const int BlockHeader::kStateRootFieldNumber; 2169 const int BlockHeader::kTxsRootFieldNumber; 2170 const int BlockHeader::kEventsRootFieldNumber; 2171 const int BlockHeader::kConsensusRootFieldNumber; 2172 const int BlockHeader::kRandomFieldNumber; 2173 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 2174 2175 BlockHeader::BlockHeader() 2176 : ::google::protobuf::Message(), _internal_metadata_(NULL) { 2177 ::google::protobuf::internal::InitSCC( 2178 &protobuf_block_2eproto::scc_info_BlockHeader.base); 2179 SharedCtor(); 2180 // @@protoc_insertion_point(constructor:corepb.BlockHeader) 2181 } 2182 BlockHeader::BlockHeader(const BlockHeader& from) 2183 : ::google::protobuf::Message(), 2184 _internal_metadata_(NULL) { 2185 _internal_metadata_.MergeFrom(from._internal_metadata_); 2186 hash_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2187 if (from.hash().size() > 0) { 2188 hash_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.hash_); 2189 } 2190 parent_hash_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2191 if (from.parent_hash().size() > 0) { 2192 parent_hash_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.parent_hash_); 2193 } 2194 coinbase_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2195 if (from.coinbase().size() > 0) { 2196 coinbase_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.coinbase_); 2197 } 2198 sign_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2199 if (from.sign().size() > 0) { 2200 sign_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.sign_); 2201 } 2202 state_root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2203 if (from.state_root().size() > 0) { 2204 state_root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.state_root_); 2205 } 2206 txs_root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2207 if (from.txs_root().size() > 0) { 2208 txs_root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.txs_root_); 2209 } 2210 events_root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2211 if (from.events_root().size() > 0) { 2212 events_root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.events_root_); 2213 } 2214 if (from.has_consensus_root()) { 2215 consensus_root_ = new ::consensuspb::ConsensusRoot(*from.consensus_root_); 2216 } else { 2217 consensus_root_ = NULL; 2218 } 2219 if (from.has_random()) { 2220 random_ = new ::corepb::Random(*from.random_); 2221 } else { 2222 random_ = NULL; 2223 } 2224 ::memcpy(×tamp_, &from.timestamp_, 2225 static_cast<size_t>(reinterpret_cast<char*>(&alg_) - 2226 reinterpret_cast<char*>(×tamp_)) + sizeof(alg_)); 2227 // @@protoc_insertion_point(copy_constructor:corepb.BlockHeader) 2228 } 2229 2230 void BlockHeader::SharedCtor() { 2231 hash_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2232 parent_hash_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2233 coinbase_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2234 sign_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2235 state_root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2236 txs_root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2237 events_root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2238 ::memset(&consensus_root_, 0, static_cast<size_t>( 2239 reinterpret_cast<char*>(&alg_) - 2240 reinterpret_cast<char*>(&consensus_root_)) + sizeof(alg_)); 2241 } 2242 2243 BlockHeader::~BlockHeader() { 2244 // @@protoc_insertion_point(destructor:corepb.BlockHeader) 2245 SharedDtor(); 2246 } 2247 2248 void BlockHeader::SharedDtor() { 2249 hash_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2250 parent_hash_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2251 coinbase_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2252 sign_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2253 state_root_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2254 txs_root_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2255 events_root_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2256 if (this != internal_default_instance()) delete consensus_root_; 2257 if (this != internal_default_instance()) delete random_; 2258 } 2259 2260 void BlockHeader::SetCachedSize(int size) const { 2261 _cached_size_.Set(size); 2262 } 2263 const ::google::protobuf::Descriptor* BlockHeader::descriptor() { 2264 ::protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 2265 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; 2266 } 2267 2268 const BlockHeader& BlockHeader::default_instance() { 2269 ::google::protobuf::internal::InitSCC(&protobuf_block_2eproto::scc_info_BlockHeader.base); 2270 return *internal_default_instance(); 2271 } 2272 2273 2274 void BlockHeader::Clear() { 2275 // @@protoc_insertion_point(message_clear_start:corepb.BlockHeader) 2276 ::google::protobuf::uint32 cached_has_bits = 0; 2277 // Prevent compiler warnings about cached_has_bits being unused 2278 (void) cached_has_bits; 2279 2280 hash_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2281 parent_hash_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2282 coinbase_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2283 sign_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2284 state_root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2285 txs_root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2286 events_root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 2287 if (GetArenaNoVirtual() == NULL && consensus_root_ != NULL) { 2288 delete consensus_root_; 2289 } 2290 consensus_root_ = NULL; 2291 if (GetArenaNoVirtual() == NULL && random_ != NULL) { 2292 delete random_; 2293 } 2294 random_ = NULL; 2295 ::memset(×tamp_, 0, static_cast<size_t>( 2296 reinterpret_cast<char*>(&alg_) - 2297 reinterpret_cast<char*>(×tamp_)) + sizeof(alg_)); 2298 _internal_metadata_.Clear(); 2299 } 2300 2301 bool BlockHeader::MergePartialFromCodedStream( 2302 ::google::protobuf::io::CodedInputStream* input) { 2303 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 2304 ::google::protobuf::uint32 tag; 2305 // @@protoc_insertion_point(parse_start:corepb.BlockHeader) 2306 for (;;) { 2307 ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); 2308 tag = p.first; 2309 if (!p.second) goto handle_unusual; 2310 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 2311 // bytes hash = 1; 2312 case 1: { 2313 if (static_cast< ::google::protobuf::uint8>(tag) == 2314 static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { 2315 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 2316 input, this->mutable_hash())); 2317 } else { 2318 goto handle_unusual; 2319 } 2320 break; 2321 } 2322 2323 // bytes parent_hash = 2; 2324 case 2: { 2325 if (static_cast< ::google::protobuf::uint8>(tag) == 2326 static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { 2327 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 2328 input, this->mutable_parent_hash())); 2329 } else { 2330 goto handle_unusual; 2331 } 2332 break; 2333 } 2334 2335 // bytes coinbase = 4; 2336 case 4: { 2337 if (static_cast< ::google::protobuf::uint8>(tag) == 2338 static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { 2339 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 2340 input, this->mutable_coinbase())); 2341 } else { 2342 goto handle_unusual; 2343 } 2344 break; 2345 } 2346 2347 // int64 timestamp = 5; 2348 case 5: { 2349 if (static_cast< ::google::protobuf::uint8>(tag) == 2350 static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { 2351 2352 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 2353 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( 2354 input, ×tamp_))); 2355 } else { 2356 goto handle_unusual; 2357 } 2358 break; 2359 } 2360 2361 // uint32 chain_id = 6; 2362 case 6: { 2363 if (static_cast< ::google::protobuf::uint8>(tag) == 2364 static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { 2365 2366 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 2367 ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( 2368 input, &chain_id_))); 2369 } else { 2370 goto handle_unusual; 2371 } 2372 break; 2373 } 2374 2375 // uint32 alg = 7; 2376 case 7: { 2377 if (static_cast< ::google::protobuf::uint8>(tag) == 2378 static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { 2379 2380 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 2381 ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( 2382 input, &alg_))); 2383 } else { 2384 goto handle_unusual; 2385 } 2386 break; 2387 } 2388 2389 // bytes sign = 8; 2390 case 8: { 2391 if (static_cast< ::google::protobuf::uint8>(tag) == 2392 static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { 2393 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 2394 input, this->mutable_sign())); 2395 } else { 2396 goto handle_unusual; 2397 } 2398 break; 2399 } 2400 2401 // bytes state_root = 9; 2402 case 9: { 2403 if (static_cast< ::google::protobuf::uint8>(tag) == 2404 static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { 2405 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 2406 input, this->mutable_state_root())); 2407 } else { 2408 goto handle_unusual; 2409 } 2410 break; 2411 } 2412 2413 // bytes txs_root = 10; 2414 case 10: { 2415 if (static_cast< ::google::protobuf::uint8>(tag) == 2416 static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { 2417 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 2418 input, this->mutable_txs_root())); 2419 } else { 2420 goto handle_unusual; 2421 } 2422 break; 2423 } 2424 2425 // bytes events_root = 11; 2426 case 11: { 2427 if (static_cast< ::google::protobuf::uint8>(tag) == 2428 static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { 2429 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 2430 input, this->mutable_events_root())); 2431 } else { 2432 goto handle_unusual; 2433 } 2434 break; 2435 } 2436 2437 // .consensuspb.ConsensusRoot consensus_root = 12; 2438 case 12: { 2439 if (static_cast< ::google::protobuf::uint8>(tag) == 2440 static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) { 2441 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( 2442 input, mutable_consensus_root())); 2443 } else { 2444 goto handle_unusual; 2445 } 2446 break; 2447 } 2448 2449 // .corepb.Random random = 13; 2450 case 13: { 2451 if (static_cast< ::google::protobuf::uint8>(tag) == 2452 static_cast< ::google::protobuf::uint8>(106u /* 106 & 0xFF */)) { 2453 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( 2454 input, mutable_random())); 2455 } else { 2456 goto handle_unusual; 2457 } 2458 break; 2459 } 2460 2461 default: { 2462 handle_unusual: 2463 if (tag == 0) { 2464 goto success; 2465 } 2466 DO_(::google::protobuf::internal::WireFormat::SkipField( 2467 input, tag, _internal_metadata_.mutable_unknown_fields())); 2468 break; 2469 } 2470 } 2471 } 2472 success: 2473 // @@protoc_insertion_point(parse_success:corepb.BlockHeader) 2474 return true; 2475 failure: 2476 // @@protoc_insertion_point(parse_failure:corepb.BlockHeader) 2477 return false; 2478 #undef DO_ 2479 } 2480 2481 void BlockHeader::SerializeWithCachedSizes( 2482 ::google::protobuf::io::CodedOutputStream* output) const { 2483 // @@protoc_insertion_point(serialize_start:corepb.BlockHeader) 2484 ::google::protobuf::uint32 cached_has_bits = 0; 2485 (void) cached_has_bits; 2486 2487 // bytes hash = 1; 2488 if (this->hash().size() > 0) { 2489 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 2490 1, this->hash(), output); 2491 } 2492 2493 // bytes parent_hash = 2; 2494 if (this->parent_hash().size() > 0) { 2495 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 2496 2, this->parent_hash(), output); 2497 } 2498 2499 // bytes coinbase = 4; 2500 if (this->coinbase().size() > 0) { 2501 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 2502 4, this->coinbase(), output); 2503 } 2504 2505 // int64 timestamp = 5; 2506 if (this->timestamp() != 0) { 2507 ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->timestamp(), output); 2508 } 2509 2510 // uint32 chain_id = 6; 2511 if (this->chain_id() != 0) { 2512 ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->chain_id(), output); 2513 } 2514 2515 // uint32 alg = 7; 2516 if (this->alg() != 0) { 2517 ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->alg(), output); 2518 } 2519 2520 // bytes sign = 8; 2521 if (this->sign().size() > 0) { 2522 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 2523 8, this->sign(), output); 2524 } 2525 2526 // bytes state_root = 9; 2527 if (this->state_root().size() > 0) { 2528 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 2529 9, this->state_root(), output); 2530 } 2531 2532 // bytes txs_root = 10; 2533 if (this->txs_root().size() > 0) { 2534 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 2535 10, this->txs_root(), output); 2536 } 2537 2538 // bytes events_root = 11; 2539 if (this->events_root().size() > 0) { 2540 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 2541 11, this->events_root(), output); 2542 } 2543 2544 // .consensuspb.ConsensusRoot consensus_root = 12; 2545 if (this->has_consensus_root()) { 2546 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 2547 12, this->_internal_consensus_root(), output); 2548 } 2549 2550 // .corepb.Random random = 13; 2551 if (this->has_random()) { 2552 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 2553 13, this->_internal_random(), output); 2554 } 2555 2556 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 2557 ::google::protobuf::internal::WireFormat::SerializeUnknownFields( 2558 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); 2559 } 2560 // @@protoc_insertion_point(serialize_end:corepb.BlockHeader) 2561 } 2562 2563 ::google::protobuf::uint8* BlockHeader::InternalSerializeWithCachedSizesToArray( 2564 bool deterministic, ::google::protobuf::uint8* target) const { 2565 (void)deterministic; // Unused 2566 // @@protoc_insertion_point(serialize_to_array_start:corepb.BlockHeader) 2567 ::google::protobuf::uint32 cached_has_bits = 0; 2568 (void) cached_has_bits; 2569 2570 // bytes hash = 1; 2571 if (this->hash().size() > 0) { 2572 target = 2573 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 2574 1, this->hash(), target); 2575 } 2576 2577 // bytes parent_hash = 2; 2578 if (this->parent_hash().size() > 0) { 2579 target = 2580 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 2581 2, this->parent_hash(), target); 2582 } 2583 2584 // bytes coinbase = 4; 2585 if (this->coinbase().size() > 0) { 2586 target = 2587 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 2588 4, this->coinbase(), target); 2589 } 2590 2591 // int64 timestamp = 5; 2592 if (this->timestamp() != 0) { 2593 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->timestamp(), target); 2594 } 2595 2596 // uint32 chain_id = 6; 2597 if (this->chain_id() != 0) { 2598 target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->chain_id(), target); 2599 } 2600 2601 // uint32 alg = 7; 2602 if (this->alg() != 0) { 2603 target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->alg(), target); 2604 } 2605 2606 // bytes sign = 8; 2607 if (this->sign().size() > 0) { 2608 target = 2609 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 2610 8, this->sign(), target); 2611 } 2612 2613 // bytes state_root = 9; 2614 if (this->state_root().size() > 0) { 2615 target = 2616 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 2617 9, this->state_root(), target); 2618 } 2619 2620 // bytes txs_root = 10; 2621 if (this->txs_root().size() > 0) { 2622 target = 2623 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 2624 10, this->txs_root(), target); 2625 } 2626 2627 // bytes events_root = 11; 2628 if (this->events_root().size() > 0) { 2629 target = 2630 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 2631 11, this->events_root(), target); 2632 } 2633 2634 // .consensuspb.ConsensusRoot consensus_root = 12; 2635 if (this->has_consensus_root()) { 2636 target = ::google::protobuf::internal::WireFormatLite:: 2637 InternalWriteMessageToArray( 2638 12, this->_internal_consensus_root(), deterministic, target); 2639 } 2640 2641 // .corepb.Random random = 13; 2642 if (this->has_random()) { 2643 target = ::google::protobuf::internal::WireFormatLite:: 2644 InternalWriteMessageToArray( 2645 13, this->_internal_random(), deterministic, target); 2646 } 2647 2648 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 2649 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( 2650 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); 2651 } 2652 // @@protoc_insertion_point(serialize_to_array_end:corepb.BlockHeader) 2653 return target; 2654 } 2655 2656 size_t BlockHeader::ByteSizeLong() const { 2657 // @@protoc_insertion_point(message_byte_size_start:corepb.BlockHeader) 2658 size_t total_size = 0; 2659 2660 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 2661 total_size += 2662 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( 2663 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); 2664 } 2665 // bytes hash = 1; 2666 if (this->hash().size() > 0) { 2667 total_size += 1 + 2668 ::google::protobuf::internal::WireFormatLite::BytesSize( 2669 this->hash()); 2670 } 2671 2672 // bytes parent_hash = 2; 2673 if (this->parent_hash().size() > 0) { 2674 total_size += 1 + 2675 ::google::protobuf::internal::WireFormatLite::BytesSize( 2676 this->parent_hash()); 2677 } 2678 2679 // bytes coinbase = 4; 2680 if (this->coinbase().size() > 0) { 2681 total_size += 1 + 2682 ::google::protobuf::internal::WireFormatLite::BytesSize( 2683 this->coinbase()); 2684 } 2685 2686 // bytes sign = 8; 2687 if (this->sign().size() > 0) { 2688 total_size += 1 + 2689 ::google::protobuf::internal::WireFormatLite::BytesSize( 2690 this->sign()); 2691 } 2692 2693 // bytes state_root = 9; 2694 if (this->state_root().size() > 0) { 2695 total_size += 1 + 2696 ::google::protobuf::internal::WireFormatLite::BytesSize( 2697 this->state_root()); 2698 } 2699 2700 // bytes txs_root = 10; 2701 if (this->txs_root().size() > 0) { 2702 total_size += 1 + 2703 ::google::protobuf::internal::WireFormatLite::BytesSize( 2704 this->txs_root()); 2705 } 2706 2707 // bytes events_root = 11; 2708 if (this->events_root().size() > 0) { 2709 total_size += 1 + 2710 ::google::protobuf::internal::WireFormatLite::BytesSize( 2711 this->events_root()); 2712 } 2713 2714 // .consensuspb.ConsensusRoot consensus_root = 12; 2715 if (this->has_consensus_root()) { 2716 total_size += 1 + 2717 ::google::protobuf::internal::WireFormatLite::MessageSize( 2718 *consensus_root_); 2719 } 2720 2721 // .corepb.Random random = 13; 2722 if (this->has_random()) { 2723 total_size += 1 + 2724 ::google::protobuf::internal::WireFormatLite::MessageSize( 2725 *random_); 2726 } 2727 2728 // int64 timestamp = 5; 2729 if (this->timestamp() != 0) { 2730 total_size += 1 + 2731 ::google::protobuf::internal::WireFormatLite::Int64Size( 2732 this->timestamp()); 2733 } 2734 2735 // uint32 chain_id = 6; 2736 if (this->chain_id() != 0) { 2737 total_size += 1 + 2738 ::google::protobuf::internal::WireFormatLite::UInt32Size( 2739 this->chain_id()); 2740 } 2741 2742 // uint32 alg = 7; 2743 if (this->alg() != 0) { 2744 total_size += 1 + 2745 ::google::protobuf::internal::WireFormatLite::UInt32Size( 2746 this->alg()); 2747 } 2748 2749 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 2750 SetCachedSize(cached_size); 2751 return total_size; 2752 } 2753 2754 void BlockHeader::MergeFrom(const ::google::protobuf::Message& from) { 2755 // @@protoc_insertion_point(generalized_merge_from_start:corepb.BlockHeader) 2756 GOOGLE_DCHECK_NE(&from, this); 2757 const BlockHeader* source = 2758 ::google::protobuf::internal::DynamicCastToGenerated<const BlockHeader>( 2759 &from); 2760 if (source == NULL) { 2761 // @@protoc_insertion_point(generalized_merge_from_cast_fail:corepb.BlockHeader) 2762 ::google::protobuf::internal::ReflectionOps::Merge(from, this); 2763 } else { 2764 // @@protoc_insertion_point(generalized_merge_from_cast_success:corepb.BlockHeader) 2765 MergeFrom(*source); 2766 } 2767 } 2768 2769 void BlockHeader::MergeFrom(const BlockHeader& from) { 2770 // @@protoc_insertion_point(class_specific_merge_from_start:corepb.BlockHeader) 2771 GOOGLE_DCHECK_NE(&from, this); 2772 _internal_metadata_.MergeFrom(from._internal_metadata_); 2773 ::google::protobuf::uint32 cached_has_bits = 0; 2774 (void) cached_has_bits; 2775 2776 if (from.hash().size() > 0) { 2777 2778 hash_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.hash_); 2779 } 2780 if (from.parent_hash().size() > 0) { 2781 2782 parent_hash_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.parent_hash_); 2783 } 2784 if (from.coinbase().size() > 0) { 2785 2786 coinbase_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.coinbase_); 2787 } 2788 if (from.sign().size() > 0) { 2789 2790 sign_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.sign_); 2791 } 2792 if (from.state_root().size() > 0) { 2793 2794 state_root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.state_root_); 2795 } 2796 if (from.txs_root().size() > 0) { 2797 2798 txs_root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.txs_root_); 2799 } 2800 if (from.events_root().size() > 0) { 2801 2802 events_root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.events_root_); 2803 } 2804 if (from.has_consensus_root()) { 2805 mutable_consensus_root()->::consensuspb::ConsensusRoot::MergeFrom(from.consensus_root()); 2806 } 2807 if (from.has_random()) { 2808 mutable_random()->::corepb::Random::MergeFrom(from.random()); 2809 } 2810 if (from.timestamp() != 0) { 2811 set_timestamp(from.timestamp()); 2812 } 2813 if (from.chain_id() != 0) { 2814 set_chain_id(from.chain_id()); 2815 } 2816 if (from.alg() != 0) { 2817 set_alg(from.alg()); 2818 } 2819 } 2820 2821 void BlockHeader::CopyFrom(const ::google::protobuf::Message& from) { 2822 // @@protoc_insertion_point(generalized_copy_from_start:corepb.BlockHeader) 2823 if (&from == this) return; 2824 Clear(); 2825 MergeFrom(from); 2826 } 2827 2828 void BlockHeader::CopyFrom(const BlockHeader& from) { 2829 // @@protoc_insertion_point(class_specific_copy_from_start:corepb.BlockHeader) 2830 if (&from == this) return; 2831 Clear(); 2832 MergeFrom(from); 2833 } 2834 2835 bool BlockHeader::IsInitialized() const { 2836 return true; 2837 } 2838 2839 void BlockHeader::Swap(BlockHeader* other) { 2840 if (other == this) return; 2841 InternalSwap(other); 2842 } 2843 void BlockHeader::InternalSwap(BlockHeader* other) { 2844 using std::swap; 2845 hash_.Swap(&other->hash_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 2846 GetArenaNoVirtual()); 2847 parent_hash_.Swap(&other->parent_hash_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 2848 GetArenaNoVirtual()); 2849 coinbase_.Swap(&other->coinbase_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 2850 GetArenaNoVirtual()); 2851 sign_.Swap(&other->sign_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 2852 GetArenaNoVirtual()); 2853 state_root_.Swap(&other->state_root_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 2854 GetArenaNoVirtual()); 2855 txs_root_.Swap(&other->txs_root_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 2856 GetArenaNoVirtual()); 2857 events_root_.Swap(&other->events_root_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 2858 GetArenaNoVirtual()); 2859 swap(consensus_root_, other->consensus_root_); 2860 swap(random_, other->random_); 2861 swap(timestamp_, other->timestamp_); 2862 swap(chain_id_, other->chain_id_); 2863 swap(alg_, other->alg_); 2864 _internal_metadata_.Swap(&other->_internal_metadata_); 2865 } 2866 2867 ::google::protobuf::Metadata BlockHeader::GetMetadata() const { 2868 protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 2869 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages]; 2870 } 2871 2872 2873 // =================================================================== 2874 2875 void Block::InitAsDefaultInstance() { 2876 ::corepb::_Block_default_instance_._instance.get_mutable()->header_ = const_cast< ::corepb::BlockHeader*>( 2877 ::corepb::BlockHeader::internal_default_instance()); 2878 ::corepb::_Block_default_instance_._instance.get_mutable()->dependency_ = const_cast< ::dagpb::Dag*>( 2879 ::dagpb::Dag::internal_default_instance()); 2880 } 2881 void Block::clear_dependency() { 2882 if (GetArenaNoVirtual() == NULL && dependency_ != NULL) { 2883 delete dependency_; 2884 } 2885 dependency_ = NULL; 2886 } 2887 #if !defined(_MSC_VER) || _MSC_VER >= 1900 2888 const int Block::kHeaderFieldNumber; 2889 const int Block::kTransactionsFieldNumber; 2890 const int Block::kDependencyFieldNumber; 2891 const int Block::kHeightFieldNumber; 2892 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 2893 2894 Block::Block() 2895 : ::google::protobuf::Message(), _internal_metadata_(NULL) { 2896 ::google::protobuf::internal::InitSCC( 2897 &protobuf_block_2eproto::scc_info_Block.base); 2898 SharedCtor(); 2899 // @@protoc_insertion_point(constructor:corepb.Block) 2900 } 2901 Block::Block(const Block& from) 2902 : ::google::protobuf::Message(), 2903 _internal_metadata_(NULL), 2904 transactions_(from.transactions_) { 2905 _internal_metadata_.MergeFrom(from._internal_metadata_); 2906 if (from.has_header()) { 2907 header_ = new ::corepb::BlockHeader(*from.header_); 2908 } else { 2909 header_ = NULL; 2910 } 2911 if (from.has_dependency()) { 2912 dependency_ = new ::dagpb::Dag(*from.dependency_); 2913 } else { 2914 dependency_ = NULL; 2915 } 2916 height_ = from.height_; 2917 // @@protoc_insertion_point(copy_constructor:corepb.Block) 2918 } 2919 2920 void Block::SharedCtor() { 2921 ::memset(&header_, 0, static_cast<size_t>( 2922 reinterpret_cast<char*>(&height_) - 2923 reinterpret_cast<char*>(&header_)) + sizeof(height_)); 2924 } 2925 2926 Block::~Block() { 2927 // @@protoc_insertion_point(destructor:corepb.Block) 2928 SharedDtor(); 2929 } 2930 2931 void Block::SharedDtor() { 2932 if (this != internal_default_instance()) delete header_; 2933 if (this != internal_default_instance()) delete dependency_; 2934 } 2935 2936 void Block::SetCachedSize(int size) const { 2937 _cached_size_.Set(size); 2938 } 2939 const ::google::protobuf::Descriptor* Block::descriptor() { 2940 ::protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 2941 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; 2942 } 2943 2944 const Block& Block::default_instance() { 2945 ::google::protobuf::internal::InitSCC(&protobuf_block_2eproto::scc_info_Block.base); 2946 return *internal_default_instance(); 2947 } 2948 2949 2950 void Block::Clear() { 2951 // @@protoc_insertion_point(message_clear_start:corepb.Block) 2952 ::google::protobuf::uint32 cached_has_bits = 0; 2953 // Prevent compiler warnings about cached_has_bits being unused 2954 (void) cached_has_bits; 2955 2956 transactions_.Clear(); 2957 if (GetArenaNoVirtual() == NULL && header_ != NULL) { 2958 delete header_; 2959 } 2960 header_ = NULL; 2961 if (GetArenaNoVirtual() == NULL && dependency_ != NULL) { 2962 delete dependency_; 2963 } 2964 dependency_ = NULL; 2965 height_ = GOOGLE_ULONGLONG(0); 2966 _internal_metadata_.Clear(); 2967 } 2968 2969 bool Block::MergePartialFromCodedStream( 2970 ::google::protobuf::io::CodedInputStream* input) { 2971 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 2972 ::google::protobuf::uint32 tag; 2973 // @@protoc_insertion_point(parse_start:corepb.Block) 2974 for (;;) { 2975 ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); 2976 tag = p.first; 2977 if (!p.second) goto handle_unusual; 2978 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 2979 // .corepb.BlockHeader header = 1; 2980 case 1: { 2981 if (static_cast< ::google::protobuf::uint8>(tag) == 2982 static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { 2983 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( 2984 input, mutable_header())); 2985 } else { 2986 goto handle_unusual; 2987 } 2988 break; 2989 } 2990 2991 // repeated .corepb.Transaction transactions = 2; 2992 case 2: { 2993 if (static_cast< ::google::protobuf::uint8>(tag) == 2994 static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { 2995 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( 2996 input, add_transactions())); 2997 } else { 2998 goto handle_unusual; 2999 } 3000 break; 3001 } 3002 3003 // .dagpb.Dag dependency = 3; 3004 case 3: { 3005 if (static_cast< ::google::protobuf::uint8>(tag) == 3006 static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { 3007 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( 3008 input, mutable_dependency())); 3009 } else { 3010 goto handle_unusual; 3011 } 3012 break; 3013 } 3014 3015 // uint64 height = 4; 3016 case 4: { 3017 if (static_cast< ::google::protobuf::uint8>(tag) == 3018 static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { 3019 3020 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 3021 ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( 3022 input, &height_))); 3023 } else { 3024 goto handle_unusual; 3025 } 3026 break; 3027 } 3028 3029 default: { 3030 handle_unusual: 3031 if (tag == 0) { 3032 goto success; 3033 } 3034 DO_(::google::protobuf::internal::WireFormat::SkipField( 3035 input, tag, _internal_metadata_.mutable_unknown_fields())); 3036 break; 3037 } 3038 } 3039 } 3040 success: 3041 // @@protoc_insertion_point(parse_success:corepb.Block) 3042 return true; 3043 failure: 3044 // @@protoc_insertion_point(parse_failure:corepb.Block) 3045 return false; 3046 #undef DO_ 3047 } 3048 3049 void Block::SerializeWithCachedSizes( 3050 ::google::protobuf::io::CodedOutputStream* output) const { 3051 // @@protoc_insertion_point(serialize_start:corepb.Block) 3052 ::google::protobuf::uint32 cached_has_bits = 0; 3053 (void) cached_has_bits; 3054 3055 // .corepb.BlockHeader header = 1; 3056 if (this->has_header()) { 3057 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 3058 1, this->_internal_header(), output); 3059 } 3060 3061 // repeated .corepb.Transaction transactions = 2; 3062 for (unsigned int i = 0, 3063 n = static_cast<unsigned int>(this->transactions_size()); i < n; i++) { 3064 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 3065 2, 3066 this->transactions(static_cast<int>(i)), 3067 output); 3068 } 3069 3070 // .dagpb.Dag dependency = 3; 3071 if (this->has_dependency()) { 3072 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 3073 3, this->_internal_dependency(), output); 3074 } 3075 3076 // uint64 height = 4; 3077 if (this->height() != 0) { 3078 ::google::protobuf::internal::WireFormatLite::WriteUInt64(4, this->height(), output); 3079 } 3080 3081 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 3082 ::google::protobuf::internal::WireFormat::SerializeUnknownFields( 3083 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); 3084 } 3085 // @@protoc_insertion_point(serialize_end:corepb.Block) 3086 } 3087 3088 ::google::protobuf::uint8* Block::InternalSerializeWithCachedSizesToArray( 3089 bool deterministic, ::google::protobuf::uint8* target) const { 3090 (void)deterministic; // Unused 3091 // @@protoc_insertion_point(serialize_to_array_start:corepb.Block) 3092 ::google::protobuf::uint32 cached_has_bits = 0; 3093 (void) cached_has_bits; 3094 3095 // .corepb.BlockHeader header = 1; 3096 if (this->has_header()) { 3097 target = ::google::protobuf::internal::WireFormatLite:: 3098 InternalWriteMessageToArray( 3099 1, this->_internal_header(), deterministic, target); 3100 } 3101 3102 // repeated .corepb.Transaction transactions = 2; 3103 for (unsigned int i = 0, 3104 n = static_cast<unsigned int>(this->transactions_size()); i < n; i++) { 3105 target = ::google::protobuf::internal::WireFormatLite:: 3106 InternalWriteMessageToArray( 3107 2, this->transactions(static_cast<int>(i)), deterministic, target); 3108 } 3109 3110 // .dagpb.Dag dependency = 3; 3111 if (this->has_dependency()) { 3112 target = ::google::protobuf::internal::WireFormatLite:: 3113 InternalWriteMessageToArray( 3114 3, this->_internal_dependency(), deterministic, target); 3115 } 3116 3117 // uint64 height = 4; 3118 if (this->height() != 0) { 3119 target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(4, this->height(), target); 3120 } 3121 3122 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 3123 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( 3124 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); 3125 } 3126 // @@protoc_insertion_point(serialize_to_array_end:corepb.Block) 3127 return target; 3128 } 3129 3130 size_t Block::ByteSizeLong() const { 3131 // @@protoc_insertion_point(message_byte_size_start:corepb.Block) 3132 size_t total_size = 0; 3133 3134 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 3135 total_size += 3136 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( 3137 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); 3138 } 3139 // repeated .corepb.Transaction transactions = 2; 3140 { 3141 unsigned int count = static_cast<unsigned int>(this->transactions_size()); 3142 total_size += 1UL * count; 3143 for (unsigned int i = 0; i < count; i++) { 3144 total_size += 3145 ::google::protobuf::internal::WireFormatLite::MessageSize( 3146 this->transactions(static_cast<int>(i))); 3147 } 3148 } 3149 3150 // .corepb.BlockHeader header = 1; 3151 if (this->has_header()) { 3152 total_size += 1 + 3153 ::google::protobuf::internal::WireFormatLite::MessageSize( 3154 *header_); 3155 } 3156 3157 // .dagpb.Dag dependency = 3; 3158 if (this->has_dependency()) { 3159 total_size += 1 + 3160 ::google::protobuf::internal::WireFormatLite::MessageSize( 3161 *dependency_); 3162 } 3163 3164 // uint64 height = 4; 3165 if (this->height() != 0) { 3166 total_size += 1 + 3167 ::google::protobuf::internal::WireFormatLite::UInt64Size( 3168 this->height()); 3169 } 3170 3171 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 3172 SetCachedSize(cached_size); 3173 return total_size; 3174 } 3175 3176 void Block::MergeFrom(const ::google::protobuf::Message& from) { 3177 // @@protoc_insertion_point(generalized_merge_from_start:corepb.Block) 3178 GOOGLE_DCHECK_NE(&from, this); 3179 const Block* source = 3180 ::google::protobuf::internal::DynamicCastToGenerated<const Block>( 3181 &from); 3182 if (source == NULL) { 3183 // @@protoc_insertion_point(generalized_merge_from_cast_fail:corepb.Block) 3184 ::google::protobuf::internal::ReflectionOps::Merge(from, this); 3185 } else { 3186 // @@protoc_insertion_point(generalized_merge_from_cast_success:corepb.Block) 3187 MergeFrom(*source); 3188 } 3189 } 3190 3191 void Block::MergeFrom(const Block& from) { 3192 // @@protoc_insertion_point(class_specific_merge_from_start:corepb.Block) 3193 GOOGLE_DCHECK_NE(&from, this); 3194 _internal_metadata_.MergeFrom(from._internal_metadata_); 3195 ::google::protobuf::uint32 cached_has_bits = 0; 3196 (void) cached_has_bits; 3197 3198 transactions_.MergeFrom(from.transactions_); 3199 if (from.has_header()) { 3200 mutable_header()->::corepb::BlockHeader::MergeFrom(from.header()); 3201 } 3202 if (from.has_dependency()) { 3203 mutable_dependency()->::dagpb::Dag::MergeFrom(from.dependency()); 3204 } 3205 if (from.height() != 0) { 3206 set_height(from.height()); 3207 } 3208 } 3209 3210 void Block::CopyFrom(const ::google::protobuf::Message& from) { 3211 // @@protoc_insertion_point(generalized_copy_from_start:corepb.Block) 3212 if (&from == this) return; 3213 Clear(); 3214 MergeFrom(from); 3215 } 3216 3217 void Block::CopyFrom(const Block& from) { 3218 // @@protoc_insertion_point(class_specific_copy_from_start:corepb.Block) 3219 if (&from == this) return; 3220 Clear(); 3221 MergeFrom(from); 3222 } 3223 3224 bool Block::IsInitialized() const { 3225 return true; 3226 } 3227 3228 void Block::Swap(Block* other) { 3229 if (other == this) return; 3230 InternalSwap(other); 3231 } 3232 void Block::InternalSwap(Block* other) { 3233 using std::swap; 3234 CastToBase(&transactions_)->InternalSwap(CastToBase(&other->transactions_)); 3235 swap(header_, other->header_); 3236 swap(dependency_, other->dependency_); 3237 swap(height_, other->height_); 3238 _internal_metadata_.Swap(&other->_internal_metadata_); 3239 } 3240 3241 ::google::protobuf::Metadata Block::GetMetadata() const { 3242 protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 3243 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages]; 3244 } 3245 3246 3247 // =================================================================== 3248 3249 void NetBlocks::InitAsDefaultInstance() { 3250 } 3251 #if !defined(_MSC_VER) || _MSC_VER >= 1900 3252 const int NetBlocks::kFromFieldNumber; 3253 const int NetBlocks::kBatchFieldNumber; 3254 const int NetBlocks::kBlocksFieldNumber; 3255 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 3256 3257 NetBlocks::NetBlocks() 3258 : ::google::protobuf::Message(), _internal_metadata_(NULL) { 3259 ::google::protobuf::internal::InitSCC( 3260 &protobuf_block_2eproto::scc_info_NetBlocks.base); 3261 SharedCtor(); 3262 // @@protoc_insertion_point(constructor:corepb.NetBlocks) 3263 } 3264 NetBlocks::NetBlocks(const NetBlocks& from) 3265 : ::google::protobuf::Message(), 3266 _internal_metadata_(NULL), 3267 blocks_(from.blocks_) { 3268 _internal_metadata_.MergeFrom(from._internal_metadata_); 3269 from_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3270 if (from.from().size() > 0) { 3271 from_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.from_); 3272 } 3273 batch_ = from.batch_; 3274 // @@protoc_insertion_point(copy_constructor:corepb.NetBlocks) 3275 } 3276 3277 void NetBlocks::SharedCtor() { 3278 from_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3279 batch_ = GOOGLE_ULONGLONG(0); 3280 } 3281 3282 NetBlocks::~NetBlocks() { 3283 // @@protoc_insertion_point(destructor:corepb.NetBlocks) 3284 SharedDtor(); 3285 } 3286 3287 void NetBlocks::SharedDtor() { 3288 from_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3289 } 3290 3291 void NetBlocks::SetCachedSize(int size) const { 3292 _cached_size_.Set(size); 3293 } 3294 const ::google::protobuf::Descriptor* NetBlocks::descriptor() { 3295 ::protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 3296 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; 3297 } 3298 3299 const NetBlocks& NetBlocks::default_instance() { 3300 ::google::protobuf::internal::InitSCC(&protobuf_block_2eproto::scc_info_NetBlocks.base); 3301 return *internal_default_instance(); 3302 } 3303 3304 3305 void NetBlocks::Clear() { 3306 // @@protoc_insertion_point(message_clear_start:corepb.NetBlocks) 3307 ::google::protobuf::uint32 cached_has_bits = 0; 3308 // Prevent compiler warnings about cached_has_bits being unused 3309 (void) cached_has_bits; 3310 3311 blocks_.Clear(); 3312 from_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3313 batch_ = GOOGLE_ULONGLONG(0); 3314 _internal_metadata_.Clear(); 3315 } 3316 3317 bool NetBlocks::MergePartialFromCodedStream( 3318 ::google::protobuf::io::CodedInputStream* input) { 3319 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 3320 ::google::protobuf::uint32 tag; 3321 // @@protoc_insertion_point(parse_start:corepb.NetBlocks) 3322 for (;;) { 3323 ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); 3324 tag = p.first; 3325 if (!p.second) goto handle_unusual; 3326 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 3327 // string from = 1; 3328 case 1: { 3329 if (static_cast< ::google::protobuf::uint8>(tag) == 3330 static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { 3331 DO_(::google::protobuf::internal::WireFormatLite::ReadString( 3332 input, this->mutable_from())); 3333 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 3334 this->from().data(), static_cast<int>(this->from().length()), 3335 ::google::protobuf::internal::WireFormatLite::PARSE, 3336 "corepb.NetBlocks.from")); 3337 } else { 3338 goto handle_unusual; 3339 } 3340 break; 3341 } 3342 3343 // uint64 batch = 2; 3344 case 2: { 3345 if (static_cast< ::google::protobuf::uint8>(tag) == 3346 static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { 3347 3348 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 3349 ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( 3350 input, &batch_))); 3351 } else { 3352 goto handle_unusual; 3353 } 3354 break; 3355 } 3356 3357 // repeated .corepb.Block blocks = 3; 3358 case 3: { 3359 if (static_cast< ::google::protobuf::uint8>(tag) == 3360 static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { 3361 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( 3362 input, add_blocks())); 3363 } else { 3364 goto handle_unusual; 3365 } 3366 break; 3367 } 3368 3369 default: { 3370 handle_unusual: 3371 if (tag == 0) { 3372 goto success; 3373 } 3374 DO_(::google::protobuf::internal::WireFormat::SkipField( 3375 input, tag, _internal_metadata_.mutable_unknown_fields())); 3376 break; 3377 } 3378 } 3379 } 3380 success: 3381 // @@protoc_insertion_point(parse_success:corepb.NetBlocks) 3382 return true; 3383 failure: 3384 // @@protoc_insertion_point(parse_failure:corepb.NetBlocks) 3385 return false; 3386 #undef DO_ 3387 } 3388 3389 void NetBlocks::SerializeWithCachedSizes( 3390 ::google::protobuf::io::CodedOutputStream* output) const { 3391 // @@protoc_insertion_point(serialize_start:corepb.NetBlocks) 3392 ::google::protobuf::uint32 cached_has_bits = 0; 3393 (void) cached_has_bits; 3394 3395 // string from = 1; 3396 if (this->from().size() > 0) { 3397 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 3398 this->from().data(), static_cast<int>(this->from().length()), 3399 ::google::protobuf::internal::WireFormatLite::SERIALIZE, 3400 "corepb.NetBlocks.from"); 3401 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 3402 1, this->from(), output); 3403 } 3404 3405 // uint64 batch = 2; 3406 if (this->batch() != 0) { 3407 ::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->batch(), output); 3408 } 3409 3410 // repeated .corepb.Block blocks = 3; 3411 for (unsigned int i = 0, 3412 n = static_cast<unsigned int>(this->blocks_size()); i < n; i++) { 3413 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 3414 3, 3415 this->blocks(static_cast<int>(i)), 3416 output); 3417 } 3418 3419 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 3420 ::google::protobuf::internal::WireFormat::SerializeUnknownFields( 3421 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); 3422 } 3423 // @@protoc_insertion_point(serialize_end:corepb.NetBlocks) 3424 } 3425 3426 ::google::protobuf::uint8* NetBlocks::InternalSerializeWithCachedSizesToArray( 3427 bool deterministic, ::google::protobuf::uint8* target) const { 3428 (void)deterministic; // Unused 3429 // @@protoc_insertion_point(serialize_to_array_start:corepb.NetBlocks) 3430 ::google::protobuf::uint32 cached_has_bits = 0; 3431 (void) cached_has_bits; 3432 3433 // string from = 1; 3434 if (this->from().size() > 0) { 3435 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 3436 this->from().data(), static_cast<int>(this->from().length()), 3437 ::google::protobuf::internal::WireFormatLite::SERIALIZE, 3438 "corepb.NetBlocks.from"); 3439 target = 3440 ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3441 1, this->from(), target); 3442 } 3443 3444 // uint64 batch = 2; 3445 if (this->batch() != 0) { 3446 target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(2, this->batch(), target); 3447 } 3448 3449 // repeated .corepb.Block blocks = 3; 3450 for (unsigned int i = 0, 3451 n = static_cast<unsigned int>(this->blocks_size()); i < n; i++) { 3452 target = ::google::protobuf::internal::WireFormatLite:: 3453 InternalWriteMessageToArray( 3454 3, this->blocks(static_cast<int>(i)), deterministic, target); 3455 } 3456 3457 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 3458 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( 3459 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); 3460 } 3461 // @@protoc_insertion_point(serialize_to_array_end:corepb.NetBlocks) 3462 return target; 3463 } 3464 3465 size_t NetBlocks::ByteSizeLong() const { 3466 // @@protoc_insertion_point(message_byte_size_start:corepb.NetBlocks) 3467 size_t total_size = 0; 3468 3469 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 3470 total_size += 3471 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( 3472 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); 3473 } 3474 // repeated .corepb.Block blocks = 3; 3475 { 3476 unsigned int count = static_cast<unsigned int>(this->blocks_size()); 3477 total_size += 1UL * count; 3478 for (unsigned int i = 0; i < count; i++) { 3479 total_size += 3480 ::google::protobuf::internal::WireFormatLite::MessageSize( 3481 this->blocks(static_cast<int>(i))); 3482 } 3483 } 3484 3485 // string from = 1; 3486 if (this->from().size() > 0) { 3487 total_size += 1 + 3488 ::google::protobuf::internal::WireFormatLite::StringSize( 3489 this->from()); 3490 } 3491 3492 // uint64 batch = 2; 3493 if (this->batch() != 0) { 3494 total_size += 1 + 3495 ::google::protobuf::internal::WireFormatLite::UInt64Size( 3496 this->batch()); 3497 } 3498 3499 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 3500 SetCachedSize(cached_size); 3501 return total_size; 3502 } 3503 3504 void NetBlocks::MergeFrom(const ::google::protobuf::Message& from) { 3505 // @@protoc_insertion_point(generalized_merge_from_start:corepb.NetBlocks) 3506 GOOGLE_DCHECK_NE(&from, this); 3507 const NetBlocks* source = 3508 ::google::protobuf::internal::DynamicCastToGenerated<const NetBlocks>( 3509 &from); 3510 if (source == NULL) { 3511 // @@protoc_insertion_point(generalized_merge_from_cast_fail:corepb.NetBlocks) 3512 ::google::protobuf::internal::ReflectionOps::Merge(from, this); 3513 } else { 3514 // @@protoc_insertion_point(generalized_merge_from_cast_success:corepb.NetBlocks) 3515 MergeFrom(*source); 3516 } 3517 } 3518 3519 void NetBlocks::MergeFrom(const NetBlocks& from) { 3520 // @@protoc_insertion_point(class_specific_merge_from_start:corepb.NetBlocks) 3521 GOOGLE_DCHECK_NE(&from, this); 3522 _internal_metadata_.MergeFrom(from._internal_metadata_); 3523 ::google::protobuf::uint32 cached_has_bits = 0; 3524 (void) cached_has_bits; 3525 3526 blocks_.MergeFrom(from.blocks_); 3527 if (from.from().size() > 0) { 3528 3529 from_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.from_); 3530 } 3531 if (from.batch() != 0) { 3532 set_batch(from.batch()); 3533 } 3534 } 3535 3536 void NetBlocks::CopyFrom(const ::google::protobuf::Message& from) { 3537 // @@protoc_insertion_point(generalized_copy_from_start:corepb.NetBlocks) 3538 if (&from == this) return; 3539 Clear(); 3540 MergeFrom(from); 3541 } 3542 3543 void NetBlocks::CopyFrom(const NetBlocks& from) { 3544 // @@protoc_insertion_point(class_specific_copy_from_start:corepb.NetBlocks) 3545 if (&from == this) return; 3546 Clear(); 3547 MergeFrom(from); 3548 } 3549 3550 bool NetBlocks::IsInitialized() const { 3551 return true; 3552 } 3553 3554 void NetBlocks::Swap(NetBlocks* other) { 3555 if (other == this) return; 3556 InternalSwap(other); 3557 } 3558 void NetBlocks::InternalSwap(NetBlocks* other) { 3559 using std::swap; 3560 CastToBase(&blocks_)->InternalSwap(CastToBase(&other->blocks_)); 3561 from_.Swap(&other->from_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 3562 GetArenaNoVirtual()); 3563 swap(batch_, other->batch_); 3564 _internal_metadata_.Swap(&other->_internal_metadata_); 3565 } 3566 3567 ::google::protobuf::Metadata NetBlocks::GetMetadata() const { 3568 protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 3569 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages]; 3570 } 3571 3572 3573 // =================================================================== 3574 3575 void NetBlock::InitAsDefaultInstance() { 3576 ::corepb::_NetBlock_default_instance_._instance.get_mutable()->block_ = const_cast< ::corepb::Block*>( 3577 ::corepb::Block::internal_default_instance()); 3578 } 3579 #if !defined(_MSC_VER) || _MSC_VER >= 1900 3580 const int NetBlock::kFromFieldNumber; 3581 const int NetBlock::kBatchFieldNumber; 3582 const int NetBlock::kBlockFieldNumber; 3583 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 3584 3585 NetBlock::NetBlock() 3586 : ::google::protobuf::Message(), _internal_metadata_(NULL) { 3587 ::google::protobuf::internal::InitSCC( 3588 &protobuf_block_2eproto::scc_info_NetBlock.base); 3589 SharedCtor(); 3590 // @@protoc_insertion_point(constructor:corepb.NetBlock) 3591 } 3592 NetBlock::NetBlock(const NetBlock& from) 3593 : ::google::protobuf::Message(), 3594 _internal_metadata_(NULL) { 3595 _internal_metadata_.MergeFrom(from._internal_metadata_); 3596 from_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3597 if (from.from().size() > 0) { 3598 from_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.from_); 3599 } 3600 if (from.has_block()) { 3601 block_ = new ::corepb::Block(*from.block_); 3602 } else { 3603 block_ = NULL; 3604 } 3605 batch_ = from.batch_; 3606 // @@protoc_insertion_point(copy_constructor:corepb.NetBlock) 3607 } 3608 3609 void NetBlock::SharedCtor() { 3610 from_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3611 ::memset(&block_, 0, static_cast<size_t>( 3612 reinterpret_cast<char*>(&batch_) - 3613 reinterpret_cast<char*>(&block_)) + sizeof(batch_)); 3614 } 3615 3616 NetBlock::~NetBlock() { 3617 // @@protoc_insertion_point(destructor:corepb.NetBlock) 3618 SharedDtor(); 3619 } 3620 3621 void NetBlock::SharedDtor() { 3622 from_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3623 if (this != internal_default_instance()) delete block_; 3624 } 3625 3626 void NetBlock::SetCachedSize(int size) const { 3627 _cached_size_.Set(size); 3628 } 3629 const ::google::protobuf::Descriptor* NetBlock::descriptor() { 3630 ::protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 3631 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; 3632 } 3633 3634 const NetBlock& NetBlock::default_instance() { 3635 ::google::protobuf::internal::InitSCC(&protobuf_block_2eproto::scc_info_NetBlock.base); 3636 return *internal_default_instance(); 3637 } 3638 3639 3640 void NetBlock::Clear() { 3641 // @@protoc_insertion_point(message_clear_start:corepb.NetBlock) 3642 ::google::protobuf::uint32 cached_has_bits = 0; 3643 // Prevent compiler warnings about cached_has_bits being unused 3644 (void) cached_has_bits; 3645 3646 from_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3647 if (GetArenaNoVirtual() == NULL && block_ != NULL) { 3648 delete block_; 3649 } 3650 block_ = NULL; 3651 batch_ = GOOGLE_ULONGLONG(0); 3652 _internal_metadata_.Clear(); 3653 } 3654 3655 bool NetBlock::MergePartialFromCodedStream( 3656 ::google::protobuf::io::CodedInputStream* input) { 3657 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 3658 ::google::protobuf::uint32 tag; 3659 // @@protoc_insertion_point(parse_start:corepb.NetBlock) 3660 for (;;) { 3661 ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); 3662 tag = p.first; 3663 if (!p.second) goto handle_unusual; 3664 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 3665 // string from = 1; 3666 case 1: { 3667 if (static_cast< ::google::protobuf::uint8>(tag) == 3668 static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { 3669 DO_(::google::protobuf::internal::WireFormatLite::ReadString( 3670 input, this->mutable_from())); 3671 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 3672 this->from().data(), static_cast<int>(this->from().length()), 3673 ::google::protobuf::internal::WireFormatLite::PARSE, 3674 "corepb.NetBlock.from")); 3675 } else { 3676 goto handle_unusual; 3677 } 3678 break; 3679 } 3680 3681 // uint64 batch = 2; 3682 case 2: { 3683 if (static_cast< ::google::protobuf::uint8>(tag) == 3684 static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { 3685 3686 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 3687 ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( 3688 input, &batch_))); 3689 } else { 3690 goto handle_unusual; 3691 } 3692 break; 3693 } 3694 3695 // .corepb.Block block = 3; 3696 case 3: { 3697 if (static_cast< ::google::protobuf::uint8>(tag) == 3698 static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { 3699 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( 3700 input, mutable_block())); 3701 } else { 3702 goto handle_unusual; 3703 } 3704 break; 3705 } 3706 3707 default: { 3708 handle_unusual: 3709 if (tag == 0) { 3710 goto success; 3711 } 3712 DO_(::google::protobuf::internal::WireFormat::SkipField( 3713 input, tag, _internal_metadata_.mutable_unknown_fields())); 3714 break; 3715 } 3716 } 3717 } 3718 success: 3719 // @@protoc_insertion_point(parse_success:corepb.NetBlock) 3720 return true; 3721 failure: 3722 // @@protoc_insertion_point(parse_failure:corepb.NetBlock) 3723 return false; 3724 #undef DO_ 3725 } 3726 3727 void NetBlock::SerializeWithCachedSizes( 3728 ::google::protobuf::io::CodedOutputStream* output) const { 3729 // @@protoc_insertion_point(serialize_start:corepb.NetBlock) 3730 ::google::protobuf::uint32 cached_has_bits = 0; 3731 (void) cached_has_bits; 3732 3733 // string from = 1; 3734 if (this->from().size() > 0) { 3735 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 3736 this->from().data(), static_cast<int>(this->from().length()), 3737 ::google::protobuf::internal::WireFormatLite::SERIALIZE, 3738 "corepb.NetBlock.from"); 3739 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 3740 1, this->from(), output); 3741 } 3742 3743 // uint64 batch = 2; 3744 if (this->batch() != 0) { 3745 ::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->batch(), output); 3746 } 3747 3748 // .corepb.Block block = 3; 3749 if (this->has_block()) { 3750 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 3751 3, this->_internal_block(), output); 3752 } 3753 3754 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 3755 ::google::protobuf::internal::WireFormat::SerializeUnknownFields( 3756 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); 3757 } 3758 // @@protoc_insertion_point(serialize_end:corepb.NetBlock) 3759 } 3760 3761 ::google::protobuf::uint8* NetBlock::InternalSerializeWithCachedSizesToArray( 3762 bool deterministic, ::google::protobuf::uint8* target) const { 3763 (void)deterministic; // Unused 3764 // @@protoc_insertion_point(serialize_to_array_start:corepb.NetBlock) 3765 ::google::protobuf::uint32 cached_has_bits = 0; 3766 (void) cached_has_bits; 3767 3768 // string from = 1; 3769 if (this->from().size() > 0) { 3770 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 3771 this->from().data(), static_cast<int>(this->from().length()), 3772 ::google::protobuf::internal::WireFormatLite::SERIALIZE, 3773 "corepb.NetBlock.from"); 3774 target = 3775 ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3776 1, this->from(), target); 3777 } 3778 3779 // uint64 batch = 2; 3780 if (this->batch() != 0) { 3781 target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(2, this->batch(), target); 3782 } 3783 3784 // .corepb.Block block = 3; 3785 if (this->has_block()) { 3786 target = ::google::protobuf::internal::WireFormatLite:: 3787 InternalWriteMessageToArray( 3788 3, this->_internal_block(), deterministic, target); 3789 } 3790 3791 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 3792 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( 3793 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); 3794 } 3795 // @@protoc_insertion_point(serialize_to_array_end:corepb.NetBlock) 3796 return target; 3797 } 3798 3799 size_t NetBlock::ByteSizeLong() const { 3800 // @@protoc_insertion_point(message_byte_size_start:corepb.NetBlock) 3801 size_t total_size = 0; 3802 3803 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 3804 total_size += 3805 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( 3806 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); 3807 } 3808 // string from = 1; 3809 if (this->from().size() > 0) { 3810 total_size += 1 + 3811 ::google::protobuf::internal::WireFormatLite::StringSize( 3812 this->from()); 3813 } 3814 3815 // .corepb.Block block = 3; 3816 if (this->has_block()) { 3817 total_size += 1 + 3818 ::google::protobuf::internal::WireFormatLite::MessageSize( 3819 *block_); 3820 } 3821 3822 // uint64 batch = 2; 3823 if (this->batch() != 0) { 3824 total_size += 1 + 3825 ::google::protobuf::internal::WireFormatLite::UInt64Size( 3826 this->batch()); 3827 } 3828 3829 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 3830 SetCachedSize(cached_size); 3831 return total_size; 3832 } 3833 3834 void NetBlock::MergeFrom(const ::google::protobuf::Message& from) { 3835 // @@protoc_insertion_point(generalized_merge_from_start:corepb.NetBlock) 3836 GOOGLE_DCHECK_NE(&from, this); 3837 const NetBlock* source = 3838 ::google::protobuf::internal::DynamicCastToGenerated<const NetBlock>( 3839 &from); 3840 if (source == NULL) { 3841 // @@protoc_insertion_point(generalized_merge_from_cast_fail:corepb.NetBlock) 3842 ::google::protobuf::internal::ReflectionOps::Merge(from, this); 3843 } else { 3844 // @@protoc_insertion_point(generalized_merge_from_cast_success:corepb.NetBlock) 3845 MergeFrom(*source); 3846 } 3847 } 3848 3849 void NetBlock::MergeFrom(const NetBlock& from) { 3850 // @@protoc_insertion_point(class_specific_merge_from_start:corepb.NetBlock) 3851 GOOGLE_DCHECK_NE(&from, this); 3852 _internal_metadata_.MergeFrom(from._internal_metadata_); 3853 ::google::protobuf::uint32 cached_has_bits = 0; 3854 (void) cached_has_bits; 3855 3856 if (from.from().size() > 0) { 3857 3858 from_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.from_); 3859 } 3860 if (from.has_block()) { 3861 mutable_block()->::corepb::Block::MergeFrom(from.block()); 3862 } 3863 if (from.batch() != 0) { 3864 set_batch(from.batch()); 3865 } 3866 } 3867 3868 void NetBlock::CopyFrom(const ::google::protobuf::Message& from) { 3869 // @@protoc_insertion_point(generalized_copy_from_start:corepb.NetBlock) 3870 if (&from == this) return; 3871 Clear(); 3872 MergeFrom(from); 3873 } 3874 3875 void NetBlock::CopyFrom(const NetBlock& from) { 3876 // @@protoc_insertion_point(class_specific_copy_from_start:corepb.NetBlock) 3877 if (&from == this) return; 3878 Clear(); 3879 MergeFrom(from); 3880 } 3881 3882 bool NetBlock::IsInitialized() const { 3883 return true; 3884 } 3885 3886 void NetBlock::Swap(NetBlock* other) { 3887 if (other == this) return; 3888 InternalSwap(other); 3889 } 3890 void NetBlock::InternalSwap(NetBlock* other) { 3891 using std::swap; 3892 from_.Swap(&other->from_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 3893 GetArenaNoVirtual()); 3894 swap(block_, other->block_); 3895 swap(batch_, other->batch_); 3896 _internal_metadata_.Swap(&other->_internal_metadata_); 3897 } 3898 3899 ::google::protobuf::Metadata NetBlock::GetMetadata() const { 3900 protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 3901 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages]; 3902 } 3903 3904 3905 // =================================================================== 3906 3907 void DownloadBlock::InitAsDefaultInstance() { 3908 } 3909 #if !defined(_MSC_VER) || _MSC_VER >= 1900 3910 const int DownloadBlock::kHashFieldNumber; 3911 const int DownloadBlock::kSignFieldNumber; 3912 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 3913 3914 DownloadBlock::DownloadBlock() 3915 : ::google::protobuf::Message(), _internal_metadata_(NULL) { 3916 ::google::protobuf::internal::InitSCC( 3917 &protobuf_block_2eproto::scc_info_DownloadBlock.base); 3918 SharedCtor(); 3919 // @@protoc_insertion_point(constructor:corepb.DownloadBlock) 3920 } 3921 DownloadBlock::DownloadBlock(const DownloadBlock& from) 3922 : ::google::protobuf::Message(), 3923 _internal_metadata_(NULL) { 3924 _internal_metadata_.MergeFrom(from._internal_metadata_); 3925 hash_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3926 if (from.hash().size() > 0) { 3927 hash_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.hash_); 3928 } 3929 sign_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3930 if (from.sign().size() > 0) { 3931 sign_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.sign_); 3932 } 3933 // @@protoc_insertion_point(copy_constructor:corepb.DownloadBlock) 3934 } 3935 3936 void DownloadBlock::SharedCtor() { 3937 hash_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3938 sign_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3939 } 3940 3941 DownloadBlock::~DownloadBlock() { 3942 // @@protoc_insertion_point(destructor:corepb.DownloadBlock) 3943 SharedDtor(); 3944 } 3945 3946 void DownloadBlock::SharedDtor() { 3947 hash_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3948 sign_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3949 } 3950 3951 void DownloadBlock::SetCachedSize(int size) const { 3952 _cached_size_.Set(size); 3953 } 3954 const ::google::protobuf::Descriptor* DownloadBlock::descriptor() { 3955 ::protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 3956 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; 3957 } 3958 3959 const DownloadBlock& DownloadBlock::default_instance() { 3960 ::google::protobuf::internal::InitSCC(&protobuf_block_2eproto::scc_info_DownloadBlock.base); 3961 return *internal_default_instance(); 3962 } 3963 3964 3965 void DownloadBlock::Clear() { 3966 // @@protoc_insertion_point(message_clear_start:corepb.DownloadBlock) 3967 ::google::protobuf::uint32 cached_has_bits = 0; 3968 // Prevent compiler warnings about cached_has_bits being unused 3969 (void) cached_has_bits; 3970 3971 hash_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3972 sign_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 3973 _internal_metadata_.Clear(); 3974 } 3975 3976 bool DownloadBlock::MergePartialFromCodedStream( 3977 ::google::protobuf::io::CodedInputStream* input) { 3978 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 3979 ::google::protobuf::uint32 tag; 3980 // @@protoc_insertion_point(parse_start:corepb.DownloadBlock) 3981 for (;;) { 3982 ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); 3983 tag = p.first; 3984 if (!p.second) goto handle_unusual; 3985 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 3986 // bytes hash = 1; 3987 case 1: { 3988 if (static_cast< ::google::protobuf::uint8>(tag) == 3989 static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { 3990 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 3991 input, this->mutable_hash())); 3992 } else { 3993 goto handle_unusual; 3994 } 3995 break; 3996 } 3997 3998 // bytes sign = 2; 3999 case 2: { 4000 if (static_cast< ::google::protobuf::uint8>(tag) == 4001 static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { 4002 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 4003 input, this->mutable_sign())); 4004 } else { 4005 goto handle_unusual; 4006 } 4007 break; 4008 } 4009 4010 default: { 4011 handle_unusual: 4012 if (tag == 0) { 4013 goto success; 4014 } 4015 DO_(::google::protobuf::internal::WireFormat::SkipField( 4016 input, tag, _internal_metadata_.mutable_unknown_fields())); 4017 break; 4018 } 4019 } 4020 } 4021 success: 4022 // @@protoc_insertion_point(parse_success:corepb.DownloadBlock) 4023 return true; 4024 failure: 4025 // @@protoc_insertion_point(parse_failure:corepb.DownloadBlock) 4026 return false; 4027 #undef DO_ 4028 } 4029 4030 void DownloadBlock::SerializeWithCachedSizes( 4031 ::google::protobuf::io::CodedOutputStream* output) const { 4032 // @@protoc_insertion_point(serialize_start:corepb.DownloadBlock) 4033 ::google::protobuf::uint32 cached_has_bits = 0; 4034 (void) cached_has_bits; 4035 4036 // bytes hash = 1; 4037 if (this->hash().size() > 0) { 4038 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 4039 1, this->hash(), output); 4040 } 4041 4042 // bytes sign = 2; 4043 if (this->sign().size() > 0) { 4044 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 4045 2, this->sign(), output); 4046 } 4047 4048 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 4049 ::google::protobuf::internal::WireFormat::SerializeUnknownFields( 4050 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); 4051 } 4052 // @@protoc_insertion_point(serialize_end:corepb.DownloadBlock) 4053 } 4054 4055 ::google::protobuf::uint8* DownloadBlock::InternalSerializeWithCachedSizesToArray( 4056 bool deterministic, ::google::protobuf::uint8* target) const { 4057 (void)deterministic; // Unused 4058 // @@protoc_insertion_point(serialize_to_array_start:corepb.DownloadBlock) 4059 ::google::protobuf::uint32 cached_has_bits = 0; 4060 (void) cached_has_bits; 4061 4062 // bytes hash = 1; 4063 if (this->hash().size() > 0) { 4064 target = 4065 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 4066 1, this->hash(), target); 4067 } 4068 4069 // bytes sign = 2; 4070 if (this->sign().size() > 0) { 4071 target = 4072 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 4073 2, this->sign(), target); 4074 } 4075 4076 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 4077 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( 4078 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); 4079 } 4080 // @@protoc_insertion_point(serialize_to_array_end:corepb.DownloadBlock) 4081 return target; 4082 } 4083 4084 size_t DownloadBlock::ByteSizeLong() const { 4085 // @@protoc_insertion_point(message_byte_size_start:corepb.DownloadBlock) 4086 size_t total_size = 0; 4087 4088 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 4089 total_size += 4090 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( 4091 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); 4092 } 4093 // bytes hash = 1; 4094 if (this->hash().size() > 0) { 4095 total_size += 1 + 4096 ::google::protobuf::internal::WireFormatLite::BytesSize( 4097 this->hash()); 4098 } 4099 4100 // bytes sign = 2; 4101 if (this->sign().size() > 0) { 4102 total_size += 1 + 4103 ::google::protobuf::internal::WireFormatLite::BytesSize( 4104 this->sign()); 4105 } 4106 4107 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 4108 SetCachedSize(cached_size); 4109 return total_size; 4110 } 4111 4112 void DownloadBlock::MergeFrom(const ::google::protobuf::Message& from) { 4113 // @@protoc_insertion_point(generalized_merge_from_start:corepb.DownloadBlock) 4114 GOOGLE_DCHECK_NE(&from, this); 4115 const DownloadBlock* source = 4116 ::google::protobuf::internal::DynamicCastToGenerated<const DownloadBlock>( 4117 &from); 4118 if (source == NULL) { 4119 // @@protoc_insertion_point(generalized_merge_from_cast_fail:corepb.DownloadBlock) 4120 ::google::protobuf::internal::ReflectionOps::Merge(from, this); 4121 } else { 4122 // @@protoc_insertion_point(generalized_merge_from_cast_success:corepb.DownloadBlock) 4123 MergeFrom(*source); 4124 } 4125 } 4126 4127 void DownloadBlock::MergeFrom(const DownloadBlock& from) { 4128 // @@protoc_insertion_point(class_specific_merge_from_start:corepb.DownloadBlock) 4129 GOOGLE_DCHECK_NE(&from, this); 4130 _internal_metadata_.MergeFrom(from._internal_metadata_); 4131 ::google::protobuf::uint32 cached_has_bits = 0; 4132 (void) cached_has_bits; 4133 4134 if (from.hash().size() > 0) { 4135 4136 hash_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.hash_); 4137 } 4138 if (from.sign().size() > 0) { 4139 4140 sign_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.sign_); 4141 } 4142 } 4143 4144 void DownloadBlock::CopyFrom(const ::google::protobuf::Message& from) { 4145 // @@protoc_insertion_point(generalized_copy_from_start:corepb.DownloadBlock) 4146 if (&from == this) return; 4147 Clear(); 4148 MergeFrom(from); 4149 } 4150 4151 void DownloadBlock::CopyFrom(const DownloadBlock& from) { 4152 // @@protoc_insertion_point(class_specific_copy_from_start:corepb.DownloadBlock) 4153 if (&from == this) return; 4154 Clear(); 4155 MergeFrom(from); 4156 } 4157 4158 bool DownloadBlock::IsInitialized() const { 4159 return true; 4160 } 4161 4162 void DownloadBlock::Swap(DownloadBlock* other) { 4163 if (other == this) return; 4164 InternalSwap(other); 4165 } 4166 void DownloadBlock::InternalSwap(DownloadBlock* other) { 4167 using std::swap; 4168 hash_.Swap(&other->hash_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 4169 GetArenaNoVirtual()); 4170 sign_.Swap(&other->sign_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 4171 GetArenaNoVirtual()); 4172 _internal_metadata_.Swap(&other->_internal_metadata_); 4173 } 4174 4175 ::google::protobuf::Metadata DownloadBlock::GetMetadata() const { 4176 protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 4177 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages]; 4178 } 4179 4180 4181 // =================================================================== 4182 4183 void Random::InitAsDefaultInstance() { 4184 } 4185 #if !defined(_MSC_VER) || _MSC_VER >= 1900 4186 const int Random::kVrfSeedFieldNumber; 4187 const int Random::kVrfProofFieldNumber; 4188 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 4189 4190 Random::Random() 4191 : ::google::protobuf::Message(), _internal_metadata_(NULL) { 4192 ::google::protobuf::internal::InitSCC( 4193 &protobuf_block_2eproto::scc_info_Random.base); 4194 SharedCtor(); 4195 // @@protoc_insertion_point(constructor:corepb.Random) 4196 } 4197 Random::Random(const Random& from) 4198 : ::google::protobuf::Message(), 4199 _internal_metadata_(NULL) { 4200 _internal_metadata_.MergeFrom(from._internal_metadata_); 4201 vrf_seed_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 4202 if (from.vrf_seed().size() > 0) { 4203 vrf_seed_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.vrf_seed_); 4204 } 4205 vrf_proof_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 4206 if (from.vrf_proof().size() > 0) { 4207 vrf_proof_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.vrf_proof_); 4208 } 4209 // @@protoc_insertion_point(copy_constructor:corepb.Random) 4210 } 4211 4212 void Random::SharedCtor() { 4213 vrf_seed_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 4214 vrf_proof_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 4215 } 4216 4217 Random::~Random() { 4218 // @@protoc_insertion_point(destructor:corepb.Random) 4219 SharedDtor(); 4220 } 4221 4222 void Random::SharedDtor() { 4223 vrf_seed_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 4224 vrf_proof_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 4225 } 4226 4227 void Random::SetCachedSize(int size) const { 4228 _cached_size_.Set(size); 4229 } 4230 const ::google::protobuf::Descriptor* Random::descriptor() { 4231 ::protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 4232 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; 4233 } 4234 4235 const Random& Random::default_instance() { 4236 ::google::protobuf::internal::InitSCC(&protobuf_block_2eproto::scc_info_Random.base); 4237 return *internal_default_instance(); 4238 } 4239 4240 4241 void Random::Clear() { 4242 // @@protoc_insertion_point(message_clear_start:corepb.Random) 4243 ::google::protobuf::uint32 cached_has_bits = 0; 4244 // Prevent compiler warnings about cached_has_bits being unused 4245 (void) cached_has_bits; 4246 4247 vrf_seed_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 4248 vrf_proof_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 4249 _internal_metadata_.Clear(); 4250 } 4251 4252 bool Random::MergePartialFromCodedStream( 4253 ::google::protobuf::io::CodedInputStream* input) { 4254 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 4255 ::google::protobuf::uint32 tag; 4256 // @@protoc_insertion_point(parse_start:corepb.Random) 4257 for (;;) { 4258 ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); 4259 tag = p.first; 4260 if (!p.second) goto handle_unusual; 4261 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 4262 // bytes vrf_seed = 1; 4263 case 1: { 4264 if (static_cast< ::google::protobuf::uint8>(tag) == 4265 static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { 4266 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 4267 input, this->mutable_vrf_seed())); 4268 } else { 4269 goto handle_unusual; 4270 } 4271 break; 4272 } 4273 4274 // bytes vrf_proof = 2; 4275 case 2: { 4276 if (static_cast< ::google::protobuf::uint8>(tag) == 4277 static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { 4278 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( 4279 input, this->mutable_vrf_proof())); 4280 } else { 4281 goto handle_unusual; 4282 } 4283 break; 4284 } 4285 4286 default: { 4287 handle_unusual: 4288 if (tag == 0) { 4289 goto success; 4290 } 4291 DO_(::google::protobuf::internal::WireFormat::SkipField( 4292 input, tag, _internal_metadata_.mutable_unknown_fields())); 4293 break; 4294 } 4295 } 4296 } 4297 success: 4298 // @@protoc_insertion_point(parse_success:corepb.Random) 4299 return true; 4300 failure: 4301 // @@protoc_insertion_point(parse_failure:corepb.Random) 4302 return false; 4303 #undef DO_ 4304 } 4305 4306 void Random::SerializeWithCachedSizes( 4307 ::google::protobuf::io::CodedOutputStream* output) const { 4308 // @@protoc_insertion_point(serialize_start:corepb.Random) 4309 ::google::protobuf::uint32 cached_has_bits = 0; 4310 (void) cached_has_bits; 4311 4312 // bytes vrf_seed = 1; 4313 if (this->vrf_seed().size() > 0) { 4314 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 4315 1, this->vrf_seed(), output); 4316 } 4317 4318 // bytes vrf_proof = 2; 4319 if (this->vrf_proof().size() > 0) { 4320 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 4321 2, this->vrf_proof(), output); 4322 } 4323 4324 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 4325 ::google::protobuf::internal::WireFormat::SerializeUnknownFields( 4326 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); 4327 } 4328 // @@protoc_insertion_point(serialize_end:corepb.Random) 4329 } 4330 4331 ::google::protobuf::uint8* Random::InternalSerializeWithCachedSizesToArray( 4332 bool deterministic, ::google::protobuf::uint8* target) const { 4333 (void)deterministic; // Unused 4334 // @@protoc_insertion_point(serialize_to_array_start:corepb.Random) 4335 ::google::protobuf::uint32 cached_has_bits = 0; 4336 (void) cached_has_bits; 4337 4338 // bytes vrf_seed = 1; 4339 if (this->vrf_seed().size() > 0) { 4340 target = 4341 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 4342 1, this->vrf_seed(), target); 4343 } 4344 4345 // bytes vrf_proof = 2; 4346 if (this->vrf_proof().size() > 0) { 4347 target = 4348 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 4349 2, this->vrf_proof(), target); 4350 } 4351 4352 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 4353 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( 4354 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); 4355 } 4356 // @@protoc_insertion_point(serialize_to_array_end:corepb.Random) 4357 return target; 4358 } 4359 4360 size_t Random::ByteSizeLong() const { 4361 // @@protoc_insertion_point(message_byte_size_start:corepb.Random) 4362 size_t total_size = 0; 4363 4364 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { 4365 total_size += 4366 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( 4367 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); 4368 } 4369 // bytes vrf_seed = 1; 4370 if (this->vrf_seed().size() > 0) { 4371 total_size += 1 + 4372 ::google::protobuf::internal::WireFormatLite::BytesSize( 4373 this->vrf_seed()); 4374 } 4375 4376 // bytes vrf_proof = 2; 4377 if (this->vrf_proof().size() > 0) { 4378 total_size += 1 + 4379 ::google::protobuf::internal::WireFormatLite::BytesSize( 4380 this->vrf_proof()); 4381 } 4382 4383 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 4384 SetCachedSize(cached_size); 4385 return total_size; 4386 } 4387 4388 void Random::MergeFrom(const ::google::protobuf::Message& from) { 4389 // @@protoc_insertion_point(generalized_merge_from_start:corepb.Random) 4390 GOOGLE_DCHECK_NE(&from, this); 4391 const Random* source = 4392 ::google::protobuf::internal::DynamicCastToGenerated<const Random>( 4393 &from); 4394 if (source == NULL) { 4395 // @@protoc_insertion_point(generalized_merge_from_cast_fail:corepb.Random) 4396 ::google::protobuf::internal::ReflectionOps::Merge(from, this); 4397 } else { 4398 // @@protoc_insertion_point(generalized_merge_from_cast_success:corepb.Random) 4399 MergeFrom(*source); 4400 } 4401 } 4402 4403 void Random::MergeFrom(const Random& from) { 4404 // @@protoc_insertion_point(class_specific_merge_from_start:corepb.Random) 4405 GOOGLE_DCHECK_NE(&from, this); 4406 _internal_metadata_.MergeFrom(from._internal_metadata_); 4407 ::google::protobuf::uint32 cached_has_bits = 0; 4408 (void) cached_has_bits; 4409 4410 if (from.vrf_seed().size() > 0) { 4411 4412 vrf_seed_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.vrf_seed_); 4413 } 4414 if (from.vrf_proof().size() > 0) { 4415 4416 vrf_proof_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.vrf_proof_); 4417 } 4418 } 4419 4420 void Random::CopyFrom(const ::google::protobuf::Message& from) { 4421 // @@protoc_insertion_point(generalized_copy_from_start:corepb.Random) 4422 if (&from == this) return; 4423 Clear(); 4424 MergeFrom(from); 4425 } 4426 4427 void Random::CopyFrom(const Random& from) { 4428 // @@protoc_insertion_point(class_specific_copy_from_start:corepb.Random) 4429 if (&from == this) return; 4430 Clear(); 4431 MergeFrom(from); 4432 } 4433 4434 bool Random::IsInitialized() const { 4435 return true; 4436 } 4437 4438 void Random::Swap(Random* other) { 4439 if (other == this) return; 4440 InternalSwap(other); 4441 } 4442 void Random::InternalSwap(Random* other) { 4443 using std::swap; 4444 vrf_seed_.Swap(&other->vrf_seed_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 4445 GetArenaNoVirtual()); 4446 vrf_proof_.Swap(&other->vrf_proof_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), 4447 GetArenaNoVirtual()); 4448 _internal_metadata_.Swap(&other->_internal_metadata_); 4449 } 4450 4451 ::google::protobuf::Metadata Random::GetMetadata() const { 4452 protobuf_block_2eproto::protobuf_AssignDescriptorsOnce(); 4453 return ::protobuf_block_2eproto::file_level_metadata[kIndexInFileMessages]; 4454 } 4455 4456 4457 // @@protoc_insertion_point(namespace_scope) 4458 } // namespace corepb 4459 namespace google { 4460 namespace protobuf { 4461 template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::corepb::Account* Arena::CreateMaybeMessage< ::corepb::Account >(Arena* arena) { 4462 return Arena::CreateInternal< ::corepb::Account >(arena); 4463 } 4464 template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::corepb::ContractMeta* Arena::CreateMaybeMessage< ::corepb::ContractMeta >(Arena* arena) { 4465 return Arena::CreateInternal< ::corepb::ContractMeta >(arena); 4466 } 4467 template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::corepb::Data* Arena::CreateMaybeMessage< ::corepb::Data >(Arena* arena) { 4468 return Arena::CreateInternal< ::corepb::Data >(arena); 4469 } 4470 template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::corepb::Transaction* Arena::CreateMaybeMessage< ::corepb::Transaction >(Arena* arena) { 4471 return Arena::CreateInternal< ::corepb::Transaction >(arena); 4472 } 4473 template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::corepb::BlockHeader* Arena::CreateMaybeMessage< ::corepb::BlockHeader >(Arena* arena) { 4474 return Arena::CreateInternal< ::corepb::BlockHeader >(arena); 4475 } 4476 template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::corepb::Block* Arena::CreateMaybeMessage< ::corepb::Block >(Arena* arena) { 4477 return Arena::CreateInternal< ::corepb::Block >(arena); 4478 } 4479 template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::corepb::NetBlocks* Arena::CreateMaybeMessage< ::corepb::NetBlocks >(Arena* arena) { 4480 return Arena::CreateInternal< ::corepb::NetBlocks >(arena); 4481 } 4482 template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::corepb::NetBlock* Arena::CreateMaybeMessage< ::corepb::NetBlock >(Arena* arena) { 4483 return Arena::CreateInternal< ::corepb::NetBlock >(arena); 4484 } 4485 template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::corepb::DownloadBlock* Arena::CreateMaybeMessage< ::corepb::DownloadBlock >(Arena* arena) { 4486 return Arena::CreateInternal< ::corepb::DownloadBlock >(arena); 4487 } 4488 template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::corepb::Random* Arena::CreateMaybeMessage< ::corepb::Random >(Arena* arena) { 4489 return Arena::CreateInternal< ::corepb::Random >(arena); 4490 } 4491 } // namespace protobuf 4492 } // namespace google 4493 4494 // @@protoc_insertion_point(global_scope)