Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Subscan URL #14

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ impl From<RawData> for Report {
report.add_raw_text(format!(
"{} <b><a href=\"https://{}.subscan.io/validator/{}\">{}</a></b>",
is_active_desc,
data.network.name.to_lowercase().trim().replace(" ", ""),
data.network.name.to_lowercase().trim().replace(" ", "-"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The immediate patch looks good to me, hoever all of this looks very fragile.

If the name becomes "Creditcoin 3" then the URL will be incorrect again.

Q: where does the name come from? Is if hard-coded somewhere in the source code?

validator.stash,
validator.name,
));
Expand Down Expand Up @@ -363,7 +363,7 @@ impl From<RawData> for Report {
(<a href=\"https://{}.subscan.io/extrinsic/{:?}\">{}</a>) ✨",
payout.era_index,
payout.block_number,
data.network.name.to_lowercase().trim().replace(" ", ""),
data.network.name.to_lowercase().trim().replace(" ", "-"),
payout.extrinsic,
payout.extrinsic.to_string()
));
Expand Down Expand Up @@ -444,7 +444,7 @@ impl From<RawData> for Report {
"💯 Batch finalized at block #{}
(<a href=\"https://{}.subscan.io/extrinsic/{:?}\">{}</a>) ✨",
batch.block_number,
data.network.name.to_lowercase().trim().replace(" ", ""),
data.network.name.to_lowercase().trim().replace(" ", "-"),
batch.extrinsic,
batch.extrinsic.to_string()
));
Expand Down