Skip to content

Commit

Permalink
CORE-16436 add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
vlajos committed Aug 18, 2023
1 parent 27288f9 commit c8c2736
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import org.osgi.service.component.annotations.Activate
import org.osgi.service.component.annotations.Component
import org.osgi.service.component.annotations.Reference
import org.osgi.service.component.annotations.ServiceScope.PROTOTYPE
import org.slf4j.LoggerFactory

@Component(
service = [ CheckpointInternalCustomSerializer::class, UsedByFlow::class ],
Expand All @@ -29,6 +30,8 @@ class WrappedUtxoWireTransactionKryoSerializer @Activate constructor(
}

override fun read(input: CheckpointInput, type: Class<out WrappedUtxoWireTransaction>): WrappedUtxoWireTransaction {
val log = LoggerFactory.getLogger(this::class.java.enclosingClass)
log.info("CORE-16436 WrappedUtxoWireTransactionKryoSerializer serialization service: $serialisationService")
val wireTransaction = input.readClassAndObject() as WireTransaction
return WrappedUtxoWireTransaction(
wireTransaction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package net.corda.ledger.utxo.data.transaction
import net.corda.ledger.utxo.data.state.LazyStateAndRefImpl
import net.corda.v5.application.serialization.SerializationService
import net.corda.v5.ledger.utxo.ContractState
import org.slf4j.LoggerFactory
import java.util.Objects

data class UtxoTransactionOutputDto(
Expand All @@ -27,10 +28,14 @@ data class UtxoTransactionOutputDto(

override fun hashCode(): Int = Objects.hash(transactionId, leafIndex, info, data)

fun <T : ContractState> toStateAndRef(serializationService: SerializationService) =
LazyStateAndRefImpl<T>(
fun <T : ContractState> toStateAndRef(serializationService: SerializationService): LazyStateAndRefImpl<T> {
val log = LoggerFactory.getLogger(this::class.java.enclosingClass)
log.info("CORE-16436 toStateAndRef serialization service: $serializationService")

return LazyStateAndRefImpl<T>(
this,
null,
serializationService
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import net.corda.v5.ledger.utxo.ContractState
import net.corda.v5.ledger.utxo.StateAndRef
import net.corda.v5.ledger.utxo.StateRef
import net.corda.v5.ledger.utxo.TimeWindow
import org.slf4j.LoggerFactory
import java.security.PublicKey

class WrappedUtxoWireTransaction(
Expand All @@ -24,6 +25,7 @@ class WrappedUtxoWireTransaction(
const val notaryNameIndex: Int = 0
const val notaryKeyIndex: Int = 1
const val timeWindowIndex: Int = 2
val log = LoggerFactory.getLogger(this::class.java.enclosingClass)
}

init{
Expand Down Expand Up @@ -81,6 +83,7 @@ class WrappedUtxoWireTransaction(
wireTransaction
.getComponentGroupList(UtxoComponentGroup.OUTPUTS.ordinal).size
) { index ->
log.info("CORE-16436 WrappedUtxoWireTransaction.outputStateAndRefs serialization service: $serializationService")
UtxoTransactionOutputDto(
id.toString(), index,
wireTransaction
Expand Down

0 comments on commit c8c2736

Please sign in to comment.