Packages

package codec

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. final case class ExecuteTransactionData(submitterInfo: SubmitterInfo, transactionMeta: TransactionMeta, transaction: SubmittedTransaction, globalKeyMapping: Map[GlobalKey, Option[daml.lf.value.Value.ContractId]], inputContracts: Map[daml.lf.value.Value.ContractId, ExternalInputContract], synchronizerId: SynchronizerId, externallySignedSubmission: ExternallySignedSubmission) extends EnrichedTransactionData with Product with Serializable

    Transaction data for an enriched external submission during the execute phase.

    Transaction data for an enriched external submission during the execute phase. This is usually output but the PreparedTransactionDecoder. DO NOT submit this transaction to the protocol, but call "impoverish" before.

  2. class ExternalTransactionProcessor extends NamedLogging

    This class contains the logic to processes prepare and execute requests from the interactive submission API.

    This class contains the logic to processes prepare and execute requests from the interactive submission API. The general flow is as follows:

    IC = Input Contract

    ┌───────────────┐ ┌──────────────────────┐ ExternalHash = Hash(EnrichedLfTx, EnrichedIC) │ LfTx │ │ EnrichedLfTx │ Sign(ExternalHash) ┌─────────┐ Interpretation ├───────────────┤ Enrich ├──────────────────────┤ Encode ┌─────────────────────┐ Prepare: │ Command ┼────────────────────►│ Original IC │────────►│EnrichedIC, OriginalIC│─────────►│ PreparedTransaction │ └─────────┘ └───────────────┘ └──────────────────────┘ └───────────────────┬─┘ || || │ Equal || Equal || │ || || │ Submit to Sync ┌───────────────┐ ┌──────────────────────┐ Decode │ Execute: ◄──────────────────│ LfTx │ │ EnrichedLfTx │◄─────────────┘ ├───────────────┤ ├──────────────────────┤ │ Original IC │ │EnrichedIC, OriginalIC│ └───────────────┘ └──────────┬───────────┘ ▲ │ │ │ │ VerifySignature(EnrichedTx, EnrichedIC) Impoverish(EnrichedLfTx) │ │ │ │ │ └───────────────────────◄───────────────────┘

    Important to note is that input contracts' original data is passed back and forth between prepare and execute, whereas the transaction itself is not. That's because it would become increasingly difficult to maintain a correct enrich / impoverish logic over arbitrary old input contracts with different Lf encodings. The downside is increased payload size for the prepared transaction that now contains the input contracts in both enriched and original form. For transactions we can tie the enrich / impoverish to the hashing scheme version and ensure that the roundtrip is injective within the same version. Prepared transaction also have a much shorter lifetime than input contracts in general so re-preparing a transaction with a newer hashing version after an upgrade is relatively cheap.

  3. final case class PrepareTransactionData(submitterInfo: SubmitterInfo, transactionMeta: TransactionMeta, transaction: SubmittedTransaction, globalKeyMapping: Map[GlobalKey, Option[daml.lf.value.Value.ContractId]], inputContracts: Map[daml.lf.value.Value.ContractId, ExternalInputContract], synchronizerId: SynchronizerId, mediatorGroup: Int, transactionUUID: UUID, maxRecordTime: Option[Timestamp]) extends EnrichedTransactionData with Product with Serializable

    Transaction data for an enriched external submission during the prepare phase.

    Transaction data for an enriched external submission during the prepare phase. This is usually passed to the PreparedTransactionEncoder. DO NOT submit this transaction the protocol.

  4. final class PreparedTransactionDecoder extends NamedLogging

    Class to decode a PreparedTransaction to an LF Transaction and its metadata.

    Class to decode a PreparedTransaction to an LF Transaction and its metadata. Uses chimney to define Transformers and PartialTransformer for all conversions.

  5. final class PreparedTransactionEncoder extends NamedLogging

    Class to encode an LF Transaction and its metadata to a PreparedTransaction.

    Class to encode an LF Transaction and its metadata to a PreparedTransaction. Uses chimney to define Transformers and PartialTransformer for all conversions.

Ungrouped