All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.wavesplatform.protobuf.block.MicroBlock.scala Maven / Gradle / Ivy

The newest version!
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3

package com.wavesplatform.protobuf.block

@SerialVersionUID(0L)
final case class MicroBlock(
    version: _root_.scala.Int = 0,
    reference: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
    updatedBlockSignature: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
    senderPublicKey: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
    transactions: _root_.scala.Seq[com.wavesplatform.protobuf.transaction.SignedTransaction] = _root_.scala.Seq.empty,
    stateHash: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[MicroBlock] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = version
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(1, __value)
        }
      };
      
      {
        val __value = reference
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(2, __value)
        }
      };
      
      {
        val __value = updatedBlockSignature
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(3, __value)
        }
      };
      
      {
        val __value = senderPublicKey
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(4, __value)
        }
      };
      transactions.foreach { __item =>
        val __value = __item
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      }
      
      {
        val __value = stateHash
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(6, __value)
        }
      };
      __size += unknownFields.serializedSize
      __size
    }
    override def serializedSize: _root_.scala.Int = {
      var __size = __serializedSizeMemoized
      if (__size == 0) {
        __size = __computeSerializedSize() + 1
        __serializedSizeMemoized = __size
      }
      __size - 1
      
    }
    def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = {
      {
        val __v = version
        if (__v != 0) {
          _output__.writeInt32(1, __v)
        }
      };
      {
        val __v = reference
        if (!__v.isEmpty) {
          _output__.writeBytes(2, __v)
        }
      };
      {
        val __v = updatedBlockSignature
        if (!__v.isEmpty) {
          _output__.writeBytes(3, __v)
        }
      };
      {
        val __v = senderPublicKey
        if (!__v.isEmpty) {
          _output__.writeBytes(4, __v)
        }
      };
      transactions.foreach { __v =>
        val __m = __v
        _output__.writeTag(5, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      {
        val __v = stateHash
        if (!__v.isEmpty) {
          _output__.writeBytes(6, __v)
        }
      };
      unknownFields.writeTo(_output__)
    }
    def withVersion(__v: _root_.scala.Int): MicroBlock = copy(version = __v)
    def withReference(__v: _root_.com.google.protobuf.ByteString): MicroBlock = copy(reference = __v)
    def withUpdatedBlockSignature(__v: _root_.com.google.protobuf.ByteString): MicroBlock = copy(updatedBlockSignature = __v)
    def withSenderPublicKey(__v: _root_.com.google.protobuf.ByteString): MicroBlock = copy(senderPublicKey = __v)
    def clearTransactions = copy(transactions = _root_.scala.Seq.empty)
    def addTransactions(__vs: com.wavesplatform.protobuf.transaction.SignedTransaction *): MicroBlock = addAllTransactions(__vs)
    def addAllTransactions(__vs: Iterable[com.wavesplatform.protobuf.transaction.SignedTransaction]): MicroBlock = copy(transactions = transactions ++ __vs)
    def withTransactions(__v: _root_.scala.Seq[com.wavesplatform.protobuf.transaction.SignedTransaction]): MicroBlock = copy(transactions = __v)
    def withStateHash(__v: _root_.com.google.protobuf.ByteString): MicroBlock = copy(stateHash = __v)
    def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v)
    def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty)
    def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = {
      (__fieldNumber: @_root_.scala.unchecked) match {
        case 1 => {
          val __t = version
          if (__t != 0) __t else null
        }
        case 2 => {
          val __t = reference
          if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null
        }
        case 3 => {
          val __t = updatedBlockSignature
          if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null
        }
        case 4 => {
          val __t = senderPublicKey
          if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null
        }
        case 5 => transactions
        case 6 => {
          val __t = stateHash
          if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null
        }
      }
    }
    def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = {
      _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor)
      (__field.number: @_root_.scala.unchecked) match {
        case 1 => _root_.scalapb.descriptors.PInt(version)
        case 2 => _root_.scalapb.descriptors.PByteString(reference)
        case 3 => _root_.scalapb.descriptors.PByteString(updatedBlockSignature)
        case 4 => _root_.scalapb.descriptors.PByteString(senderPublicKey)
        case 5 => _root_.scalapb.descriptors.PRepeated(transactions.iterator.map(_.toPMessage).toVector)
        case 6 => _root_.scalapb.descriptors.PByteString(stateHash)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: com.wavesplatform.protobuf.block.MicroBlock.type = com.wavesplatform.protobuf.block.MicroBlock
    // @@protoc_insertion_point(GeneratedMessage[waves.MicroBlock])
}

object MicroBlock extends scalapb.GeneratedMessageCompanion[com.wavesplatform.protobuf.block.MicroBlock] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.wavesplatform.protobuf.block.MicroBlock] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.wavesplatform.protobuf.block.MicroBlock = {
    var __version: _root_.scala.Int = 0
    var __reference: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY
    var __updatedBlockSignature: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY
    var __senderPublicKey: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY
    val __transactions: _root_.scala.collection.immutable.VectorBuilder[com.wavesplatform.protobuf.transaction.SignedTransaction] = new _root_.scala.collection.immutable.VectorBuilder[com.wavesplatform.protobuf.transaction.SignedTransaction]
    var __stateHash: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 8 =>
          __version = _input__.readInt32()
        case 18 =>
          __reference = _input__.readBytes()
        case 26 =>
          __updatedBlockSignature = _input__.readBytes()
        case 34 =>
          __senderPublicKey = _input__.readBytes()
        case 42 =>
          __transactions += _root_.scalapb.LiteParser.readMessage[com.wavesplatform.protobuf.transaction.SignedTransaction](_input__)
        case 50 =>
          __stateHash = _input__.readBytes()
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    com.wavesplatform.protobuf.block.MicroBlock(
        version = __version,
        reference = __reference,
        updatedBlockSignature = __updatedBlockSignature,
        senderPublicKey = __senderPublicKey,
        transactions = __transactions.result(),
        stateHash = __stateHash,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[com.wavesplatform.protobuf.block.MicroBlock] = _root_.scalapb.descriptors.Reads{
    case _root_.scalapb.descriptors.PMessage(__fieldsMap) =>
      _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.")
      com.wavesplatform.protobuf.block.MicroBlock(
        version = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Int]).getOrElse(0),
        reference = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY),
        updatedBlockSignature = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY),
        senderPublicKey = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY),
        transactions = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Seq[com.wavesplatform.protobuf.transaction.SignedTransaction]]).getOrElse(_root_.scala.Seq.empty),
        stateHash = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = BlockProto.javaDescriptor.getMessageTypes().get(1)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = BlockProto.scalaDescriptor.messages(1)
  def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
    var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
    (__number: @_root_.scala.unchecked) match {
      case 5 => __out = com.wavesplatform.protobuf.transaction.SignedTransaction
    }
    __out
  }
  lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty
  def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber)
  lazy val defaultInstance = com.wavesplatform.protobuf.block.MicroBlock(
    version = 0,
    reference = _root_.com.google.protobuf.ByteString.EMPTY,
    updatedBlockSignature = _root_.com.google.protobuf.ByteString.EMPTY,
    senderPublicKey = _root_.com.google.protobuf.ByteString.EMPTY,
    transactions = _root_.scala.Seq.empty,
    stateHash = _root_.com.google.protobuf.ByteString.EMPTY
  )
  implicit class MicroBlockLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, com.wavesplatform.protobuf.block.MicroBlock]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, com.wavesplatform.protobuf.block.MicroBlock](_l) {
    def version: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.version)((c_, f_) => c_.copy(version = f_))
    def reference: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.reference)((c_, f_) => c_.copy(reference = f_))
    def updatedBlockSignature: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.updatedBlockSignature)((c_, f_) => c_.copy(updatedBlockSignature = f_))
    def senderPublicKey: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.senderPublicKey)((c_, f_) => c_.copy(senderPublicKey = f_))
    def transactions: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[com.wavesplatform.protobuf.transaction.SignedTransaction]] = field(_.transactions)((c_, f_) => c_.copy(transactions = f_))
    def stateHash: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.stateHash)((c_, f_) => c_.copy(stateHash = f_))
  }
  final val VERSION_FIELD_NUMBER = 1
  final val REFERENCE_FIELD_NUMBER = 2
  final val UPDATED_BLOCK_SIGNATURE_FIELD_NUMBER = 3
  final val SENDER_PUBLIC_KEY_FIELD_NUMBER = 4
  final val TRANSACTIONS_FIELD_NUMBER = 5
  final val STATE_HASH_FIELD_NUMBER = 6
  def of(
    version: _root_.scala.Int,
    reference: _root_.com.google.protobuf.ByteString,
    updatedBlockSignature: _root_.com.google.protobuf.ByteString,
    senderPublicKey: _root_.com.google.protobuf.ByteString,
    transactions: _root_.scala.Seq[com.wavesplatform.protobuf.transaction.SignedTransaction],
    stateHash: _root_.com.google.protobuf.ByteString
  ): _root_.com.wavesplatform.protobuf.block.MicroBlock = _root_.com.wavesplatform.protobuf.block.MicroBlock(
    version,
    reference,
    updatedBlockSignature,
    senderPublicKey,
    transactions,
    stateHash
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[waves.MicroBlock])
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy