Skip to content

Commit 307277a

Browse files
authored
Merge pull request #46 from turbofart/latest
Moved link formatting to the variable declaration.
2 parents f296a60 + fb496e3 commit 307277a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

β€Žhds.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def poc_receipts_v1(activity):
507507
valid_text = "πŸ’© Invalid"
508508
time = nice_date(activity["time"])
509509

510-
txn_link = helium_explorer_tx + activity["hash"]
510+
txn_link = f'[πŸ”Ž](<{helium_explorer_tx}{activity["hash"]}>)'
511511

512512
witnesses = {}
513513
wit_count = 0
@@ -521,7 +521,7 @@ def poc_receipts_v1(activity):
521521
# challenge accepted
522522
if "challenger" in activity and activity["challenger"] == config["hotspot"]:
523523
output_message.append(
524-
f"🏁 ...Challenged Beaconer, {wit_text} `{time}` [πŸ”Ž](<{txn_link}>)"
524+
f"🏁 ...Challenged Beaconer, {wit_text} `{time}` {txn_link}"
525525
)
526526

527527
# beacon sent
@@ -540,7 +540,7 @@ def poc_receipts_v1(activity):
540540
if valid_wit_count == len(witnesses):
541541
valid_wit_count = "All"
542542
msg += f", {valid_wit_count} Valid"
543-
msg += f" `{time}` [πŸ”Ž](<{txn_link}>)"
543+
msg += f" `{time}` {txn_link}"
544544

545545
output_message.append(msg)
546546

@@ -570,14 +570,14 @@ def poc_receipts_v1(activity):
570570
witness_info += f", {vw} Valid"
571571

572572
output_message.append(
573-
f"{valid_text} Witness{witness_info} `{time}` [πŸ”Ž](<{txn_link}>)"
573+
f"{valid_text} Witness{witness_info} `{time}` {txn_link}"
574574
)
575575

576576
# other
577577
else:
578578
ac_type = activity["type"]
579579
output_message.append(
580-
f"🏁 poc_receipts_v1 - {ac_type.upper()} `{time}` [πŸ”Ž](<{txn_link}>)"
580+
f"🏁 poc_receipts_v1 - {ac_type.upper()} `{time}` {txn_link}"
581581
)
582582

583583

@@ -603,28 +603,28 @@ def loop_activities():
603603
# activity time
604604
time = nice_date(activity["time"])
605605

606-
txn_link = helium_explorer_tx + activity["hash"]
606+
txn_link = f'[πŸ”Ž](<{helium_explorer_tx}{activity["hash"]}>)'
607607

608608
# reward
609609
if activity["type"] == "rewards_v2":
610610
for reward in activity["rewards"]:
611611
rew = reward_short_name(reward["type"])
612612
amt = nice_hnt_amount_or_seconds(reward["amount"])
613613
output_message.append(
614-
f"πŸͺ Reward πŸ₯“{amt}, {rew} `{time}` [πŸ”Ž](<{txn_link}>)"
614+
f"πŸͺ Reward πŸ₯“{amt}, {rew} `{time}` {txn_link}"
615615
)
616616
# transferred data
617617
elif activity["type"] == "state_channel_close_v1":
618618
for summary in activity["state_channel"]["summaries"]:
619619
packet_plural = "s" if summary["num_packets"] != 1 else ""
620620
output_message.append(
621-
f"πŸš› Transferred {summary['num_packets']} Packet{packet_plural} ({summary['num_dcs']} DC) `{time}` [πŸ”Ž](<{txn_link}>)"
621+
f"πŸš› Transferred {summary['num_packets']} Packet{packet_plural} ({summary['num_dcs']} DC) `{time}` {txn_link}"
622622
)
623623

624624
# ...challenge accepted
625625
elif activity["type"] == "poc_request_v1":
626626
output_message.append(
627-
f"🎲 Created Challenge... `{time}` [πŸ”Ž](<{txn_link}>)"
627+
f"🎲 Created Challenge... `{time}` {txn_link}"
628628
)
629629

630630
# beacon sent, valid witness, invalid witness
@@ -635,7 +635,7 @@ def loop_activities():
635635
else:
636636
other_type = activity["type"]
637637
output_message.append(
638-
f"πŸš€ {other_type.upper()} `{time}` [πŸ”Ž](<{txn_link}>)"
638+
f"πŸš€ {other_type.upper()} `{time}` {txn_link}"
639639
)
640640

641641

0 commit comments

Comments
Β (0)