fix: change network before operating with lands#3345
Open
alejandralevy wants to merge 2 commits intomasterfrom
Open
fix: change network before operating with lands#3345alejandralevy wants to merge 2 commits intomasterfrom
alejandralevy wants to merge 2 commits intomasterfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Pull Request Test Coverage Report for Build 22059422648Details
💛 - Coveralls |
alejandralevy
commented
Feb 16, 2026
| } | ||
|
|
||
| /** Validate that the user's wallet is on Ethereum network for write operations. */ | ||
| function* validateAndSwitchNetwork() { |
Contributor
Author
There was a problem hiding this comment.
maybe rename to something like changeToEthereumNetwork ? wdyt? @RocioCM
Member
There was a problem hiding this comment.
Yess, rename it, sounds better! validateAndSwitchNetwork sounds like you can choose which network to validate, but this function always targets ethereum.
cyaiox
approved these changes
Feb 16, 2026
RocioCM
approved these changes
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Redirect to mainnet when operating with lands and states
Transferring an estate (or performing any land write operation) while connected to the Polygon network triggers a transaction that silently does nothing, since the LAND/Estate contracts only exist on Ethereum.
Fix: Added a
validateAndSwitchNetwork()helper to src/modules/land/sagas.ts . Before every write operation, it checks if the user's wallet is on the Ethereum network — if not, it prompts them to switch via switchNetworkRequest and waits forSWITCH_NETWORK_SUCCESSbefore proceeding. Applied to all 7 land write handlers:transfer,setUpdateManager,dissolveEstate,createEstate,editEstate,setOperator, andeditLand.Screen.Recording.2026-02-16.at.10.49.30.mov
Screen.Recording.2026-02-16.at.11.37.17.mov