Skip to content

Commit 1f23ebf

Browse files
committed
ots: stop showing 'Digital Artifacts: None' for OTS commits
Two UI surfaces were showing 'None' under the Digital Artifacts label for transactions that ARE OpenTimestamps calendar commits: - transaction.component.html: 'None' was rendered whenever the parser-derived digitalArtifacts list was empty. OTS isn't parser-derivable (it's indexer-side knowledge), so OTS-only txs always landed in the empty bucket -- yet <app-ots-viewer> right below it rendered a full OTS panel, contradicting 'None'. Hide 'None' when tx.isOtsCommit === true; the OTS viewer carries the message. - block-overview-tooltip.component.{ts,html}: same root cause via a different path. hasAnyOrdpoolFlag() in ordpool-parser explicitly excludes ordpool_ots, so the fetcher returned [] for OTS-only txs and the tooltip showed 'None'. Compute isOtsCommit from tx.flags & ordpool_ots (bit 81 survives the JSON Number round-trip because precision loss happens in the lower 29 bits, not the high end), suppress 'None', and render a small inline OpenTimestamps panel.
1 parent 7faee0c commit 1f23ebf

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,22 @@
121121
Please try again!
122122
</ng-container>
123123

124-
<ng-container *ngIf="i.digitalArtifacts && !i.digitalArtifacts.length">
124+
<!-- HACK -- Ordpool: hide "None" when the tx is a known OTS
125+
commit -- the OTS panel below already says what's in it. -->
126+
<ng-container *ngIf="i.digitalArtifacts && !i.digitalArtifacts.length && !isOtsCommit">
125127
None
126128
</ng-container>
127129

130+
<!-- HACK -- Ordpool: OTS commits aren't parser-derivable, so they
131+
don't appear in `i.digitalArtifacts`. Render a small inline
132+
summary directly from the tx.flags bit instead. -->
133+
<div *ngIf="isOtsCommit" class="text-left" style="width: 300px;">
134+
<strong>OpenTimestamps</strong>
135+
<div class="smaller-text" style="opacity: 0.7;">
136+
Calendar batch commit anchoring a Merkle root in OP_RETURN
137+
</div>
138+
</div>
139+
128140
<div class="text-left" style="width: 300px;" *ngIf="i.digitalArtifacts && i.digitalArtifacts.length">
129141
<app-digital-artifact-viewer
130142
[showDetails]="false"

frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Price } from '@app/services/price.service';
44
import { TransactionStripped } from '@interfaces/node-api.interface.js';
55
import { Filter, FilterMode, TransactionFlags, toFilters } from '@app/shared/filters.utils';
66
import { Block } from '@interfaces/electrs.interface.js';
7-
import { DigitalArtifact, DigitalArtifactAnalyserService } from 'ordpool-parser';
7+
import { DigitalArtifact, DigitalArtifactAnalyserService, OrdpoolTransactionFlags } from 'ordpool-parser';
88
import { Observable, catchError, of, startWith } from 'rxjs';
99
import { DigitalArtifactsFetcherService } from '@app/services/ordinals/digital-artifacts-fetcher.service';
1010

@@ -39,6 +39,10 @@ export class BlockOverviewTooltipComponent implements OnChanges {
3939
timeMode: 'mempool' | 'mined' | 'missed' | 'after' = 'mempool';
4040
filters: Filter[] = [];
4141
activeFilters: { [key: string]: boolean } = {};
42+
// HACK -- Ordpool: surfaced separately so the Digital Artifacts cell
43+
// can render an OTS line and suppress the misleading "None" message
44+
// (OTS isn't parser-derivable; the parser-based fetcher returns []).
45+
isOtsCommit: boolean = false;
4246

4347
tooltipPosition: Position = { x: 0, y: 0 };
4448

@@ -74,6 +78,9 @@ export class BlockOverviewTooltipComponent implements OnChanges {
7478
this.feeRate = this.fee / this.vsize;
7579
this.effectiveRate = this.tx.rate;
7680
const txFlags = BigInt(this.tx.flags) || 0n;
81+
// HACK -- Ordpool: bit 81 is preserved across the JSON Number
82+
// round-trip even though the lower bits get quantized to ~2^29.
83+
this.isOtsCommit = (txFlags & OrdpoolTransactionFlags.ordpool_ots) !== 0n;
7784
this.acceleration = this.tx.acc || (txFlags & TransactionFlags.acceleration);
7885
this.hasEffectiveRate = this.tx.acc || !(Math.abs((this.fee / this.vsize) - this.effectiveRate) <= 0.1 && Math.abs((this.fee / Math.ceil(this.vsize)) - this.effectiveRate) <= 0.1)
7986
|| (txFlags && (txFlags & (TransactionFlags.cpfp_child | TransactionFlags.cpfp_parent)) > 0n);

frontend/src/app/components/transaction/transaction.component.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ <h2>Digital Artifacts</h2>
149149

150150
<div class="box">
151151

152-
<ng-container *ngIf="!digitalArtifacts.length">
152+
<!-- HACK -- Ordpool: don't show "None" when the tx is a known
153+
OpenTimestamps commit -- <app-ots-viewer> below renders its
154+
own panel for those, so "None" would directly contradict it. -->
155+
<ng-container *ngIf="!digitalArtifacts.length && tx.isOtsCommit !== true">
153156
None
154157
</ng-container>
155158

0 commit comments

Comments
 (0)