feat: remove mailbox confirmation prompt for `warp init` command (#4485)
### Description This PR removes the mailbox address confirmation prompt from the `warp init` command. The command now uses the default mailbox value retrieved from the registry and asks for user input only if a mailbox address is not found in the registry for the selected chain. - Adds a `isAddressAndMatchesProtocol` function to validate that a provided string is a valid address and belongs to an expected protocol (Ethereum, Solana, ...) - Adds address validation for the user-provided mailbox address using the newly implemented `isAddressAndMatchesProtocol` function Before: <img width="839" alt="image" src="https://github.com/user-attachments/assets/8bc4dbd7-d812-4449-a9cb-4e714843163a"> After: <img width="672" alt="image" src="https://github.com/user-attachments/assets/bf890fe6-d95a-42e7-9bdd-fdb908aa2ac0"> <img width="1097" alt="image" src="https://github.com/user-attachments/assets/e586a33c-c56f-4973-ac87-4e1c8d3e759a"> <img width="913" alt="image" src="https://github.com/user-attachments/assets/c6263411-8728-4127-a39b-38929f541506"> ### Drive-by changes - No ### Related issues - Fixes https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/4463 ### Backward compatibility - Yes ### Testing - Manual testing Notes: - E2e test implementation was attempted but testing prompts have proven difficult and require further investigation/hacking to see if there is a way to test user prompts.pull/4537/head
parent
4151317b00
commit
aef3dbf4d6
@ -0,0 +1,5 @@ |
|||||||
|
--- |
||||||
|
'@hyperlane-xyz/cli': minor |
||||||
|
--- |
||||||
|
|
||||||
|
Remove mailbox choice prompt if it can be automatically detected from the registry |
Loading…
Reference in new issue