fix: consider localnet in check_studio_based_rpc for leader-only mode #58
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.
Fix DXP-710
fix: consider localnet in check_studio_based_rpc for leader-only mode
Summary
This PR fixes the issue where running
glteston localnet withleader_only=Truewould show a warning "Leader only mode: True (enabled on non-studio network - will have no effect)" and would not actually enable leader-only mode.Changes:
check_studio_based_rpc()ingltest_cli/config/types.pyto returnTruefor both "studionet" and "localnet" (previously only "studionet")test_check_studio_based_rpc_with_localnet()to verify localnet returnsTruetest_check_studio_based_rpc_with_non_studionet()to use testnet_asimov instead of localnet for the negative casetest_general_config_chain_methods_compatibility()to expectTruefor localnetImpact:
This change affects three call sites where
check_studio_based_rpc()is used to determine whether to enable leader-only mode:gltest_cli/config/plugin.pygltest/contracts/contract.py(write operations)gltest/contracts/contract_factory.py(deployments)Review & Testing Checklist for Human
gltest --leader-only tests/on localnet and verify:check_studio_based_rpc()now returnsTruefor localnet, which may be semantically confusing. Consider if it should be renamed to something likesupports_leader_only_mode()oris_leader_only_network()in a follow-up PRcheck_studio_based_rpc()returningFalsefor localnetNotes