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

Fixed block explorer links #2466

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

integraledelebesgue
Copy link
Member

@integraledelebesgue integraledelebesgue commented Sep 12, 2024

Closes #2425
Closes #2429

Introduced changes

  • Cast commands committing transaction output properly formatted links
  • Links differentiate Mainnet and Sepolia
  • Functions used to prepare links have appropriate unit tests

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added relevant tests
  • Performed self-review of the code
  • Added changes to CHANGELOG.md

@integraledelebesgue integraledelebesgue linked an issue Sep 12, 2024 that may be closed by this pull request
@cptartur
Copy link
Member

Please also link issue #2425 to this PR

Comment on lines +179 to +192
async fn assert_valid_links(input: &str) {
let pattern = Regex::new(r"transaction: |contract: |class: ").unwrap();
let links = pattern.replace_all(input, "");
let mut links = links.split('\n');

let contract = links.next().unwrap();
let transaction = links.next().unwrap();

let (contract_response, transaction_response) =
tokio::join!(reqwest::get(contract), reqwest::get(transaction));

assert!(contract_response.is_ok());
assert!(transaction_response.is_ok());
}
Copy link
Member

Choose a reason for hiding this comment

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

Not 100% like this being reliant on the order of links and a regex. But I see that rust doesn't really support lookbehind/lookahead in regex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix block explorer links All sncast block explorer urls point to mainnet starscan
3 participants