mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
[In-memory fan-out] Handle null
submitters in getTransactionLogUpdates (#10248)
* [In-memory fan-out] Handle `null` submitters in getTransactionLogUpdates CHANGELOG_BEGIN CHANGELOG_END * Address review comments
This commit is contained in:
parent
584169a2cc
commit
de7a08fa7b
@ -866,7 +866,7 @@ private[backend] trait CommonStorageBackend[DB_BATCH] extends StorageBackend[DB_
|
||||
int("create_argument_compression").? ~
|
||||
array[String]("tree_event_witnesses") ~
|
||||
array[String]("flat_event_witnesses") ~
|
||||
array[String]("submitters") ~
|
||||
array[String]("submitters").? ~
|
||||
str("exercise_choice").? ~
|
||||
binaryStream("exercise_argument").? ~
|
||||
int("exercise_argument_compression").? ~
|
||||
@ -900,7 +900,7 @@ private[backend] trait CommonStorageBackend[DB_BATCH] extends StorageBackend[DB_
|
||||
createArgumentCompression,
|
||||
treeEventWitnesses.toSet,
|
||||
flatEventWitnesses.toSet,
|
||||
submitters.toSet,
|
||||
submitters.map(_.toSet).getOrElse(Set.empty),
|
||||
exerciseChoice,
|
||||
exerciseArgument,
|
||||
exerciseArgumentCompression,
|
||||
|
@ -292,6 +292,11 @@ private[dao] trait JdbcLedgerDaoSuite extends JdbcLedgerDaoBackend {
|
||||
)
|
||||
}
|
||||
|
||||
protected final def noSubmitterInfo(
|
||||
transaction: LedgerEntry.Transaction
|
||||
): LedgerEntry.Transaction =
|
||||
transaction.copy(commandId = None, actAs = List.empty, applicationId = None)
|
||||
|
||||
protected final def fromTransaction(
|
||||
transaction: CommittedTransaction,
|
||||
actAs: List[Party] = List(alice),
|
||||
|
@ -7,6 +7,7 @@ import java.util.concurrent.atomic.AtomicLong
|
||||
|
||||
import akka.NotUsed
|
||||
import akka.stream.scaladsl.{Sink, Source}
|
||||
import com.daml.ledger
|
||||
import com.daml.ledger.participant.state.v1.Offset
|
||||
import com.daml.lf.ledger.EventId
|
||||
import com.daml.lf.transaction.Node
|
||||
@ -50,7 +51,8 @@ private[dao] trait JdbcLedgerDaoTransactionLogUpdatesSpec
|
||||
it should "return the correct transaction log updates" in {
|
||||
for {
|
||||
from <- ledgerDao.lookupLedgerEndOffsetAndSequentialId()
|
||||
(offset1, t1) <- store(singleCreate)
|
||||
(createOffset, createTx) = singleCreate
|
||||
(offset1, t1) <- store(createOffset -> noSubmitterInfo(createTx))
|
||||
(offset2, t2) <- store(txCreateContractWithKey(alice, "some-key"))
|
||||
(offset3, t3) <- store(
|
||||
singleExercise(
|
||||
@ -124,6 +126,10 @@ private[dao] trait JdbcLedgerDaoTransactionLogUpdatesSpec
|
||||
actualEventsById.get(expectedEventId)
|
||||
actualCreated.contractId shouldBe nodeCreate.coid
|
||||
actualCreated.templateId shouldBe nodeCreate.templateId
|
||||
actualCreated.submitters should contain theSameElementsAs expected.actAs
|
||||
.map(_.toString)
|
||||
.toSet
|
||||
ledger.CommandId.fromString(actualCreated.commandId).toOption shouldBe expected.commandId
|
||||
actualCreated.treeEventWitnesses shouldBe nodeCreate.informeesOfNode
|
||||
actualCreated.flatEventWitnesses shouldBe nodeCreate.stakeholders
|
||||
actualCreated.createSignatories shouldBe nodeCreate.signatories
|
||||
@ -139,6 +145,12 @@ private[dao] trait JdbcLedgerDaoTransactionLogUpdatesSpec
|
||||
|
||||
actualExercised.contractId shouldBe nodeExercises.targetCoid
|
||||
actualExercised.templateId shouldBe nodeExercises.templateId
|
||||
actualExercised.submitters should contain theSameElementsAs expected.actAs
|
||||
.map(_.toString)
|
||||
.toSet
|
||||
ledger.CommandId
|
||||
.fromString(actualExercised.commandId)
|
||||
.toOption shouldBe expected.commandId
|
||||
if (actualExercised.consuming)
|
||||
actualExercised.flatEventWitnesses shouldBe nodeExercises.stakeholders
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user