t

com.digitalasset.canton.version

BaseVersioningCompanion

trait BaseVersioningCompanion[ValueClass <: HasRepresentativeProtocolVersion, Context, DeserializedValueClass <: HasRepresentativeProtocolVersion, Dependency] extends AnyRef

This trait has the logic to store proto (de)serializers and retrieve them by protocol version.

Parameters and concepts are explained in contributing guide

Linear Supertypes
Known Subclasses
ActionDescription, AssignmentCommonData, AssignmentView, AssignmentViewTree, CommonMetadata, FullInformeeTree, LightTransactionViewTree, MerkleSeq, MerkleSeqElement, ParticipantMetadata, SubmitterMetadata, TransactionView, UnassignmentCommonData, UnassignmentView, UnassignmentViewTree, ViewCommonData, ViewParticipantData, ActiveContract, PartyReplicationInstruction, PartyReplicationSourceMessage, SubmissionTrackingData, CommitmentContractMetadata, CommitmentInspectContract, ContractArchived, ContractAssigned, ContractCreated, ContractStateOnSynchronizer, ContractUnassigned, ContractUnknown, DynamicSequencingParameters, DynamicSynchronizerParameters, ExternalAuthorization, ProtocolSymmetricKey, StaticSynchronizerParameters, AcsCommitment, AssignmentMediatorMessage, ConfirmationResponses, ConfirmationResultMessage, EncryptedViewMessage, EnvelopeContent, InformeeMessage, LocalVerdict, RootHashMessage, SetTrafficPurchasedMessage, SignedProtocolMessage, TopologyTransactionsBroadcast, TypedSignedProtocolMessageContent, UnassignmentMediatorMessage, Verdict, ConnectToSequencerChannelRequest, ConnectToSequencerChannelResponse, AcknowledgeRequest, AggregationRule, Batch, ClosedEnvelope, GetTrafficStateForMemberRequest, GetTrafficStateForMemberResponse, SequencedEvent, SequencingSubmissionCost, SignedContent, SubmissionRequest, SubscriptionRequestV2, TopologyStateForInitRequest, SequencerChannelConnectedToAllEndpoints, SequencerChannelMetadata, SequencerChannelSessionKey, SequencerChannelSessionKeyAck, OnboardingStateForSequencer, OrderingRequest, SequencerSnapshot, OrderingRequestBatch, RemoteBatch, RemoteBatchAcknowledged, FetchRemoteBatchData, RemoteBatchDataFetched, RetransmissionRequest, RetransmissionResponse, BlockTransferRequest, BlockTransferResponse, Commit, NewView, PrePrepare, Prepare, ViewChange, VersionedStatus, SignedTopologyTransaction, SignedTopologyTransactions, TopologyTransaction, VersioningCompanion2, VersioningCompanionContext2, VersioningCompanionContextMemoization2, VersioningCompanionContextPVValidation2, VersioningCompanionContextTaggedPVValidation2, VersioningCompanionMemoization2
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BaseVersioningCompanion
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type Codec = ProtoCodec[ValueClass, Context, DeserializedValueClass, BaseVersioningCompanion.this.type, Dependency]
  2. type Deserializer = (Context, OriginalByteString, DataByteString) => ParsingResult[DeserializedValueClass]
  3. type Invariants = Seq[Invariant[ValueClass, BaseVersioningCompanion.this.type]]
    Attributes
    protected
  4. type ThisRepresentativeProtocolVersion = RepresentativeProtocolVersion[BaseVersioningCompanion.this.type]
    Attributes
    protected
  5. type VersioningTable = SupportedProtoVersions[ValueClass, Context, DeserializedValueClass, BaseVersioningCompanion.this.type, Dependency]

Abstract Value Members

  1. abstract def name: String

    The name of the class as used for pretty-printing and error reporting

  2. abstract def versioningTable: VersioningTable

    Proto versions that are supported by fromByteString See the helper supportedProtoVersion below to define a Parser.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. def converterFor(protocolVersion: RepresentativeProtocolVersion[BaseVersioningCompanion.this.type]): ParsingResult[Codec]
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def fromByteString(expectedProtocolVersion: ProtocolVersionValidation, bytes: OriginalByteString)(implicit ev: =:=[Unit, Context]): ParsingResult[DeserializedValueClass]

    Alias of fromByteString that can be used when there is no context.

  10. def fromByteString(expectedProtocolVersion: ProtocolVersion, bytes: OriginalByteString)(implicit ev: =:=[Unit, Context]): ParsingResult[DeserializedValueClass]

    Alias of fromByteString that can be used when there is no context.

  11. def fromByteString(expectedProtocolVersion: ProtocolVersion, context: Context)(bytes: OriginalByteString): ParsingResult[DeserializedValueClass]
  12. def fromByteString(expectedProtocolVersion: ProtocolVersionValidation, context: Context, bytes: OriginalByteString): ParsingResult[DeserializedValueClass]

    Main deserialization method to parse a byte string

    Main deserialization method to parse a byte string

    expectedProtocolVersion

    Protocol version used by the synchronizer

    context

    Context for the deserialization (() if there is no context)

    bytes

    Byte string to be deserialized

    returns

    Deserialized value class (as a Right) or a ProtoDeserializationError (as a left) Variants of this method (e.g., when Context=unit) are provided below for convenience.

  13. def fromByteStringPV(expectedProtocolVersion: ProtocolVersion, bytes: OriginalByteString)(implicit ev: =:=[ProtocolVersion, Context]): ParsingResult[DeserializedValueClass]

    Alias of fromByteString that can be used when the Context is a com.digitalasset.canton.version.ProtocolVersion.

  14. def fromByteStringPVV(expectedProtocolVersion: ProtocolVersionValidation, bytes: OriginalByteString)(implicit ev: =:=[ProtocolVersionValidation, Context]): ParsingResult[DeserializedValueClass]

    Alias of fromByteString that can be used when the Context is a com.digitalasset.canton.version.ProtocolVersionValidation.

  15. def fromTrustedByteArray(bytes: Array[Byte])(implicit ev: =:=[Unit, Context]): ParsingResult[DeserializedValueClass]
  16. def fromTrustedByteArray(context: Context, bytes: Array[Byte]): ParsingResult[DeserializedValueClass]

    Deserializes the given bytes without validation.

    Deserializes the given bytes without validation.

    Unsafe! Do NOT use this method unless you can justify that the given bytes originate from a trusted source. For example, this should be the case for deserialization of data that originates from a database.

    bytes

    trusted bytes with an embedded proto version

  17. def fromTrustedByteString(bytes: OriginalByteString)(implicit ev: =:=[Unit, Context]): ParsingResult[DeserializedValueClass]

    Alias of fromTrustedByteString that can be used when there is no context.

  18. def fromTrustedByteString(context: Context)(bytes: OriginalByteString): ParsingResult[DeserializedValueClass]

    Deserializes the given bytes without validation.

    Deserializes the given bytes without validation.

    Unsafe! Do NOT use this method unless you can justify that the given bytes originate from a trusted source. For example, this should be the case for deserialization of data that originates from a database.

    bytes

    trusted bytes with an embedded proto version

  19. def fromTrustedByteStringPVV(bytes: OriginalByteString)(implicit ev: =:=[ProtocolVersionValidation, Context]): ParsingResult[DeserializedValueClass]

    Since dependency on the ProtocolVersionValidation is encoded in the context, one still has to provide ProtocolVersionValidation.NoValidation even when calling fromTrustedByteString, which is counterintuitive.

    Since dependency on the ProtocolVersionValidation is encoded in the context, one still has to provide ProtocolVersionValidation.NoValidation even when calling fromTrustedByteString, which is counterintuitive. This method allows a simpler call if the Context is a com.digitalasset.canton.version.ProtocolVersionValidation

  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  22. def invariants: Seq[Invariant[ValueClass, BaseVersioningCompanion.this.type]]
  23. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  27. def parseDelimitedFromTrusted(input: InputStream)(implicit ev: =:=[Unit, Context]): Option[ParsingResult[DeserializedValueClass]]
  28. def parseDelimitedFromTrusted(input: InputStream, context: Context): Option[ParsingResult[DeserializedValueClass]]

    Deserializes a message using a delimiter (the message length) from the given input stream.

    Deserializes a message using a delimiter (the message length) from the given input stream.

    Unsafe! No deserialization validation is performed.

    Do NOT use this method unless you can justify that the given bytes originate from a trusted source.

    This method works in conjunction with com.digitalasset.canton.version.HasProtocolVersionedWrapper.writeDelimitedTo which should have been used to serialize the message. It is useful for deserializing multiple messages from a single input stream through repeated invocations.

    Deserialization is only supported for com.digitalasset.canton.version.VersionedMessage.

    input

    the source from which a message is deserialized

    returns

    an Option that is None when there are no messages left anymore, otherwise it wraps an Either where left represents a deserialization error (exception) and right represents the successfully deserialized message

  29. def protoVersionFor(protocolVersion: ProtocolVersion): ProtoVersion

    Return the Proto version corresponding to the protocol version

  30. def protoVersionFor(protocolVersion: RepresentativeProtocolVersion[BaseVersioningCompanion.this.type]): ProtoVersion

    Return the Proto version corresponding to the representative protocol version

  31. def protocolVersionRepresentativeFor(protoVersion: ProtoVersion): ParsingResult[RepresentativeProtocolVersion[BaseVersioningCompanion.this.type]]
  32. def protocolVersionRepresentativeFor(protocolVersion: ProtocolVersion): RepresentativeProtocolVersion[BaseVersioningCompanion.this.type]
  33. def readFromTrustedFile(inputFile: String)(implicit ev: =:=[Unit, Context]): Either[String, DeserializedValueClass]
  34. def readFromTrustedFile(context: Context, inputFile: String): Either[String, DeserializedValueClass]

    Deserializes the data from the given file without validation.

    Deserializes the data from the given file without validation.

    Unsafe! Do NOT use this method unless you can justify that the data originates from a trusted source.

  35. def readFromTrustedFilePVV(inputFile: String)(implicit ev: =:=[ProtocolVersionValidation, Context]): Either[String, DeserializedValueClass]
  36. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  37. def toString(): String
    Definition Classes
    AnyRef → Any
  38. def tryReadFromTrustedFile(inputFile: String)(implicit ev: =:=[Unit, Context]): DeserializedValueClass
  39. def tryReadFromTrustedFile(context: Context, inputFile: String): DeserializedValueClass
  40. def validateInstance(instance: ValueClass, representativeProtocolVersion: ThisRepresentativeProtocolVersion): Either[String, Unit]

    Will check that default value rules defined in invariants hold.

  41. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  42. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  43. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  44. object VersioningTable

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped