[Speedy] move submissionTime in OnLedger case class (#15427)

This commit is contained in:
Remy 2022-11-03 00:36:33 +01:00 committed by GitHub
parent e23f0a5cde
commit ed9d9c7ae6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 6 deletions

View File

@ -453,7 +453,7 @@ class Engine(val config: EngineConfig = Engine.StableConfig) {
deps(tx).flatMap { deps =>
val meta = Tx.Metadata(
submissionSeed = None,
submissionTime = machine.submissionTime,
submissionTime = onLedger.submissionTime,
usedPackages = deps,
dependsOnTime = onLedger.getDependsOnTime,
nodeSeeds = nodeSeeds,

View File

@ -981,7 +981,7 @@ private[lf] object SBuiltin {
case _ =>
onLedger.ptx
.insertCreate(
submissionTime = machine.submissionTime,
submissionTime = onLedger.submissionTime,
templateId = cached.templateId,
arg = createArgValue,
agreementText = agreement,

View File

@ -126,6 +126,7 @@ private[lf] object Speedy {
final case class OnLedger(
validating: Boolean,
submissionTime: Time.Timestamp,
contractKeyUniqueness: ContractKeyUniquenessMode,
/* The current partial transaction */
private[speedy] var ptx: PartialTransaction,
@ -300,7 +301,6 @@ private[lf] object Speedy {
var compiledPackages: CompiledPackages,
/* Profile of the run when the packages haven been compiled with profiling enabled. */
val profile: Profile = new Profile(),
val submissionTime: Time.Timestamp,
/* True if we are running on ledger building transactions, false if we
are running off-ledger code, e.g., Daml Script or
Triggers. It is safe to use on ledger for off ledger code but
@ -927,9 +927,9 @@ private[lf] object Speedy {
new Machine(
sexpr = exprWithDisclosures,
submissionTime = submissionTime,
ledgerMode = OnLedger(
validating = validating,
submissionTime = submissionTime,
ptx = PartialTransaction
.initial(
contractKeyUniqueness,
@ -1034,7 +1034,6 @@ private[lf] object Speedy {
)(implicit loggingContext: LoggingContext): Machine = {
new Machine(
sexpr = expr,
submissionTime = Time.Timestamp.Epoch,
ledgerMode = OffLedger,
traceLog = traceLog,
warningLog = warningLog,

View File

@ -151,7 +151,6 @@ private[speedy] object SpeedyTestLib {
loggingContext = machine.loggingContext,
compiledPackages = machine.compiledPackages,
profile = machine.profile,
submissionTime = machine.submissionTime,
ledgerMode = machine.ledgerMode,
)
}