Skip to content

Commit 21d13ae

Browse files
committed
Move link
1 parent ba6c3fb commit 21d13ae

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

internal/transactions/transactions.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,6 @@ func (r *transactionResult) String() string {
149149

150150
_, _ = fmt.Fprintf(writer, "ID\t%s\n", r.tx.ID())
151151

152-
if blockExplorerLink := r.getBlockExplorerLink(); blockExplorerLink != "" {
153-
_, _ = fmt.Fprintf(writer, "View on Block Explorer\t%s\n", blockExplorerLink)
154-
}
155-
156152
_, _ = fmt.Fprintf(writer, "Payer\t%s\n", r.tx.Payer.Hex())
157153
_, _ = fmt.Fprintf(writer, "Authorizers\t%s\n", r.tx.Authorizers)
158154

@@ -245,6 +241,10 @@ func (r *transactionResult) String() string {
245241
_, _ = fmt.Fprint(writer, "\n\nFee Events (hidden, use --include fee-events)")
246242
}
247243

244+
if blockExplorerLink := r.getBlockExplorerLink(); blockExplorerLink != "" {
245+
_, _ = fmt.Fprintf(writer, "\n\n🔗 View on Block Explorer:\n%s", blockExplorerLink)
246+
}
247+
248248
_ = writer.Flush()
249249
return b.String()
250250
}

internal/transactions/transactions_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ Payload (hidden, use --include payload)`, output.OkEmoji()), "\n"), result.Strin
596596
result := transactionResult{tx: tx, result: txResult, network: "mainnet"}
597597

598598
output := result.String()
599-
assert.Contains(t, output, "View on Block Explorer")
599+
assert.Contains(t, output, "🔗 View on Block Explorer:")
600600
assert.Contains(t, output, "https://www.flowscan.io/tx/e913d1f3e431c7df49c99845bea9ebff9db11bbf25d507b9ad0fad45652d515f")
601601

602602
jsonResult := result.JSON()
@@ -610,7 +610,7 @@ Payload (hidden, use --include payload)`, output.OkEmoji()), "\n"), result.Strin
610610
result := transactionResult{tx: tx, result: txResult, network: "testnet"}
611611

612612
output := result.String()
613-
assert.Contains(t, output, "View on Block Explorer")
613+
assert.Contains(t, output, "🔗 View on Block Explorer:")
614614
assert.Contains(t, output, "https://testnet.flowscan.io/tx/e913d1f3e431c7df49c99845bea9ebff9db11bbf25d507b9ad0fad45652d515f")
615615

616616
jsonResult := result.JSON()
@@ -624,7 +624,7 @@ Payload (hidden, use --include payload)`, output.OkEmoji()), "\n"), result.Strin
624624
result := transactionResult{tx: tx, result: txResult, network: "emulator"}
625625

626626
output := result.String()
627-
assert.NotContains(t, output, "View on Block Explorer")
627+
assert.NotContains(t, output, "🔗 View on Block Explorer:")
628628

629629
jsonResult := result.JSON()
630630
jsonMap, ok := jsonResult.(map[string]any)
@@ -636,7 +636,7 @@ Payload (hidden, use --include payload)`, output.OkEmoji()), "\n"), result.Strin
636636
result := transactionResult{tx: tx, result: txResult, network: ""}
637637

638638
output := result.String()
639-
assert.NotContains(t, output, "View on Block Explorer")
639+
assert.NotContains(t, output, "🔗 View on Block Explorer:")
640640

641641
jsonResult := result.JSON()
642642
jsonMap, ok := jsonResult.(map[string]any)

0 commit comments

Comments
 (0)