Skip to content

Commit bdd14c3

Browse files
authored
feat: Enhance forc-deploy UX with dialoguer (#6278)
## Description Improves the UX for forc-deploy in the following ways: - uses `dialoguer` for a nicer interface for entering password, selecting the wallet account from the list, and agreeing to sign. - displays the account information in a single line, with the ETH value shown rather than the raw gwei, similar to the browser wallet - only shows the base asset amount for accounts, rather than all assets, since only base asset can be used for gas fees. - for multiple-contract deployments, users now only have to choose the account and confirm once - added error handling for the case where multi-contract deployments have different networks specified in their manifests - Displays the network URL *before* deployment rather than after - After deployment, links to the contract and block in the block explorer rather than just showing the ID ### Single contract deployed ![Jul-17-2024 12-29-53](https://github.com/user-attachments/assets/f9ac8dbe-4473-4c71-95fa-7df758c550d8) ### Multiple contracts deployed (workspace) ![Jul-17-2024 12-33-11](https://github.com/user-attachments/assets/0270c05f-2495-4d90-a8e4-773cb1cd96b5) ## Checklist - [ ] I have linked to any relevant issues. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [ ] I have requested a review from the relevant team or maintainers.
1 parent 5085545 commit bdd14c3

File tree

14 files changed

+374
-125
lines changed

14 files changed

+374
-125
lines changed

Cargo.lock

Lines changed: 50 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

forc-plugins/forc-client/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ async-trait = "0.1.58"
1414
chrono = { version = "0.4", default-features = false, features = ["std"] }
1515
clap = { version = "4.5.4", features = ["derive", "env"] }
1616
devault = "0.1"
17+
dialoguer = "0.11"
1718
forc = { version = "0.62.0", path = "../../forc" }
1819
forc-pkg = { version = "0.62.0", path = "../../forc-pkg" }
1920
forc-tracing = { version = "0.62.0", path = "../../forc-tracing" }
@@ -42,6 +43,7 @@ tracing = "0.1"
4243

4344
[dev-dependencies]
4445
portpicker = "0.1.1"
46+
rexpect = "0.5"
4547
tempfile = "3"
4648
toml_edit = "0.21.1"
4749

forc-plugins/forc-client/src/constants.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ pub const BETA_2_ENDPOINT_URL: &str = "https://node-beta-2.fuel.network";
44
pub const BETA_3_ENDPOINT_URL: &str = "https://beta-3.fuel.network";
55
pub const BETA_4_ENDPOINT_URL: &str = "https://beta-4.fuel.network";
66
pub const BETA_5_ENDPOINT_URL: &str = "https://beta-5.fuel.network";
7+
pub const DEVNET_ENDPOINT_URL: &str = "https://devnet.fuel.network";
8+
pub const TESTNET_ENDPOINT_URL: &str = "https://testnet.fuel.network";
9+
710
pub const BETA_2_FAUCET_URL: &str = "https://faucet-beta-2.fuel.network";
811
pub const BETA_3_FAUCET_URL: &str = "https://faucet-beta-3.fuel.network";
912
pub const BETA_4_FAUCET_URL: &str = "https://faucet-beta-4.fuel.network";
1013
pub const BETA_5_FAUCET_URL: &str = "https://faucet-beta-5.fuel.network";
1114
pub const DEVNET_FAUCET_URL: &str = "https://faucet-devnet.fuel.network";
12-
pub const DEVNET_ENDPOINT_URL: &str = "https://devnet.fuel.network";
1315
pub const TESTNET_FAUCET_URL: &str = "https://faucet-testnet.fuel.network";
14-
pub const TESTNET_ENDPOINT_URL: &str = "https://testnet.fuel.network";
16+
17+
pub const TESTNET_EXPLORER_URL: &str = "https://app.fuel.network";
18+
1519
/// Default PrivateKey to sign transactions submitted to local node.
1620
pub const DEFAULT_PRIVATE_KEY: &str =
1721
"0xde97d8624a438121b86a1956544bd72ed68cd69f2c99555b08b1e8c51ffd511c";

0 commit comments

Comments
 (0)