Skip to content

fix(sncast): re-enable StarkScan block explorer#4482

Open
skyc1e wants to merge 3 commits into
foundry-rs:masterfrom
skyc1e:fix/starkscan-support
Open

fix(sncast): re-enable StarkScan block explorer#4482
skyc1e wants to merge 3 commits into
foundry-rs:masterfrom
skyc1e:fix/starkscan-support

Conversation

@skyc1e

@skyc1e skyc1e commented Jul 6, 2026

Copy link
Copy Markdown

Re-enables StarkScan as a block-explorer option now that starkscan.co is online again.

This restores mainnet StarkScan explorer links for sncast output and keeps unsupported-network handling consistent with other mainnet-only explorers. I also updated the config fixture, show-config expectation, docs table, and changelog.

Fixes #4464.

Checked locally:

  • git diff --check
  • https://starkscan.co/tx/... and https://starkscan.co/contract/... return 200 for the test hashes

I could not run the Rust test suite locally because this Windows environment does not have cargo installed.

@skyc1e
skyc1e requested a review from a team as a code owner July 6, 2026 15:08
@skyc1e
skyc1e requested review from DelevoXDG and MKowalski8 July 6, 2026 15:08

@DelevoXDG DelevoXDG left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good overall.

Please rebase and format

Comment on lines +20 to +21
#[allow(clippy::unnecessary_wraps)]
pub fn validate_for_config(_block_explorer: Option<Self>) -> anyhow::Result<()> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should be able to remove this now that it's a no-op?

Comment thread crates/sncast/tests/e2e/show_config.rs Outdated
Comment on lines +230 to +245
@@ -231,18 +231,18 @@ async fn test_stark_scan_as_block_explorer() {
let args = vec!["--profile", "profile_with_stark_scan", "show-config"];

let snapbox = runner(&args).current_dir(tempdir.path());
let output = snapbox.assert().failure();

assert_stderr_contains(
output,
indoc! { r"
Command: show-config
Error: Failed to load local config at [..]snfoundry.toml

Caused by:
starkscan.co was terminated and `'StarkScan'` is no longer available. Please set `block-explorer` to `'Voyager'` or other explorer of your choice.
" },
);
snapbox.assert().success().stdout_eq(formatdoc! {r"
Chain ID: alpha-sepolia
RPC URL: http://some.url
Account: user1
Accounts File Path: /path/to/account.json
Wait Timeout: 300s
Wait Retry Interval: 5s
Show Explorer Links: true
Block Explorer: StarkScan
Scarb Profile: release
Alias Count: 0
"});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This test currently doesn't pass, and snfoundry_invalid.toml is not the right config for this particular test.

Let's inline the config, and adjust it so the test passes

Suggested change
"});
let t = tempdir().unwrap();
fs::write(
t.path().join("snfoundry.toml"),
indoc! {r#"
[sncast.default]
account = "user1"
accounts-file = "/path/to/account.json"
block-explorer = "StarkScan"
"#},
)
.unwrap();
let args = vec!["show-config", "--network", "mainnet"];
let snapbox = runner(&args).current_dir(t.path());
snapbox.assert().success().stdout_eq(indoc! {r"
Chain ID: alpha-mainnet
Network: mainnet
Account: user1
Accounts File Path: /path/to/account.json
Wait Timeout: 300s
Wait Retry Interval: 5s
Show Explorer Links: true
Block Explorer: StarkScan
Scarb Profile: release
Alias Count: 0
"});

Comment on lines 7 to 11
[sncast.profile_with_stark_scan]
account = "user1"
url = "http://some.url"
network = "sepolia"
accounts-file = "/path/to/account.json"
block-explorer = "StarkScan"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread CHANGELOG.md Outdated

#### Fixed

- Re-enabled `StarkScan` as a supported `block-explorer` option.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Re-enabled `StarkScan` as a supported `block-explorer` option.
- Re-enabled `StarkScan` as a supported `block-explorer` option (currently available only for `mainnet`).

@skyc1e
skyc1e force-pushed the fix/starkscan-support branch from bd0cd76 to 5999092 Compare July 8, 2026 21:12

@DelevoXDG DelevoXDG left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment on lines +181 to +185
let result = MAINNET_RESPONSE.format_links(
Service::StarkScan
.as_provider(Network::Mainnet)
.unwrap(),
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
let result = MAINNET_RESPONSE.format_links(
Service::StarkScan
.as_provider(Network::Mainnet)
.unwrap(),
);
let result = MAINNET_RESPONSE
.format_links(Service::StarkScan.as_provider(Network::Mainnet).unwrap());

Comment on lines 2 to 6
url = "http://127.0.0.1:5055/rpc"
network = "sepolia"
account = "user1"
# Note: Any validation error should work here
block-explorer = "StarkScan"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

StarkScan is no longer cause of validation error

Suggested change
url = "http://127.0.0.1:5055/rpc"
network = "sepolia"
account = "user1"
# Note: Any validation error should work here
block-explorer = "StarkScan"
# Note: `url` and `network` together should cause validation error
# Any validation error should work here
url = "http://127.0.0.1:5055/rpc"
network = "sepolia"
account = "user1"

@skyc1e
skyc1e force-pushed the fix/starkscan-support branch from f53112e to 01a0c00 Compare July 13, 2026 14:32
@franciszekjob

Copy link
Copy Markdown
Contributor

@skyc1e please fix lint and resolve conflicts 🙏

@skyc1e
skyc1e force-pushed the fix/starkscan-support branch from 01a0c00 to c43e21d Compare July 16, 2026 11:39
@franciszekjob

Copy link
Copy Markdown
Contributor

@skyc1e please fix conflicts in changelog.

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.

Re-enable Starkscan support

3 participants