github.com/hyperledger/burrow@v0.34.5-0.20220512172541-77f09336001d/js/proto/acm_pb.js (about) 1 // source: acm.proto 2 /** 3 * @fileoverview 4 * @enhanceable 5 * @suppress {missingRequire} reports error on implicit type usages. 6 * @suppress {messageConventions} JS Compiler reports an error if a variable or 7 * field starts with 'MSG_' and isn't a translatable message. 8 * @public 9 */ 10 // GENERATED CODE -- DO NOT EDIT! 11 /* eslint-disable */ 12 // @ts-nocheck 13 14 var jspb = require('google-protobuf'); 15 var goog = jspb; 16 var global = Function('return this')(); 17 18 var gogoproto_gogo_pb = require('./gogoproto/gogo_pb.js'); 19 goog.object.extend(proto, gogoproto_gogo_pb); 20 var permission_pb = require('./permission_pb.js'); 21 goog.object.extend(proto, permission_pb); 22 var crypto_pb = require('./crypto_pb.js'); 23 goog.object.extend(proto, crypto_pb); 24 goog.exportSymbol('proto.acm.Account', null, global); 25 goog.exportSymbol('proto.acm.ContractMeta', null, global); 26 /** 27 * Generated by JsPbCodeGenerator. 28 * @param {Array=} opt_data Optional initial data array, typically from a 29 * server response, or constructed directly in Javascript. The array is used 30 * in place and becomes part of the constructed object. It is not cloned. 31 * If no data is provided, the constructed object will be empty, but still 32 * valid. 33 * @extends {jspb.Message} 34 * @constructor 35 */ 36 proto.acm.Account = function(opt_data) { 37 jspb.Message.initialize(this, opt_data, 0, -1, proto.acm.Account.repeatedFields_, null); 38 }; 39 goog.inherits(proto.acm.Account, jspb.Message); 40 if (goog.DEBUG && !COMPILED) { 41 /** 42 * @public 43 * @override 44 */ 45 proto.acm.Account.displayName = 'proto.acm.Account'; 46 } 47 /** 48 * Generated by JsPbCodeGenerator. 49 * @param {Array=} opt_data Optional initial data array, typically from a 50 * server response, or constructed directly in Javascript. The array is used 51 * in place and becomes part of the constructed object. It is not cloned. 52 * If no data is provided, the constructed object will be empty, but still 53 * valid. 54 * @extends {jspb.Message} 55 * @constructor 56 */ 57 proto.acm.ContractMeta = function(opt_data) { 58 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 59 }; 60 goog.inherits(proto.acm.ContractMeta, jspb.Message); 61 if (goog.DEBUG && !COMPILED) { 62 /** 63 * @public 64 * @override 65 */ 66 proto.acm.ContractMeta.displayName = 'proto.acm.ContractMeta'; 67 } 68 69 /** 70 * List of repeated fields within this message type. 71 * @private {!Array<number>} 72 * @const 73 */ 74 proto.acm.Account.repeatedFields_ = [9]; 75 76 77 78 if (jspb.Message.GENERATE_TO_OBJECT) { 79 /** 80 * Creates an object representation of this proto. 81 * Field names that are reserved in JavaScript and will be renamed to pb_name. 82 * Optional fields that are not set will be set to undefined. 83 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 84 * For the list of reserved names please see: 85 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 86 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 87 * JSPB instance for transitional soy proto support: 88 * http://goto/soy-param-migration 89 * @return {!Object} 90 */ 91 proto.acm.Account.prototype.toObject = function(opt_includeInstance) { 92 return proto.acm.Account.toObject(opt_includeInstance, this); 93 }; 94 95 96 /** 97 * Static version of the {@see toObject} method. 98 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 99 * the JSPB instance for transitional soy proto support: 100 * http://goto/soy-param-migration 101 * @param {!proto.acm.Account} msg The msg instance to transform. 102 * @return {!Object} 103 * @suppress {unusedLocalVariables} f is only used for nested messages 104 */ 105 proto.acm.Account.toObject = function(includeInstance, msg) { 106 var f, obj = { 107 address: msg.getAddress_asB64(), 108 publickey: (f = msg.getPublickey()) && crypto_pb.PublicKey.toObject(includeInstance, f), 109 sequence: jspb.Message.getFieldWithDefault(msg, 3, 0), 110 balance: jspb.Message.getFieldWithDefault(msg, 4, 0), 111 evmcode: msg.getEvmcode_asB64(), 112 permissions: (f = msg.getPermissions()) && permission_pb.AccountPermissions.toObject(includeInstance, f), 113 wasmcode: msg.getWasmcode_asB64(), 114 nativename: jspb.Message.getFieldWithDefault(msg, 11, ""), 115 codehash: msg.getCodehash_asB64(), 116 contractmetaList: jspb.Message.toObjectList(msg.getContractmetaList(), 117 proto.acm.ContractMeta.toObject, includeInstance), 118 forebear: msg.getForebear_asB64() 119 }; 120 121 if (includeInstance) { 122 obj.$jspbMessageInstance = msg; 123 } 124 return obj; 125 }; 126 } 127 128 129 /** 130 * Deserializes binary data (in protobuf wire format). 131 * @param {jspb.ByteSource} bytes The bytes to deserialize. 132 * @return {!proto.acm.Account} 133 */ 134 proto.acm.Account.deserializeBinary = function(bytes) { 135 var reader = new jspb.BinaryReader(bytes); 136 var msg = new proto.acm.Account; 137 return proto.acm.Account.deserializeBinaryFromReader(msg, reader); 138 }; 139 140 141 /** 142 * Deserializes binary data (in protobuf wire format) from the 143 * given reader into the given message object. 144 * @param {!proto.acm.Account} msg The message object to deserialize into. 145 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 146 * @return {!proto.acm.Account} 147 */ 148 proto.acm.Account.deserializeBinaryFromReader = function(msg, reader) { 149 while (reader.nextField()) { 150 if (reader.isEndGroup()) { 151 break; 152 } 153 var field = reader.getFieldNumber(); 154 switch (field) { 155 case 1: 156 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 157 msg.setAddress(value); 158 break; 159 case 2: 160 var value = new crypto_pb.PublicKey; 161 reader.readMessage(value,crypto_pb.PublicKey.deserializeBinaryFromReader); 162 msg.setPublickey(value); 163 break; 164 case 3: 165 var value = /** @type {number} */ (reader.readUint64()); 166 msg.setSequence(value); 167 break; 168 case 4: 169 var value = /** @type {number} */ (reader.readUint64()); 170 msg.setBalance(value); 171 break; 172 case 5: 173 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 174 msg.setEvmcode(value); 175 break; 176 case 6: 177 var value = new permission_pb.AccountPermissions; 178 reader.readMessage(value,permission_pb.AccountPermissions.deserializeBinaryFromReader); 179 msg.setPermissions(value); 180 break; 181 case 7: 182 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 183 msg.setWasmcode(value); 184 break; 185 case 11: 186 var value = /** @type {string} */ (reader.readString()); 187 msg.setNativename(value); 188 break; 189 case 8: 190 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 191 msg.setCodehash(value); 192 break; 193 case 9: 194 var value = new proto.acm.ContractMeta; 195 reader.readMessage(value,proto.acm.ContractMeta.deserializeBinaryFromReader); 196 msg.addContractmeta(value); 197 break; 198 case 10: 199 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 200 msg.setForebear(value); 201 break; 202 default: 203 reader.skipField(); 204 break; 205 } 206 } 207 return msg; 208 }; 209 210 211 /** 212 * Serializes the message to binary data (in protobuf wire format). 213 * @return {!Uint8Array} 214 */ 215 proto.acm.Account.prototype.serializeBinary = function() { 216 var writer = new jspb.BinaryWriter(); 217 proto.acm.Account.serializeBinaryToWriter(this, writer); 218 return writer.getResultBuffer(); 219 }; 220 221 222 /** 223 * Serializes the given message to binary data (in protobuf wire 224 * format), writing to the given BinaryWriter. 225 * @param {!proto.acm.Account} message 226 * @param {!jspb.BinaryWriter} writer 227 * @suppress {unusedLocalVariables} f is only used for nested messages 228 */ 229 proto.acm.Account.serializeBinaryToWriter = function(message, writer) { 230 var f = undefined; 231 f = message.getAddress_asU8(); 232 if (f.length > 0) { 233 writer.writeBytes( 234 1, 235 f 236 ); 237 } 238 f = message.getPublickey(); 239 if (f != null) { 240 writer.writeMessage( 241 2, 242 f, 243 crypto_pb.PublicKey.serializeBinaryToWriter 244 ); 245 } 246 f = message.getSequence(); 247 if (f !== 0) { 248 writer.writeUint64( 249 3, 250 f 251 ); 252 } 253 f = message.getBalance(); 254 if (f !== 0) { 255 writer.writeUint64( 256 4, 257 f 258 ); 259 } 260 f = message.getEvmcode_asU8(); 261 if (f.length > 0) { 262 writer.writeBytes( 263 5, 264 f 265 ); 266 } 267 f = message.getPermissions(); 268 if (f != null) { 269 writer.writeMessage( 270 6, 271 f, 272 permission_pb.AccountPermissions.serializeBinaryToWriter 273 ); 274 } 275 f = message.getWasmcode_asU8(); 276 if (f.length > 0) { 277 writer.writeBytes( 278 7, 279 f 280 ); 281 } 282 f = message.getNativename(); 283 if (f.length > 0) { 284 writer.writeString( 285 11, 286 f 287 ); 288 } 289 f = message.getCodehash_asU8(); 290 if (f.length > 0) { 291 writer.writeBytes( 292 8, 293 f 294 ); 295 } 296 f = message.getContractmetaList(); 297 if (f.length > 0) { 298 writer.writeRepeatedMessage( 299 9, 300 f, 301 proto.acm.ContractMeta.serializeBinaryToWriter 302 ); 303 } 304 f = message.getForebear_asU8(); 305 if (f.length > 0) { 306 writer.writeBytes( 307 10, 308 f 309 ); 310 } 311 }; 312 313 314 /** 315 * optional bytes Address = 1; 316 * @return {!(string|Uint8Array)} 317 */ 318 proto.acm.Account.prototype.getAddress = function() { 319 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); 320 }; 321 322 323 /** 324 * optional bytes Address = 1; 325 * This is a type-conversion wrapper around `getAddress()` 326 * @return {string} 327 */ 328 proto.acm.Account.prototype.getAddress_asB64 = function() { 329 return /** @type {string} */ (jspb.Message.bytesAsB64( 330 this.getAddress())); 331 }; 332 333 334 /** 335 * optional bytes Address = 1; 336 * Note that Uint8Array is not supported on all browsers. 337 * @see http://caniuse.com/Uint8Array 338 * This is a type-conversion wrapper around `getAddress()` 339 * @return {!Uint8Array} 340 */ 341 proto.acm.Account.prototype.getAddress_asU8 = function() { 342 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 343 this.getAddress())); 344 }; 345 346 347 /** 348 * @param {!(string|Uint8Array)} value 349 * @return {!proto.acm.Account} returns this 350 */ 351 proto.acm.Account.prototype.setAddress = function(value) { 352 return jspb.Message.setProto3BytesField(this, 1, value); 353 }; 354 355 356 /** 357 * optional crypto.PublicKey PublicKey = 2; 358 * @return {?proto.crypto.PublicKey} 359 */ 360 proto.acm.Account.prototype.getPublickey = function() { 361 return /** @type{?proto.crypto.PublicKey} */ ( 362 jspb.Message.getWrapperField(this, crypto_pb.PublicKey, 2)); 363 }; 364 365 366 /** 367 * @param {?proto.crypto.PublicKey|undefined} value 368 * @return {!proto.acm.Account} returns this 369 */ 370 proto.acm.Account.prototype.setPublickey = function(value) { 371 return jspb.Message.setWrapperField(this, 2, value); 372 }; 373 374 375 /** 376 * Clears the message field making it undefined. 377 * @return {!proto.acm.Account} returns this 378 */ 379 proto.acm.Account.prototype.clearPublickey = function() { 380 return this.setPublickey(undefined); 381 }; 382 383 384 /** 385 * Returns whether this field is set. 386 * @return {boolean} 387 */ 388 proto.acm.Account.prototype.hasPublickey = function() { 389 return jspb.Message.getField(this, 2) != null; 390 }; 391 392 393 /** 394 * optional uint64 Sequence = 3; 395 * @return {number} 396 */ 397 proto.acm.Account.prototype.getSequence = function() { 398 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); 399 }; 400 401 402 /** 403 * @param {number} value 404 * @return {!proto.acm.Account} returns this 405 */ 406 proto.acm.Account.prototype.setSequence = function(value) { 407 return jspb.Message.setProto3IntField(this, 3, value); 408 }; 409 410 411 /** 412 * optional uint64 Balance = 4; 413 * @return {number} 414 */ 415 proto.acm.Account.prototype.getBalance = function() { 416 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); 417 }; 418 419 420 /** 421 * @param {number} value 422 * @return {!proto.acm.Account} returns this 423 */ 424 proto.acm.Account.prototype.setBalance = function(value) { 425 return jspb.Message.setProto3IntField(this, 4, value); 426 }; 427 428 429 /** 430 * optional bytes EVMCode = 5; 431 * @return {!(string|Uint8Array)} 432 */ 433 proto.acm.Account.prototype.getEvmcode = function() { 434 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, "")); 435 }; 436 437 438 /** 439 * optional bytes EVMCode = 5; 440 * This is a type-conversion wrapper around `getEvmcode()` 441 * @return {string} 442 */ 443 proto.acm.Account.prototype.getEvmcode_asB64 = function() { 444 return /** @type {string} */ (jspb.Message.bytesAsB64( 445 this.getEvmcode())); 446 }; 447 448 449 /** 450 * optional bytes EVMCode = 5; 451 * Note that Uint8Array is not supported on all browsers. 452 * @see http://caniuse.com/Uint8Array 453 * This is a type-conversion wrapper around `getEvmcode()` 454 * @return {!Uint8Array} 455 */ 456 proto.acm.Account.prototype.getEvmcode_asU8 = function() { 457 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 458 this.getEvmcode())); 459 }; 460 461 462 /** 463 * @param {!(string|Uint8Array)} value 464 * @return {!proto.acm.Account} returns this 465 */ 466 proto.acm.Account.prototype.setEvmcode = function(value) { 467 return jspb.Message.setProto3BytesField(this, 5, value); 468 }; 469 470 471 /** 472 * optional permission.AccountPermissions Permissions = 6; 473 * @return {?proto.permission.AccountPermissions} 474 */ 475 proto.acm.Account.prototype.getPermissions = function() { 476 return /** @type{?proto.permission.AccountPermissions} */ ( 477 jspb.Message.getWrapperField(this, permission_pb.AccountPermissions, 6)); 478 }; 479 480 481 /** 482 * @param {?proto.permission.AccountPermissions|undefined} value 483 * @return {!proto.acm.Account} returns this 484 */ 485 proto.acm.Account.prototype.setPermissions = function(value) { 486 return jspb.Message.setWrapperField(this, 6, value); 487 }; 488 489 490 /** 491 * Clears the message field making it undefined. 492 * @return {!proto.acm.Account} returns this 493 */ 494 proto.acm.Account.prototype.clearPermissions = function() { 495 return this.setPermissions(undefined); 496 }; 497 498 499 /** 500 * Returns whether this field is set. 501 * @return {boolean} 502 */ 503 proto.acm.Account.prototype.hasPermissions = function() { 504 return jspb.Message.getField(this, 6) != null; 505 }; 506 507 508 /** 509 * optional bytes WASMCode = 7; 510 * @return {!(string|Uint8Array)} 511 */ 512 proto.acm.Account.prototype.getWasmcode = function() { 513 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 7, "")); 514 }; 515 516 517 /** 518 * optional bytes WASMCode = 7; 519 * This is a type-conversion wrapper around `getWasmcode()` 520 * @return {string} 521 */ 522 proto.acm.Account.prototype.getWasmcode_asB64 = function() { 523 return /** @type {string} */ (jspb.Message.bytesAsB64( 524 this.getWasmcode())); 525 }; 526 527 528 /** 529 * optional bytes WASMCode = 7; 530 * Note that Uint8Array is not supported on all browsers. 531 * @see http://caniuse.com/Uint8Array 532 * This is a type-conversion wrapper around `getWasmcode()` 533 * @return {!Uint8Array} 534 */ 535 proto.acm.Account.prototype.getWasmcode_asU8 = function() { 536 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 537 this.getWasmcode())); 538 }; 539 540 541 /** 542 * @param {!(string|Uint8Array)} value 543 * @return {!proto.acm.Account} returns this 544 */ 545 proto.acm.Account.prototype.setWasmcode = function(value) { 546 return jspb.Message.setProto3BytesField(this, 7, value); 547 }; 548 549 550 /** 551 * optional string NativeName = 11; 552 * @return {string} 553 */ 554 proto.acm.Account.prototype.getNativename = function() { 555 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); 556 }; 557 558 559 /** 560 * @param {string} value 561 * @return {!proto.acm.Account} returns this 562 */ 563 proto.acm.Account.prototype.setNativename = function(value) { 564 return jspb.Message.setProto3StringField(this, 11, value); 565 }; 566 567 568 /** 569 * optional bytes CodeHash = 8; 570 * @return {!(string|Uint8Array)} 571 */ 572 proto.acm.Account.prototype.getCodehash = function() { 573 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 8, "")); 574 }; 575 576 577 /** 578 * optional bytes CodeHash = 8; 579 * This is a type-conversion wrapper around `getCodehash()` 580 * @return {string} 581 */ 582 proto.acm.Account.prototype.getCodehash_asB64 = function() { 583 return /** @type {string} */ (jspb.Message.bytesAsB64( 584 this.getCodehash())); 585 }; 586 587 588 /** 589 * optional bytes CodeHash = 8; 590 * Note that Uint8Array is not supported on all browsers. 591 * @see http://caniuse.com/Uint8Array 592 * This is a type-conversion wrapper around `getCodehash()` 593 * @return {!Uint8Array} 594 */ 595 proto.acm.Account.prototype.getCodehash_asU8 = function() { 596 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 597 this.getCodehash())); 598 }; 599 600 601 /** 602 * @param {!(string|Uint8Array)} value 603 * @return {!proto.acm.Account} returns this 604 */ 605 proto.acm.Account.prototype.setCodehash = function(value) { 606 return jspb.Message.setProto3BytesField(this, 8, value); 607 }; 608 609 610 /** 611 * repeated ContractMeta ContractMeta = 9; 612 * @return {!Array<!proto.acm.ContractMeta>} 613 */ 614 proto.acm.Account.prototype.getContractmetaList = function() { 615 return /** @type{!Array<!proto.acm.ContractMeta>} */ ( 616 jspb.Message.getRepeatedWrapperField(this, proto.acm.ContractMeta, 9)); 617 }; 618 619 620 /** 621 * @param {!Array<!proto.acm.ContractMeta>} value 622 * @return {!proto.acm.Account} returns this 623 */ 624 proto.acm.Account.prototype.setContractmetaList = function(value) { 625 return jspb.Message.setRepeatedWrapperField(this, 9, value); 626 }; 627 628 629 /** 630 * @param {!proto.acm.ContractMeta=} opt_value 631 * @param {number=} opt_index 632 * @return {!proto.acm.ContractMeta} 633 */ 634 proto.acm.Account.prototype.addContractmeta = function(opt_value, opt_index) { 635 return jspb.Message.addToRepeatedWrapperField(this, 9, opt_value, proto.acm.ContractMeta, opt_index); 636 }; 637 638 639 /** 640 * Clears the list making it empty but non-null. 641 * @return {!proto.acm.Account} returns this 642 */ 643 proto.acm.Account.prototype.clearContractmetaList = function() { 644 return this.setContractmetaList([]); 645 }; 646 647 648 /** 649 * optional bytes Forebear = 10; 650 * @return {!(string|Uint8Array)} 651 */ 652 proto.acm.Account.prototype.getForebear = function() { 653 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 10, "")); 654 }; 655 656 657 /** 658 * optional bytes Forebear = 10; 659 * This is a type-conversion wrapper around `getForebear()` 660 * @return {string} 661 */ 662 proto.acm.Account.prototype.getForebear_asB64 = function() { 663 return /** @type {string} */ (jspb.Message.bytesAsB64( 664 this.getForebear())); 665 }; 666 667 668 /** 669 * optional bytes Forebear = 10; 670 * Note that Uint8Array is not supported on all browsers. 671 * @see http://caniuse.com/Uint8Array 672 * This is a type-conversion wrapper around `getForebear()` 673 * @return {!Uint8Array} 674 */ 675 proto.acm.Account.prototype.getForebear_asU8 = function() { 676 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 677 this.getForebear())); 678 }; 679 680 681 /** 682 * @param {!(string|Uint8Array)} value 683 * @return {!proto.acm.Account} returns this 684 */ 685 proto.acm.Account.prototype.setForebear = function(value) { 686 return jspb.Message.setProto3BytesField(this, 10, value); 687 }; 688 689 690 691 692 693 if (jspb.Message.GENERATE_TO_OBJECT) { 694 /** 695 * Creates an object representation of this proto. 696 * Field names that are reserved in JavaScript and will be renamed to pb_name. 697 * Optional fields that are not set will be set to undefined. 698 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 699 * For the list of reserved names please see: 700 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 701 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 702 * JSPB instance for transitional soy proto support: 703 * http://goto/soy-param-migration 704 * @return {!Object} 705 */ 706 proto.acm.ContractMeta.prototype.toObject = function(opt_includeInstance) { 707 return proto.acm.ContractMeta.toObject(opt_includeInstance, this); 708 }; 709 710 711 /** 712 * Static version of the {@see toObject} method. 713 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 714 * the JSPB instance for transitional soy proto support: 715 * http://goto/soy-param-migration 716 * @param {!proto.acm.ContractMeta} msg The msg instance to transform. 717 * @return {!Object} 718 * @suppress {unusedLocalVariables} f is only used for nested messages 719 */ 720 proto.acm.ContractMeta.toObject = function(includeInstance, msg) { 721 var f, obj = { 722 codehash: msg.getCodehash_asB64(), 723 metadatahash: msg.getMetadatahash_asB64(), 724 metadata: jspb.Message.getFieldWithDefault(msg, 3, "") 725 }; 726 727 if (includeInstance) { 728 obj.$jspbMessageInstance = msg; 729 } 730 return obj; 731 }; 732 } 733 734 735 /** 736 * Deserializes binary data (in protobuf wire format). 737 * @param {jspb.ByteSource} bytes The bytes to deserialize. 738 * @return {!proto.acm.ContractMeta} 739 */ 740 proto.acm.ContractMeta.deserializeBinary = function(bytes) { 741 var reader = new jspb.BinaryReader(bytes); 742 var msg = new proto.acm.ContractMeta; 743 return proto.acm.ContractMeta.deserializeBinaryFromReader(msg, reader); 744 }; 745 746 747 /** 748 * Deserializes binary data (in protobuf wire format) from the 749 * given reader into the given message object. 750 * @param {!proto.acm.ContractMeta} msg The message object to deserialize into. 751 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 752 * @return {!proto.acm.ContractMeta} 753 */ 754 proto.acm.ContractMeta.deserializeBinaryFromReader = function(msg, reader) { 755 while (reader.nextField()) { 756 if (reader.isEndGroup()) { 757 break; 758 } 759 var field = reader.getFieldNumber(); 760 switch (field) { 761 case 1: 762 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 763 msg.setCodehash(value); 764 break; 765 case 2: 766 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 767 msg.setMetadatahash(value); 768 break; 769 case 3: 770 var value = /** @type {string} */ (reader.readString()); 771 msg.setMetadata(value); 772 break; 773 default: 774 reader.skipField(); 775 break; 776 } 777 } 778 return msg; 779 }; 780 781 782 /** 783 * Serializes the message to binary data (in protobuf wire format). 784 * @return {!Uint8Array} 785 */ 786 proto.acm.ContractMeta.prototype.serializeBinary = function() { 787 var writer = new jspb.BinaryWriter(); 788 proto.acm.ContractMeta.serializeBinaryToWriter(this, writer); 789 return writer.getResultBuffer(); 790 }; 791 792 793 /** 794 * Serializes the given message to binary data (in protobuf wire 795 * format), writing to the given BinaryWriter. 796 * @param {!proto.acm.ContractMeta} message 797 * @param {!jspb.BinaryWriter} writer 798 * @suppress {unusedLocalVariables} f is only used for nested messages 799 */ 800 proto.acm.ContractMeta.serializeBinaryToWriter = function(message, writer) { 801 var f = undefined; 802 f = message.getCodehash_asU8(); 803 if (f.length > 0) { 804 writer.writeBytes( 805 1, 806 f 807 ); 808 } 809 f = message.getMetadatahash_asU8(); 810 if (f.length > 0) { 811 writer.writeBytes( 812 2, 813 f 814 ); 815 } 816 f = message.getMetadata(); 817 if (f.length > 0) { 818 writer.writeString( 819 3, 820 f 821 ); 822 } 823 }; 824 825 826 /** 827 * optional bytes CodeHash = 1; 828 * @return {!(string|Uint8Array)} 829 */ 830 proto.acm.ContractMeta.prototype.getCodehash = function() { 831 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); 832 }; 833 834 835 /** 836 * optional bytes CodeHash = 1; 837 * This is a type-conversion wrapper around `getCodehash()` 838 * @return {string} 839 */ 840 proto.acm.ContractMeta.prototype.getCodehash_asB64 = function() { 841 return /** @type {string} */ (jspb.Message.bytesAsB64( 842 this.getCodehash())); 843 }; 844 845 846 /** 847 * optional bytes CodeHash = 1; 848 * Note that Uint8Array is not supported on all browsers. 849 * @see http://caniuse.com/Uint8Array 850 * This is a type-conversion wrapper around `getCodehash()` 851 * @return {!Uint8Array} 852 */ 853 proto.acm.ContractMeta.prototype.getCodehash_asU8 = function() { 854 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 855 this.getCodehash())); 856 }; 857 858 859 /** 860 * @param {!(string|Uint8Array)} value 861 * @return {!proto.acm.ContractMeta} returns this 862 */ 863 proto.acm.ContractMeta.prototype.setCodehash = function(value) { 864 return jspb.Message.setProto3BytesField(this, 1, value); 865 }; 866 867 868 /** 869 * optional bytes MetadataHash = 2; 870 * @return {!(string|Uint8Array)} 871 */ 872 proto.acm.ContractMeta.prototype.getMetadatahash = function() { 873 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 874 }; 875 876 877 /** 878 * optional bytes MetadataHash = 2; 879 * This is a type-conversion wrapper around `getMetadatahash()` 880 * @return {string} 881 */ 882 proto.acm.ContractMeta.prototype.getMetadatahash_asB64 = function() { 883 return /** @type {string} */ (jspb.Message.bytesAsB64( 884 this.getMetadatahash())); 885 }; 886 887 888 /** 889 * optional bytes MetadataHash = 2; 890 * Note that Uint8Array is not supported on all browsers. 891 * @see http://caniuse.com/Uint8Array 892 * This is a type-conversion wrapper around `getMetadatahash()` 893 * @return {!Uint8Array} 894 */ 895 proto.acm.ContractMeta.prototype.getMetadatahash_asU8 = function() { 896 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 897 this.getMetadatahash())); 898 }; 899 900 901 /** 902 * @param {!(string|Uint8Array)} value 903 * @return {!proto.acm.ContractMeta} returns this 904 */ 905 proto.acm.ContractMeta.prototype.setMetadatahash = function(value) { 906 return jspb.Message.setProto3BytesField(this, 2, value); 907 }; 908 909 910 /** 911 * optional string Metadata = 3; 912 * @return {string} 913 */ 914 proto.acm.ContractMeta.prototype.getMetadata = function() { 915 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); 916 }; 917 918 919 /** 920 * @param {string} value 921 * @return {!proto.acm.ContractMeta} returns this 922 */ 923 proto.acm.ContractMeta.prototype.setMetadata = function(value) { 924 return jspb.Message.setProto3StringField(this, 3, value); 925 }; 926 927 928 goog.object.extend(exports, proto.acm);