Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
rautenrieth-da committed Oct 8, 2021
1 parent 29d6d39 commit e875bfc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package com.daml.platform.db.migration.postgres
import java.io.InputStream
import java.sql.Connection
import java.util.{Date, UUID}

import akka.NotUsed
import akka.stream.scaladsl.Source
import anorm.SqlParser._
Expand All @@ -17,14 +16,11 @@ import com.daml.ledger.api.domain.RejectionReason
import com.daml.ledger.api.domain.RejectionReason._
import com.daml.lf.data.Ref
import com.daml.lf.data.Relation.Relation
import com.daml.lf.data.Time.Timestamp
import com.daml.lf.engine.Blinding
import com.daml.lf.transaction.GlobalKey
import com.daml.lf.value.Value.ContractId
import com.daml.platform.db.migration.translation.{
ContractSerializer,
TransactionSerializer,
ValueSerializer,
}
import com.daml.platform.db.migration.translation.{ContractSerializer, TransactionSerializer, ValueSerializer}
import com.daml.platform.store.Contract.ActiveContract
import com.daml.platform.store.Conversions._
import com.daml.platform.store.entries.LedgerEntry
Expand Down Expand Up @@ -358,7 +354,7 @@ private[migration] class V2_1__Rebuild_Acs extends BaseJavaMigration {
// Note: ACS is typed as Unit here, as the ACS is given implicitly by the current database state
// within the current SQL transaction. All of the given functions perform side effects to update the database.
val atr = acsManager.addTransaction(
ledgerEffectiveTime,
ledgerEffectiveTime.toInstant,
transactionId,
workflowId,
tx.actAs,
Expand Down Expand Up @@ -462,8 +458,8 @@ private[migration] class V2_1__Rebuild_Acs extends BaseJavaMigration {
submissionId = None,
actAs = List(submitter),
workflowId = workflowId,
ledgerEffectiveTime = effectiveAt.toInstant,
recordedAt = recordedAt.toInstant,
ledgerEffectiveTime = Timestamp.assertFromInstant(effectiveAt.toInstant),
recordedAt = Timestamp.assertFromInstant(recordedAt.toInstant),
transaction = transactionSerializer
.deserializeTransaction(transactionId, transactionStream)
.getOrElse(sys.error(s"failed to deserialize transaction! trId: $transactionId")),
Expand All @@ -487,7 +483,7 @@ private[migration] class V2_1__Rebuild_Acs extends BaseJavaMigration {
val submissionId = Ref.SubmissionId.assertFromString(UUID.randomUUID().toString)
val rejectionReason = readRejectionReason(rejectionType, rejectionDescription)
offset -> LedgerEntry.Rejection(
recordTime = recordedAt.toInstant,
recordTime = Timestamp.assertFromInstant(recordedAt.toInstant),
commandId = commandId,
applicationId = applicationId,
submissionId = submissionId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package com.daml.platform.store.appendonlydao

import java.sql.Connection
import java.time.Instant
import akka.NotUsed
import akka.stream.scaladsl.Source
import com.daml.daml_lf_dev.DamlLf.Archive
Expand Down

0 comments on commit e875bfc

Please sign in to comment.