Skip to content

Commit 2b3627f

Browse files
daithihearnclaude
andauthored
Hotfix/7.0.1 (#97)
* Fix: auto-include VET transfers when business events require them BusinessEventProcessor already detected VET_TRANSFER references in business event definitions but this wasn't propagated to the LogsIndexer fetch layer, so transfer logs were never retrieved from the Thor API. Expose needsVetTransfers through BusinessEventProcessor and CombinedEventProcessor so IndexerFactory can set excludeVetTransfers correctly on the LogsIndexer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix: update project version to 7.0.1 --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 590d02f commit 2b3627f

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jacoco {
2020

2121
group = "org.vechain"
2222

23-
val projectVersion = System.getenv("PROJECT_VERSION") ?: "7.0.0"
23+
val projectVersion = System.getenv("PROJECT_VERSION") ?: "7.0.1"
2424
version = projectVersion
2525

2626
val isSnapshot = version.toString().endsWith("SNAPSHOT")

src/main/kotlin/org.vechain.indexer/IndexerFactory.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ class IndexerFactory {
5656
substitutionParams = substitutionParams,
5757
)
5858

59+
val needsVetTransfers = includeVetTransfers || eventProcessor.needsVetTransfers()
60+
5961
// If `includeFullBlock` is true, return a `BlockIndexer`
6062
return if (includeFullBlock || dependsOn != null) {
6163
BlockIndexer(
@@ -78,7 +80,7 @@ class IndexerFactory {
7880
processor = processor!!,
7981
startBlock = startBlock,
8082
syncLoggerInterval = syncLoggerInterval,
81-
excludeVetTransfers = !includeVetTransfers,
83+
excludeVetTransfers = !needsVetTransfers,
8284
blockBatchSize = blockBatchSize,
8385
logFetchLimit = logFetchLimit,
8486
eventCriteriaSet = eventCriteriaSet ?: emptyList(),

src/main/kotlin/org.vechain.indexer/event/BusinessEventProcessor.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ open class BusinessEventProcessor(
3333
envParams = substitutionParams,
3434
)
3535

36+
val needsVetTransfers: Boolean = containsVetTransferEvent(businessEvents)
37+
3638
private val abiEventProcessor: AbiEventProcessor =
3739
AbiEventProcessor(
3840
basePath = abiBasePath,
3941
eventNames = extractAbiEventNames(businessEvents),
4042
contractAddresses = businessEventContracts,
41-
includeVetTransfers = containsVetTransferEvent(businessEvents),
43+
includeVetTransfers = needsVetTransfers,
4244
)
4345

4446
override fun processEvents(block: Block): List<IndexedEvent> {

src/main/kotlin/org.vechain.indexer/event/CombinedEventProcessor.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ protected constructor(
7070
(abiEventProcessor != null && abiEventProcessor.eventAbis.isNotEmpty())
7171
}
7272

73+
/** Returns whether any business event requires VET transfer logs. */
74+
fun needsVetTransfers(): Boolean = businessEventProcessor?.needsVetTransfers == true
75+
7376
/**
7477
* @param block The block containing events to process.
7578
* @return A list of decoded events and their associated parameters.

0 commit comments

Comments
 (0)