fix(wallet,deploy): default sequencer URL from scaffold localnet port#84
Conversation
vpavlin
left a comment
There was a problem hiding this comment.
Clean extraction of a shared fallback URL helper. Replaces two hardcoded http://127.0.0.1:3040 literals with default_sequencer_http_url_for_project(), which reads from project.config.localnet.port — consistent with how localnet.rs already resolves the port.
Changes verified:
wallet topupnow falls back to the configured localnet port whensequencer_addris missing in wallet config ✅- `deploy} uses the same fallback logic ✅
- New integration test `wallet_topup_dry_run_planned_network_uses_localnet_port_without_wallet_sequencer_addr} passes ✅
- All 76 CLI tests pass, formatting clean ✅
One minor suggestion: the deploy-side fallback isn't covered by a new test (only the wallet topup path is tested). Consider adding a similar dry-run assertion for `deploy} to close the coverage gap. Not blocking.
Approve.
|
Thanks for the review and approve. I’ve added an integration test deploy_preflight_targets_localnet_port_when_wallet_omits_sequencer_addr so the deploy path is covered as well: wallet omits sequencer_addr, scaffold.toml sets a non-default [localnet] port, and we assert the preflight error on stderr includes http://127.0.0.1:{port} together with the existing reachability messaging. Pushed in the latest commit. @vpavlin |
danisharora099
left a comment
There was a problem hiding this comment.
LGTM. feel free to resolve merge conflcits and merge
|
@crazywriter1 can you, please, resolve conflict so that we merge? |
Hey, I’ll take a look and resolve the conflicts in a few hours. Thanks. |
5d12629 to
c5843f6
Compare
|
Conflicts resolved on latest master, and deploy-side fallback coverage has been added (deploy_preflight_targets_localnet_port_when_wallet_omits_sequencer_addr). Full cargo test passes. @weboko |
c5843f6 to
c4a6e68
Compare
Problem
When
wallet_config.jsonomitssequencer_addr,wallet topupanddeploystill defaulted tohttp://127.0.0.1:3040. That ignores[localnet] portinscaffold.toml, so a non-default localnet port and an unset wallet address pointed RPC at the wrong URL.Solution
default_sequencer_http_url_for_projectinwallet_supportto buildhttp://127.0.0.1:{project.config.localnet.port}(same default as localnet when[localnet]is omitted).sequencer_addris missing in bothdeployandwallet topup.[localnet] portis authoritative, defaultsequencer_addrfordeploy/wallet topupshould use the same port instead of hardcoding3040.Tests
wallet_topup_dry_run_planned_network_uses_localnet_port_without_wallet_sequencer_addrasserts dry-run output shows the URL with the configured port when the wallet omitssequencer_addr.localnet.port-based fallback.How to verify