Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Commit

Permalink
fix merge errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberphysic4l committed Nov 21, 2023
1 parent 311b2ef commit 62e675e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions components/dashboard/explorer_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func createExplorerBlock(block *model.Block, cachedBlock *blocks.Block, metadata
t.LikedInsteadChildren = lo.Map(cachedBlock.ShallowLikeChildren(), func(childBlock *blocks.Block) string {
return childBlock.ID().ToHex()
})
t.SpendIDs = lo.Map(cachedBlock.SpendIDs().ToSlice(), func(spendID iotago.TransactionID) string {
t.SpendIDs = lo.Map(cachedBlock.SpenderIDs().ToSlice(), func(spendID iotago.TransactionID) string {
return spendID.ToHex()
})
} else {
Expand Down Expand Up @@ -233,7 +233,7 @@ func getTransactionMetadata(c echo.Context) error {
return ierrors.Errorf("tx metadata not found: %s", txID.ToHex())
}

conflicts, _ := deps.Protocol.MainEngineInstance().Ledger.SpendDAG().ConflictingSpends(txID)
conflicts, _ := deps.Protocol.MainEngineInstance().Ledger.SpendDAG().ConflictingSpenders(txID)

return httpserver.JSONResponse(c, http.StatusOK, NewTransactionMetadata(txMetadata, conflicts))
}
Expand Down
6 changes: 3 additions & 3 deletions components/metrics/metrics_conflicts.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var ConflictMetrics = collector.NewCollection(conflictNamespace,
collector.WithType(collector.Counter),
collector.WithHelp("Time since transaction issuance to the conflict acceptance"),
collector.WithInitFunc(func() {
deps.Protocol.Events.Engine.SpendDAG.SpendAccepted.Hook(func(spendID iotago.TransactionID) {
deps.Protocol.Events.Engine.SpendDAG.SpenderAccepted.Hook(func(spendID iotago.TransactionID) {
if txMetadata, exists := deps.Protocol.MainEngineInstance().Ledger.MemPool().TransactionMetadata(spendID); exists {
firstAttachmentID := txMetadata.EarliestIncludedAttachment()
if block, blockExists := deps.Protocol.MainEngineInstance().BlockFromCache(firstAttachmentID); blockExists {
Expand All @@ -37,7 +37,7 @@ var ConflictMetrics = collector.NewCollection(conflictNamespace,
collector.WithType(collector.Counter),
collector.WithHelp("Number of resolved (accepted) conflicts"),
collector.WithInitFunc(func() {
deps.Protocol.Events.Engine.SpendDAG.SpendAccepted.Hook(func(spendID iotago.TransactionID) {
deps.Protocol.Events.Engine.SpendDAG.SpenderAccepted.Hook(func(spendID iotago.TransactionID) {
deps.Collector.Increment(conflictNamespace, resolvedConflictCount)
}, event.WithWorkerPool(Component.WorkerPool))
}),
Expand All @@ -46,7 +46,7 @@ var ConflictMetrics = collector.NewCollection(conflictNamespace,
collector.WithType(collector.Counter),
collector.WithHelp("Number of created conflicts"),
collector.WithInitFunc(func() {
deps.Protocol.Events.Engine.SpendDAG.SpendCreated.Hook(func(spendID iotago.TransactionID) {
deps.Protocol.Events.Engine.SpendDAG.SpenderCreated.Hook(func(spendID iotago.TransactionID) {
deps.Collector.Increment(conflictNamespace, allConflictCounts)
}, event.WithWorkerPool(Component.WorkerPool))
}),
Expand Down
6 changes: 3 additions & 3 deletions components/metrics/metrics_slots.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ var SlotMetrics = collector.NewCollection(slotNamespace,
deps.Collector.Update(slotNamespace, createdConflicts, 0, strconv.Itoa(eventSlot))
}, event.WithWorkerPool(Component.WorkerPool))

deps.Protocol.Events.Engine.SpendDAG.SpendCreated.Hook(func(spendID iotago.TransactionID) {
deps.Protocol.Events.Engine.SpendDAG.SpenderCreated.Hook(func(spendID iotago.TransactionID) {
if txMetadata, exists := deps.Protocol.MainEngineInstance().Ledger.TransactionMetadata(spendID); exists {
for _, attachment := range txMetadata.ValidAttachments() {
deps.Collector.Increment(slotNamespace, createdConflicts, strconv.Itoa(int(attachment.Slot())))
Expand All @@ -115,7 +115,7 @@ var SlotMetrics = collector.NewCollection(slotNamespace,
deps.Collector.Update(slotNamespace, acceptedConflicts, 0, strconv.Itoa(eventSlot))
}, event.WithWorkerPool(Component.WorkerPool))

deps.Protocol.Events.Engine.SpendDAG.SpendAccepted.Hook(func(spendID iotago.TransactionID) {
deps.Protocol.Events.Engine.SpendDAG.SpenderAccepted.Hook(func(spendID iotago.TransactionID) {
if txMetadata, exists := deps.Protocol.MainEngineInstance().Ledger.TransactionMetadata(spendID); exists {
for _, attachmentBlockID := range txMetadata.ValidAttachments() {
if attachment, exists := deps.Protocol.MainEngineInstance().BlockCache.Block(attachmentBlockID); exists && attachment.IsAccepted() {
Expand All @@ -139,7 +139,7 @@ var SlotMetrics = collector.NewCollection(slotNamespace,
deps.Collector.Update(slotNamespace, rejectedConflicts, 0, strconv.Itoa(eventSlot))
}, event.WithWorkerPool(Component.WorkerPool))

deps.Protocol.Events.Engine.SpendDAG.SpendRejected.Hook(func(spendID iotago.TransactionID) {
deps.Protocol.Events.Engine.SpendDAG.SpenderRejected.Hook(func(spendID iotago.TransactionID) {
if txMetadata, exists := deps.Protocol.MainEngineInstance().Ledger.TransactionMetadata(spendID); exists {
for _, attachmentBlockID := range txMetadata.ValidAttachments() {
if attachment, exists := deps.Protocol.MainEngineInstance().BlockCache.Block(attachmentBlockID); exists && attachment.IsAccepted() {
Expand Down

0 comments on commit 62e675e

Please sign in to comment.