fix(sncast): re-enable StarkScan block explorer#4482
Conversation
| #[allow(clippy::unnecessary_wraps)] | ||
| pub fn validate_for_config(_block_explorer: Option<Self>) -> anyhow::Result<()> { |
There was a problem hiding this comment.
I think we should be able to remove this now that it's a no-op?
| @@ -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 | |||
| "}); | |||
There was a problem hiding this comment.
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
| "}); | |
| 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 | |
| "}); |
| [sncast.profile_with_stark_scan] | ||
| account = "user1" | ||
| url = "http://some.url" | ||
| network = "sepolia" | ||
| accounts-file = "/path/to/account.json" | ||
| block-explorer = "StarkScan" |
There was a problem hiding this comment.
You can delete this profile after applying https://github.com/foundry-rs/starknet-foundry/pull/4482/changes#r3544391101
|
|
||
| #### Fixed | ||
|
|
||
| - Re-enabled `StarkScan` as a supported `block-explorer` option. |
There was a problem hiding this comment.
| - Re-enabled `StarkScan` as a supported `block-explorer` option. | |
| - Re-enabled `StarkScan` as a supported `block-explorer` option (currently available only for `mainnet`). |
bd0cd76 to
5999092
Compare
DelevoXDG
left a comment
There was a problem hiding this comment.
As I mentioned before:
Please format
https://github.com/foundry-rs/starknet-foundry/actions/runs/28976070576/job/85984771524?pr=4482
| let result = MAINNET_RESPONSE.format_links( | ||
| Service::StarkScan | ||
| .as_provider(Network::Mainnet) | ||
| .unwrap(), | ||
| ); |
There was a problem hiding this comment.
| 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()); |
| url = "http://127.0.0.1:5055/rpc" | ||
| network = "sepolia" | ||
| account = "user1" | ||
| # Note: Any validation error should work here | ||
| block-explorer = "StarkScan" |
There was a problem hiding this comment.
StarkScan is no longer cause of validation error
| 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" |
f53112e to
01a0c00
Compare
|
@skyc1e please fix lint and resolve conflicts 🙏 |
01a0c00 to
c43e21d
Compare
|
@skyc1e please fix conflicts in changelog. |
Re-enables
StarkScanas ablock-exploreroption now thatstarkscan.cois 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 --checkhttps://starkscan.co/tx/...andhttps://starkscan.co/contract/...return 200 for the test hashesI could not run the Rust test suite locally because this Windows environment does not have
cargoinstalled.